Exemplo n.º 1
0
 public function __construct($dbName = null, $dbConnection = null, $tableName = 'sessions', $sessionName = '__sess', $lifetime = 3600, $path = null, $domain = null, $secure = false, $httpOnly = TRUE)
 {
     $this->dbName = $dbName;
     parent::__construct($dbConnection);
     $this->tableName = $tableName;
     $this->sessionName = $sessionName;
     $this->lifetime = $lifetime;
     $this->path = $path;
     $this->domain = $domain;
     $this->secure = $secure;
     $this->httpOnly = $httpOnly;
     $this->logger = \GTFramework\App::getLogger();
     LOG < 0 ?: $this->logger->log('__construct in DBSession called with params: ' . 'dbName: ' . $dbName . ', dbConnection = ' . $dbConnection . ', tableName = ' . $tableName . ', sessionName = ' . $sessionName . ', lifetime = ' . $lifetime . ', path = ' . $path . ', domain = ' . $domain . ', secure = ' . $secure . ', httpOnly = ' . $httpOnly);
     if (rand(0, 100) === 52) {
         //            echo '<pre>' . print_r('------------------CLEAR-----CLEAR----CLEAR-------------', TRUE) . '</pre><br />';
         $this->dbClearOldSessions();
     }
     if (isset($_COOKIE[$sessionName])) {
         $this->sessionId = $_COOKIE[$sessionName];
     }
     if (strlen($this->sessionId) < 32) {
         LOG < 2 ?: $this->logger->log('__construct in DBSession check strlen of sessionId < 32 : ( ' . strlen($this->sessionId) . ' )');
         $this->startNewSession();
     } else {
         if (!$this->validateSession()) {
             LOG < 2 ?: $this->logger->log('__construct in DBSession validate session');
             $this->startNewSession();
         }
     }
 }
Exemplo n.º 2
0
 public function __construct()
 {
     parent::__construct();
     $dbCfg = \GTFramework\App::getInstance()->getConfig()->db;
     $this->dbName = $dbCfg['Administration']['dbName'];
     $this->dbTable = $dbCfg['Administration']['dbTable'];
     $this->dbRoles = $dbCfg['Administration']['col']['Roles'];
     $this->userLevel = $dbCfg['Administration']['col']['UserLevel'];
 }
Exemplo n.º 3
0
 public function __construct()
 {
     parent::__construct();
     $dbCfg = \GTFramework\App::getInstance()->getConfig()->db;
     $this->dbName = $dbCfg['Users']['dbName'];
     $this->dbTable = $dbCfg['Users']['dbTable'];
     $this->username = $dbCfg['Users']['col']['UserName'];
     $this->email = $dbCfg['Users']['col']['Email'];
     $this->firstName = $dbCfg['Users']['col']['FirstName'];
     $this->lastName = $dbCfg['Users']['col']['LastName'];
     $this->password = $dbCfg['Users']['col']['Password'];
     $this->createdOn = $dbCfg['Users']['col']['CreatedOn'];
     $this->lastLoged = $dbCfg['Users']['col']['LastLoged'];
     $this->sessionId = $dbCfg['Users']['col']['SessionId'];
     $this->isDeleted = $dbCfg['Users']['col']['IsDeleted'];
 }