From be6765336eb894535d62055fab577dfc951b6b6a Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Thu, 15 Oct 2009 10:44:25 -0700 Subject: Finish integrating the move of the user edit/update functions into the user module. The premise is that the plugable user module will provide the update screens if the user backend supports updates. --- modules/gallery/controllers/albums.php | 1 - modules/gallery/controllers/login.php | 1 - modules/gallery/helpers/gallery_event.php | 4 ++++ modules/gallery/helpers/gallery_theme.php | 1 - modules/gallery/helpers/user.php | 1 - modules/gallery/libraries/Identity.php | 1 - modules/gallery/views/login.html.php | 6 +++++- modules/gallery/views/login_ajax.html.php | 2 +- 8 files changed, 10 insertions(+), 7 deletions(-) (limited to 'modules/gallery') diff --git a/modules/gallery/controllers/albums.php b/modules/gallery/controllers/albums.php index 95d63308..9733d1cd 100644 --- a/modules/gallery/controllers/albums.php +++ b/modules/gallery/controllers/albums.php @@ -29,7 +29,6 @@ class Albums_Controller extends Items_Controller { $view = new Theme_View("page.html", "login"); $view->page_title = t("Log in to Gallery"); $view->content = new View("login_ajax.html"); - $view->content->writable = user::is_writable(); $view->content->form = user::get_login_form("login/auth_html"); print $view; return; diff --git a/modules/gallery/controllers/login.php b/modules/gallery/controllers/login.php index 85f6db5d..2c4bd557 100644 --- a/modules/gallery/controllers/login.php +++ b/modules/gallery/controllers/login.php @@ -21,7 +21,6 @@ class Login_Controller extends Controller { public function ajax() { $view = new View("login_ajax.html"); - $view->writable = user::is_writable(); $view->form = user::get_login_form("login/auth_ajax"); print $view; } diff --git a/modules/gallery/helpers/gallery_event.php b/modules/gallery/helpers/gallery_event.php index e0de2152..4a6b14b6 100644 --- a/modules/gallery/helpers/gallery_event.php +++ b/modules/gallery/helpers/gallery_event.php @@ -23,6 +23,10 @@ class gallery_event_Core { * Initialization. */ static function gallery_ready() { + // Call Identity::instance() now to force the load of the user interface classes. + // user::load_user will attempt to load the active user from the session and needs + // the user definition class, which can't be reached by Kohana's heiracrchical lookup. + Identity::instance(); user::load_user(); locales::set_request_locale(); } diff --git a/modules/gallery/helpers/gallery_theme.php b/modules/gallery/helpers/gallery_theme.php index 54b35fb7..a342b4bd 100644 --- a/modules/gallery/helpers/gallery_theme.php +++ b/modules/gallery/helpers/gallery_theme.php @@ -55,7 +55,6 @@ class gallery_theme_Core { if ($theme->page_type != "login") { $view = new View("login.html"); $view->user = user::active(); - $view->writable = user::is_writable(); return $view->render(); } } diff --git a/modules/gallery/helpers/user.php b/modules/gallery/helpers/user.php index efe08830..c51a4a9c 100644 --- a/modules/gallery/helpers/user.php +++ b/modules/gallery/helpers/user.php @@ -78,7 +78,6 @@ class user_Core { * driver classes. */ static function load_user() { - Identity::instance(); $session = Session::instance(); if (!($user = $session->get("user"))) { $session->set("user", $user = self::guest()); diff --git a/modules/gallery/libraries/Identity.php b/modules/gallery/libraries/Identity.php index 88865913..86b15935 100644 --- a/modules/gallery/libraries/Identity.php +++ b/modules/gallery/libraries/Identity.php @@ -102,7 +102,6 @@ class Identity_Core { return !empty($this->config["allow_updates"]); } - /** * @see Identity_Driver::guest. */ diff --git a/modules/gallery/views/login.html.php b/modules/gallery/views/login.html.php index 5256f1ac..2d8119d0 100644 --- a/modules/gallery/views/login.html.php +++ b/modules/gallery/views/login.html.php @@ -8,11 +8,15 @@
  • + html::mark_clean( 'id}") . - '" title="' . ($writable ? t("Edit Your Profile")->for_html_attr() : t("Display Your Profile")->for_html_attr()) . + '" title="' . t("Edit Your Profile")->for_html_attr() . '" id="g-user-profile-link" class="g-dialog-link">' . html::clean($user->display_name()) . ''))) ?> + + html::clean($user->display_name()))) ?> +
  • " diff --git a/modules/gallery/views/login_ajax.html.php b/modules/gallery/views/login_ajax.html.php index 332a5365..d71ca719 100644 --- a/modules/gallery/views/login_ajax.html.php +++ b/modules/gallery/views/login_ajax.html.php @@ -36,7 +36,7 @@
  • - +
  • -- cgit v1.2.3