示例#1
0
 public function __construct()
 {
     parent::__construct();
     $tableName = rex::getTablePrefix() . 'user';
     $this->setSqlDb(1);
     $this->setSystemId(self::SYSTEM_ID);
     $this->setSessionDuration(rex::getProperty('session_duration'));
     $qry = 'SELECT * FROM ' . $tableName . ' WHERE status=1';
     $this->setUserQuery($qry . ' AND id = :id');
     $this->setLoginQuery($qry . '
         AND login = :login
         AND (login_tries < ' . self::LOGIN_TRIES_1 . '
             OR login_tries < ' . self::LOGIN_TRIES_2 . ' AND UNIX_TIMESTAMP(lasttrydate) < ' . (time() - self::RELOGIN_DELAY_1) . '
             OR UNIX_TIMESTAMP(lasttrydate) > ' . (time() - self::RELOGIN_DELAY_2) . '
         )');
     $this->tableName = $tableName;
 }
示例#2
0
 public function __construct()
 {
     parent::__construct();
     $tableName = rex::getTablePrefix() . 'user';
     $this->setSqlDb(1);
     $this->setSystemId(self::SYSTEM_ID);
     $this->setSessionDuration(rex::getProperty('session_duration'));
     $qry = 'SELECT * FROM ' . $tableName . ' WHERE status=1';
     $this->setUserQuery($qry . ' AND id = :id');
     // XXX because with concat the time into the sql query, users of this class should use checkLogin() immediately after creating the object.
     $this->setLoginQuery($qry . '
         AND login = :login
         AND (login_tries < ' . self::LOGIN_TRIES_1 . '
             OR login_tries < ' . self::LOGIN_TRIES_2 . ' AND UNIX_TIMESTAMP(lasttrydate) < ' . (time() - self::RELOGIN_DELAY_1) . '
             OR UNIX_TIMESTAMP(lasttrydate) < ' . (time() - self::RELOGIN_DELAY_2) . '
         )');
     $this->tableName = $tableName;
 }