示例#1
0
 /**
  * {@inheritDoc}
  */
 public function register(array $credentials, $activate = false)
 {
     if ($guest = $this->findGuestUserByCredentials($credentials)) {
         return $this->convertGuestToUser($guest, $credentials, $activate);
     }
     return parent::register($credentials, $activate);
 }
示例#2
0
 /**
  * Checks for a supplied user or uses the default logged in. You should override this method.
  * @param mixed $user An optional back-end user object.
  * @return User object
  */
 public function resolveUser($user)
 {
     $user = Manager::instance()->getUser();
     if (!$user) {
         throw new AuthException('User is not logged in');
     }
     return $user;
 }
示例#3
0
 public function init()
 {
     $this->useThrottle = UserSettings::get('use_throttle', $this->useThrottle);
     $this->requireActivation = UserSettings::get('require_activation', $this->requireActivation);
     parent::init();
 }
示例#4
0
 /**
  * Get the currently authenticated user.
  *
  * @return \October\Rain\Auth\Models\User
  */
 public function user()
 {
     return $this->october->getUser();
 }