diff options
| author | Tim Almdal <tnalmdal@shaw.ca> | 2009-10-30 09:32:18 -0700 |
|---|---|---|
| committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-10-30 09:32:18 -0700 |
| commit | 59b5a0549635aa5c8320707cec75612746debdd0 (patch) | |
| tree | d1a6294420d028fe327a82b2213cbd744ce6fab4 /modules/gallery/controllers/login.php | |
| parent | ddf8734a414e4d426232e6dec9137eac8dcf0bb7 (diff) | |
Rename the login helper to auth. Create a login and logout helper function to allow for programmically login in and out.
Diffstat (limited to 'modules/gallery/controllers/login.php')
| -rw-r--r-- | modules/gallery/controllers/login.php | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/modules/gallery/controllers/login.php b/modules/gallery/controllers/login.php index 3978b64f..75ee6b9c 100644 --- a/modules/gallery/controllers/login.php +++ b/modules/gallery/controllers/login.php @@ -21,7 +21,7 @@ class Login_Controller extends Controller { public function ajax() { $view = new View("login_ajax.html"); - $view->form = login::get_form("login/auth_ajax"); + $view->form = auth::get_login_form("login/auth_ajax"); print $view; } @@ -40,7 +40,7 @@ class Login_Controller extends Controller { } public function html() { - print login::get_form("login/auth_html"); + print auth::get_login_form("login/auth_html"); } public function auth_html() { @@ -55,7 +55,7 @@ class Login_Controller extends Controller { } private function _auth($url) { - $form = login::get_form($url); + $form = auth::get_login_form($url); $valid = $form->validate(); if ($valid) { $user = identity::lookup_user_by_name($form->login->inputs["name"]->value); @@ -70,14 +70,7 @@ class Login_Controller extends Controller { } if ($valid) { - if (identity::is_writable()) { - $user->login_count += 1; - $user->last_login = time(); - $user->save(); - } - identity::set_active_user($user); - log::info("user", t("User %name logged in", array("name" => $user->name))); - module::event("user_login", $user); + auth::login($user); } // Either way, regenerate the session id to avoid session trapping |
