Exemplo n.º 1
0
 /**
  * Update the user record with latest login information.
  *
  * @param Entity\Users $userEntity
  *
  * @return boolean
  */
 protected function updateUserLogin(Entity\Users $userEntity)
 {
     $userEntity->setLastseen(new \DateTime());
     $userEntity->setLastip($this->remoteIP);
     $userEntity->setFailedlogins(0);
     $userEntity->setThrottleduntil($this->throttleUntil(0));
     $userEntity = $this->updateUserShadowLogin($userEntity);
     // Don't try to save the password on login
     unset($userEntity->password);
     if ($this->repositoryUsers->save($userEntity)) {
         $this->flashLogger->success(Trans::__("You've been logged on successfully."));
         return true;
     }
     return false;
 }
Exemplo n.º 2
0
Arquivo: Login.php Projeto: bolt/bolt
 /**
  * Update the user record with latest login information.
  *
  * @param Entity\Users $userEntity
  *
  * @return boolean
  */
 protected function updateUserLogin(Entity\Users $userEntity)
 {
     $userEntity->setLastseen(Carbon::now());
     $userEntity->setLastip($this->getClientIp());
     $userEntity->setFailedlogins(0);
     $userEntity->setThrottleduntil($this->throttleUntil(0));
     $userEntity = $this->updateUserShadowLogin($userEntity);
     // Don't try to save the password on login
     $userEntity->setPassword(null);
     try {
         $saved = $this->getRepositoryUsers()->save($userEntity);
     } catch (NotNullConstraintViolationException $e) {
         // Database needs updating
         $saved = true;
     }
     if ($saved) {
         $this->flashLogger->success(Trans::__("You've been logged on successfully."));
         return true;
     }
     return false;
 }
Exemplo n.º 3
0
Arquivo: Login.php Projeto: d-m-/bolt
 /**
  * Update the user record with latest login information.
  *
  * @param Entity\Users $userEntity
  *
  * @return boolean
  */
 protected function updateUserLogin(Entity\Users $userEntity)
 {
     $userEntity->setLastseen(Carbon::now());
     $userEntity->setLastip($this->getClientIp());
     $userEntity->setFailedlogins(0);
     $userEntity->setThrottleduntil($this->throttleUntil(0));
     $userEntity = $this->updateUserShadowLogin($userEntity);
     // Don't try to save the password on login
     $userEntity->setPassword(null);
     if ($this->repositoryUsers->save($userEntity)) {
         $this->flashLogger->success(Trans::__("You've been logged on successfully."));
         return true;
     }
     return false;
 }