/** * Set very basic properties and create user. * * @param array $profile * @return UserInterface */ protected function createUser($profile) { $this->user->email = $profile['email']; $this->user->password = $this->makeUserPassword(); $this->user->save(); return $this->user; }
/** * Map ldap user to model * * @param array $ldap * @param UserInterface|\Eloquent $model * * @return mixed */ public function map($ldap, UserInterface $model) { if (!isset($ldap[strtolower($this->mappings['fields'][Loader::username()])])) { return false; } foreach ($this->mappings['fields'] as $field => $mapped) { $mapped = strtolower($mapped); if (!isset($ldap[$mapped])) { continue; } if ($mapped == 'useraccountcontrol') { if (!in_array($ldap[$mapped][0], $this->locked)) { $ldap[$mapped][0] = true; } else { $ldap[$mapped][0] = false; } } $model->{$field} = $ldap[$mapped][0]; } $model->save(); return $model; }
/** * Update the "remember me" token for the given user in storage. * * @param \Illuminate\Auth\UserInterface $user * @param string $token * @return void */ public function updateRememberToken(UserInterface $user, $token) { $user->setAttribute($user->getRememberTokenName(), $token); $user->save(); }
/** * Update the "remember me" token for the given user in storage. * * @param \Illuminate\Auth\UserInterface $user * @param string $token * @return void */ public function updateRememberToken(UserInterface $user, $token) { $user->setRememberToken($token); $user->save(); }
/** * Update the "remember me" token for the given user in storage. * * @param UserInterface $user * @param string $token * @return void */ public function updateRememberToken(UserInterface $user, $token) { // If Eloquent User if (!$user instanceof GenericUser) { // Update Remember Me Token $user->setAttribute($user->getRememberTokenName(), $token); $user->save(); } }
/** * Update the "remember me" token for the given user in storage. * * @param \Illuminate\Auth\UserInterface $user * @param string $token * @return void */ public function updateRememberToken(UserInterface $user, $token) { $user->remember_token = $token; $user->save(); }
/** * Attempt to save updates to the User * * @return boolean */ public function save(UserInterface $user) { $user->save(); }
/** * Validate a user against the given credentials. * * @param Illuminate\Auth\UserInterface $user * @param array $credentials * @return bool */ public function validateCredentials(UserInterface $user, array $credentials) { $plain = $credentials['password']; // Is user password is valid? if (!$this->hasher->check($user->salt . $plain, $user->getAuthPassword())) { throw new UserPasswordIncorrectException($this->getName() . ' password is incorrect'); } // Valid user, but are they verified? if (!$user->verified) { throw new UserUnverifiedException($this->getName() . ' is unverified'); } // Is the user disabled? if ($user->disabled) { throw new UserDisabledException($this->getName() . ' is disabled'); } // Is the user deleted? if ($user->deleted_at !== NULL) { throw new UserDeletedException($this->getName() . ' is deleted'); } $user->last_ip = \Sanitize::clean(\Request::getClientIp()); $user->last_login = date(SQL_DATETIME); $user->save(); return true; }
/** * Update the "remember me" token for the given user in storage. * * @param UserInterface $user * @param string $token * * @return void */ public function updateRememberToken(UserInterface $user, $token) { $user->{$user->getRememberTokenName()} = $token; $user->save(); }