first(); if (!$user || !Hash::check($password, $user->password)) { return false; } return self::login($user); } /** * Log in a user and create session * * @param User_Model $user * @return bool */ public static function login(User_Model $user) { // Use Session to set the user (will create session if needed) Session::set_user($user); return true; } /** * Log out the current user * * @return void */ public static function logout() { // Use Session to logout Session::logout(); } }