summaryrefslogtreecommitdiff
path: root/modules/gallery
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gallery')
-rw-r--r--modules/gallery/controllers/albums.php1
-rw-r--r--modules/gallery/controllers/login.php1
-rw-r--r--modules/gallery/helpers/gallery_event.php4
-rw-r--r--modules/gallery/helpers/gallery_theme.php1
-rw-r--r--modules/gallery/helpers/user.php1
-rw-r--r--modules/gallery/libraries/Identity.php1
-rw-r--r--modules/gallery/views/login.html.php6
-rw-r--r--modules/gallery/views/login_ajax.html.php2
8 files changed, 10 insertions, 7 deletions
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 @@
</li>
<? else: ?>
<li class="first">
+ <? if (user::is_writable()): ?>
<?= t('Logged in as %name', array('name' => html::mark_clean(
'<a href="' . url::site("form/edit/users/{$user->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()) . '</a>'))) ?>
+ <? else: ?>
+ <?= t('Logged in as %name', array('name' => html::clean($user->display_name()))) ?>
+ <? endif ?>
</li>
<li>
<a href="<?= url::site("logout?csrf=$csrf&amp;continue=" . urlencode(url::current(true))) ?>"
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 @@
<li id="g-login-form">
<?= $form ?>
</li>
- <? if (!empty($writable)): ?>
+ <? if (user::is_writable()): ?>
<li>
<a href="#" id="g-password-reset" class="g-right g-txt-small"><?= t("Forgot Your Password?") ?></a>
</li>