Ejemplo n.º 1
0
 /**
  * {@inheritDoc}
  */
 public function setDateOfLoginAttempt($dateOfLoginAttempt)
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'setDateOfLoginAttempt', array($dateOfLoginAttempt));
     return parent::setDateOfLoginAttempt($dateOfLoginAttempt);
 }
Ejemplo n.º 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;
 }