diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2009-03-11 13:58:38 +0000 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2009-03-11 13:58:38 +0000 |
commit | a521d9177f5e299d2ff25cc288e59e4bf1398a1b (patch) | |
tree | 1a0664cb4aa01d698d1dcd1b6fba9cfd3ee1e9b8 /modules | |
parent | 30239ed302c571efb0cd9c86625be30fce5b4bd9 (diff) |
Force a login if everybody does not have access to the root
item. ticket #118.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/user/controllers/login.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/modules/user/controllers/login.php b/modules/user/controllers/login.php index bf45746d..ab2dd379 100644 --- a/modules/user/controllers/login.php +++ b/modules/user/controllers/login.php @@ -26,6 +26,13 @@ class Login_Controller extends Controller { } } + public function page() { + $view = new Theme_View("page.html"); + $view->page_type = "login"; + $view->content = "<script>\$(\"#gLoginLink\").ready(function() {\$(\"#gLoginLink\").click();});</script>"; + print $view; + } + private function _try_login() { $form = $this->_login_form()->form; @@ -44,7 +51,8 @@ class Login_Controller extends Controller { user::login($user); log::info("user", t("User %name logged in", array("name" => $user->name))); print json_encode( - array("result" => "success")); + array("result" => "success", + "location" => url::site(""))); } else { print json_encode( array("result" => "error", |