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