Ejemplo n.º 1
0
 public function getRoute()
 {
     if ($this->route) {
         return $this->route;
     }
     $action = if_empty($_GET, 'action', null);
     $query = $this->splitQueryString($this->getQueryString());
     $param = $this->param = array_slice($query, 1);
     //        var_dump($action);
     //        exit;
     if (isset($action)) {
         $x = isset($action) ? $this->__URIPath($action) : array();
     } else {
         $x = isset($query[0]) ? $this->__URIPath($query[0]) : array();
     }
     $this->route = new \stdClass();
     $this->route->path = if_empty($x, 'dirname', '');
     $this->route->class = if_empty($x, 'filename', 'index');
     $this->route->action = if_empty($x, 'extension', 'execute');
     $this->route->controller = rtrim($this->route->path, '/') . '/' . $this->route->class;
     $this->route->param = $param;
     return $this->route;
 }
Ejemplo n.º 2
0
 function write($sessionId, $data)
 {
     $meet_again_baby = 900;
     $key = $this->getkey($sessionId);
     //        $this->err($key);
     // TODO::sudo php5enmod mcrypt
     //        $crypt = new Crypt ();
     //        $crypt->setComplexTypes(TRUE);
     //        $crypt->setKey($key);
     //        $crypt->setData($data);
     //        $encrypt = $crypt->encrypt();
     //        $crypt = new \Crypt\AES ();
     //        $encrypt = $crypt->encrypt($data, $this->key, $this->iv);
     //        $security = new AES();
     //        $encrypt = $security->encrypt($data, $this->key, $this->iv);
     //        $security = new Security();
     //        $encrypt = $security->encrypt($data, $key);
     $crypt = new MCrypt($key);
     $encrypt = $crypt->encrypt($data);
     //        $this->err($data);
     //        $this->err($encrypt);
     $userid = if_empty($_SESSION, 'userid', null);
     //        $userid = if_exists($_SESSION['admin'], 'id', if_exists($_SESSION['user'], 'id', null));
     $data = array('id' => $sessionId, 'address' => $_SERVER['REMOTE_ADDR'], 'agent' => $_SERVER['HTTP_USER_AGENT'], 'userid' => $userid, 'privilege' => $encrypt, 'server' => $_SERVER['HTTP_HOST'], 'request' => substr($_SERVER['REQUEST_URI'], 0, 255), 'referer' => isset($_SERVER['HTTP_REFERER']) ? substr($_SERVER['HTTP_REFERER'], 0, 255) : '', 'timer' => Timer::getMicroTime() - self::$sessionMicrotime, 'created' => Timestamp::getUNIXtime(), 'updated' => Timestamp::getUNIXtime() - $meet_again_baby, 'session_key' => $key);
     $res = $this->AutoExecuteReplace('sessions', $data);
     return $res;
 }
Ejemplo n.º 3
0
        echo display_artists($Artists, true);
    }
    ?>
				<a href="torrents.php?id=<?php 
    echo $GroupID;
    ?>
"><?php 
    echo $GroupName;
    ?>
</a>
		</td>
<?php 
    if ($Active) {
        ?>
				<td>Yes, expires in: <?php 
        echo if_empty(time_diff(strtotime($Expires)), 'Expired');
        ?>
</td>
<?php 
    } else {
        ?>
				<td>No, will be active in: <?php 
        echo findClosestTime();
        ?>
</td>
<?php 
    }
    ?>
				<td><?php 
    echo $Bonus;
    ?>
Ejemplo n.º 4
0
 function set_if_empty(&$what, $then = null, $ignore = ['0', 0, null])
 {
     $what = if_empty($what, $then, $ignore);
 }