public function force_login($user, $mark_session_as_forced = false) { if (!is_object($user)) { $username = $user; $user = ORM::factory('user'); $user->where($user->unique_key($username), '=', $username)->find(); } if ($mark_session_as_forced === true) { Session::instance()->set('auth_forced', $user->username); } return parent::complete_login($user); }
/** * Переопределение метода для подгрузки списка ролей пользователя. */ public function complete_login() { if ($this->_loaded) { $this->roles(); } parent::complete_login(); }