Exemplo n.º 1
0
 public function run()
 {
     $db = new SimpleDB();
     $list = $db->sql("SELECT * FROM ban_ip")->fetchAllAssoc();
     foreach ($list as $ip) {
         if ($_SERVER['REMOTE_ADDR'] == $ip['ip']) {
             throw new \Exception("Currently your IP is blocked by admin");
         }
     }
     CSRF::getInstance()->generate();
     Auth::doAuth();
     $this->_frontController = FrontController::getInstance();
     if ($this->router instanceof \SSFrame\Routers\iRouter) {
         $this->_frontController->setRouter($this->router);
     } else {
         $this->_frontController->setRouter(new Route());
     }
     $this->_frontController->parseRouter();
     CSRF::getInstance()->check();
 }
Exemplo n.º 2
0
 public function __construct($dbConnection, $name, $tableName = 'session', $lifetime = 3600, $path = null, $domain = null, $secure = false)
 {
     parent::__construct($dbConnection);
     $this->tableName = $tableName;
     $this->sessionName = $name;
     $this->lifetime = $lifetime;
     $this->path = $path;
     $this->domain = $domain;
     $this->secure = $secure;
     $this->sessionId = $_COOKIE[$name];
     if (rand(0, 50) == 1) {
         $this->_gc();
     }
     if (strlen($this->sessionId) < 32) {
         $this->_startNewSession();
     } else {
         if (!$this->_validateSession()) {
             $this->_startNewSession();
         }
     }
 }
Exemplo n.º 3
0
 public function __construct()
 {
     parent::__construct();
 }