/** * Authenticate a user via the id. * * @param mixed $id * * @return bool */ public function byId($id) { if ($user = $this->sentinel->getUserRepository()->findById($id)) { $this->sentinel->setUser($user); return true; } return false; }
/** * Sets the user associated with Sentinel (does not log in). * * @param User $user * * @return void */ public function setUser(User $user) { $this->sentinel->setUser($user); }
/** * Sets the user associated with Sentinel (does not log in). * * @param \Cartalyst\Sentinel\Users\UserInterface $user * @return void * @static */ public static function setUser($user) { \Cartalyst\Sentinel\Sentinel::setUser($user); }