/**
  * Find a given user by the login attribute
  *
  * @author ZZK
  * @link   http://verecom.com
  *
  * @param $login
  *
  * @throws UserNotFoundException
  * @return \Cartalyst\Sentry\Users\UserInterface
  */
 public function findByLogin($login)
 {
     try {
         return $this->sentry->findUserByLogin($login);
     } catch (SentryUserNotFoundException $e) {
         throw new UserNotFoundException($e->getMessage());
     }
 }
示例#2
0
 /**
  * Request an account reset
  *
  * This will generate a reset password code for the given user and send it via email to him.
  *
  * @param Input|null $input Passing Input::all() can be omitted
  * @throws UserNotFoundException Throws a UserNotFoundException if Sentry cannot find the given user.
  * @throws MailException Throws an exception containing further information as message
  * @return void
  */
 public function resetPassword($input = null)
 {
     $input = $input ?: $this->input->all();
     $user = $this->sentry->findUserByLogin($input['email']);
     $reset_code = $user->getResetPasswordCode();
     $this->prepareResetRequestMailData($user, $reset_code);
     $this->setMailErrorMessage('Sending the email containing the reset key failed. ' . 'Please try again later or contact the administrator.');
     $this->sendMail();
 }
 /**
  * Finds a user by the login value.
  *
  * @param string $login
  * @return \Cartalyst\Sentry\Users\UserInterface 
  * @throws \Cartalyst\Sentry\Users\UserNotFoundException
  * @static 
  */
 public static function findUserByLogin($login)
 {
     return \Cartalyst\Sentry\Sentry::findUserByLogin($login);
 }