예제 #1
0
 /**
  * Redirects the application using headers and client-side http headers.
  * Should be only called within a controller.
  *
  * @param String $NewLocation the new application
  */
 function Redirect($NewLocation, $RedirectParamsAsWell = false, $HowManyParamsToStrip = 0)
 {
     if ($RedirectParamsAsWell) {
         $x = explode("&", HttpRequest::QueryString());
         while ($HowManyParamsToStrip--) {
             if (is_array($x) && count($x) > 1) {
                 array_shift($x);
             }
         }
         $x = implode("&", $x);
         if ($x) {
             if (strpos($NewLocation, "?") === false) {
                 $x = "?{$x}";
             } elseif (strpos($NewLocation, "?") === strlen($NewLocation) - 1) {
                 $x = "{$x}";
             } else {
                 $x = "&{$x}";
             }
         }
     } else {
         $x = "";
     }
     header("location: {$NewLocation}{$x}");
     exit;
 }
예제 #2
0
 function Insert()
 {
     if (jf::$RunMode->IsCLI()) {
         return false;
     }
     $res = jf::SQL("INSERT INTO {$this->TablePrefix()}stats (UserID,SessionID,Timestamp,Page,Query,IP,Host,Protocol,UserAgent) VALUES\n\t\t\t(?,?,?,?,?,?,?,?,?)", jf::CurrentUser() ?: 0, jf::$Session->SessionID(), jf::time(), HttpRequest::URI(), HttpRequest::QueryString(), HttpRequest::IP(), HttpRequest::Host(), HttpRequest::Protocol(), HttpRequest::UserAgent());
     return $res;
 }