/**
  * {@inheritDoc}
  */
 public function setCountOfLoginAttempts($countOfLoginAttempts)
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'setCountOfLoginAttempts', array($countOfLoginAttempts));
     return parent::setCountOfLoginAttempts($countOfLoginAttempts);
 }
示例#2
0
 /**
  * Updates the specified profile on login. Saves profile to session
  *
  * @param \XLite\Model\Profile $profile Profile object
  *
  * @return boolean
  */
 public function loginProfile(\XLite\Model\Profile $profile)
 {
     $result = $profile->isPersistent();
     if ($result) {
         // Restart session
         \XLite\Core\Session::getInstance()->restart();
         $loginTime = \XLite\Core\Converter::time();
         // Check for the first time login
         if (!$profile->getFirstLogin()) {
             // Set first login date
             $profile->setFirstLogin($loginTime);
         }
         $profile->setCountOfLoginAttempts(0);
         $profile->setDateOfLoginAttempt(0);
         // Set last login date
         $profile->setLastLogin($loginTime);
         // Update profile
         $profile->update();
         // Save profile Id in session
         \XLite\Core\Session::getInstance()->profile_id = $profile->getProfileId();
         \XLite\Core\Session::getInstance()->forceChangePassword = $profile->getForceChangePassword();
         // Save login in cookies
         $this->rememberLogin($profile->getLogin());
     }
     return $result;
 }