summaryrefslogtreecommitdiff
path: root/modules/gallery/controllers/login.php
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-10-15 14:37:57 -0700
committerTim Almdal <tnalmdal@shaw.ca>2009-10-16 08:53:31 -0700
commit00eacd659f27df9c13246c510057c4f42c8866a2 (patch)
tree7f6201c54c0d7c1de2eeb337b3331d1864d30fb0 /modules/gallery/controllers/login.php
parentbe6765336eb894535d62055fab577dfc951b6b6a (diff)
Start simplifying the interface by moving the static methods from user.php and group.php. Tried creating a identity helper, but the helper identity.php was confused with the library Identity.php. So got around this by making the methods on Identity static and calling the instance within the static methods. Also temporarily moved the user.php and group.php back into the user module.
Diffstat (limited to 'modules/gallery/controllers/login.php')
-rw-r--r--modules/gallery/controllers/login.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/modules/gallery/controllers/login.php b/modules/gallery/controllers/login.php
index 2c4bd557..c8b771ca 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 = user::get_login_form("login/auth_ajax");
+ $view->form = Identity::get_login_form("login/auth_ajax");
print $view;
}
@@ -40,7 +40,7 @@ class Login_Controller extends Controller {
}
public function html() {
- print user::get_login_form("login/auth_html");
+ print Identity::get_login_form("login/auth_html");
}
public function auth_html() {
@@ -54,11 +54,11 @@ class Login_Controller extends Controller {
}
}
private function _auth($url) {
- $form = user::get_login_form($url);
+ $form = Identity::get_login_form($url);
$valid = $form->validate();
if ($valid) {
- $user = user::lookup_by_name($form->login->inputs["name"]->value);
- if (empty($user) || !user::is_correct_password($user, $form->login->password->value)) {
+ $user = Identity::lookup_user_by_name($form->login->inputs["name"]->value);
+ if (empty($user) || !Identity::is_correct_password($user, $form->login->password->value)) {
log::warning(
"user",
t("Failed login for %name",
@@ -69,7 +69,7 @@ class Login_Controller extends Controller {
}
if ($valid) {
- user::login($user);
+ Identity::login($user);
log::info("user", t("User %name logged in", array("name" => $user->name)));
}