Пример #1
0
 /**
  * Prüft, ob Login gesperrt ist
  */
 protected function loginLocked()
 {
     if (!\fpcm\classes\http::getSessionVar('loginAttempts')) {
         \fpcm\classes\http::setSessionVar('loginAttempts', $this->currentAttempts);
     } else {
         $this->currentAttempts = \fpcm\classes\http::getSessionVar('loginAttempts');
     }
     if (\fpcm\classes\http::getSessionVar('lockedTime')) {
         $this->loginLockedDate = \fpcm\classes\http::getSessionVar('lockedTime');
     }
     if ($this->currentAttempts >= $this->config->system_loginfailed_locked) {
         $this->loginLocked = true;
         if (!$this->loginLockedDate) {
             $this->loginLockedDate = time();
             \fpcm\classes\http::setSessionVar('lockedTime', $this->loginLockedDate);
         }
     }
     if ($this->loginLocked && $this->loginLockedDate + $this->loginLockedExpire <= time()) {
         $this->loginLocked = false;
         $this->loginLockedDate = 0;
         $this->currentAttempts = 0;
         session_destroy();
     }
 }