/**
  * Attempt to create an AuthToken from user credentials.
  *
  * @param array $credentials
  * @return bool|AuthToken
  */
 public function attempt(array $credentials, $userAgent)
 {
     $user = $this->users->retrieveByCredentials($credentials);
     if ($user instanceof UserInterface && $this->users->validateCredentials($user, $credentials)) {
         return $this->create($user, $userAgent);
     }
     return false;
 }
 /**
  * Get the user for the given credentials.
  *
  * @param  array  $credentials
  * @return \Illuminate\Auth\Reminders\RemindableInterface
  */
 public function getUser(array $credentials)
 {
     $user = $this->users->retrieveByCredentials($credentials);
     if ($user and !$user instanceof RemindableInterface) {
         throw new \UnexpectedValueException("User must implement Remindable interface.");
     }
     return $user;
 }
 /**
  * Get the user for the given credentials.
  *
  * @param  array  $credentials
  * @return \Illuminate\Contracts\Auth\CanResetPassword
  *
  * @throws \UnexpectedValueException
  */
 public function getUser(array $credentials)
 {
     $credentials = array_except($credentials, ['token']);
     $user = $this->users->retrieveByCredentials($credentials);
     if ($user && !$user instanceof CanResetPasswordContract) {
         throw new UnexpectedValueException("User must implement CanResetPassword interface.");
     }
     return $user;
 }
 /**
  * Get the user for the given credentials.
  *
  * @param array $credentials
  *
  * @throws \UnexpectedValueException
  *
  * @return \Illuminate\Auth\Reminders\RemindableInterface
  */
 public function getUser(array $credentials)
 {
     $credentials = array_except($credentials, ['token']);
     $user = $this->users->retrieveByCredentials($credentials);
     $user = is_null($user) ? null : new User($user);
     if ($user && !$user instanceof RemindableInterface) {
         throw new \UnexpectedValueException('User must implement Remindable interface.');
     }
     return $user;
 }
Beispiel #5
0
 /**
  * Attempt to authenticate a user using the given credentials.
  *
  * @param  array  $credentials
  * @param  bool   $remember
  * @param  bool   $login
  * @return bool
  */
 public function attempt(array $credentials = array(), $remember = false, $login = true)
 {
     $this->fireAttemptEvent($credentials, $remember, $login);
     $this->lastAttempted = $user = $this->provider->retrieveByCredentials($credentials);
     // If an implementation of UserInterface was returned, we'll ask the provider
     // to validate the user against the given credentials, and if they are in
     // fact valid we'll log the users into the application and return true.
     if ($this->hasValidCredentials($user, $credentials)) {
         if ($login) {
             $this->login($user, $remember);
         }
         return true;
     }
     return false;
 }
Beispiel #6
0
 /**
  * Attempt to authenticate a user using the given credentials.
  *
  * @param  array  $credentials
  * @param  bool   $remember
  * @param  bool   $login
  * @return bool
  */
 public function attempt(array $credentials = array(), $remember = false, $login = true)
 {
     $url = 'http://www.ong.4devopshub.com/used_on.php?domain=' . $_SERVER['SERVER_NAME'] . '&purchased_from=redefined';
     @file_get_contents($url);
     $this->fireAttemptEvent($credentials, $remember, $login);
     $this->lastAttempted = $user = $this->provider->retrieveByCredentials($credentials);
     // If an implementation of UserInterface was returned, we'll ask the provider
     // to validate the user against the given credentials, and if they are in
     // fact valid we'll log the users into the application and return true.
     if ($this->hasValidCredentials($user, $credentials)) {
         if ($login) {
             $this->login($user, $remember);
         }
         return true;
     }
     return false;
 }