summaryrefslogtreecommitdiff
path: root/modules/gallery/helpers
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2010-06-12 13:35:12 -0700
committerBharat Mediratta <bharat@menalto.com>2010-06-12 13:35:12 -0700
commit63d95087bf0f24d4e880843cd2841906c6f91b38 (patch)
tree82514c009768285d65f5533f57411c14b39880ba /modules/gallery/helpers
parenta4586bc0c01fac6e86163fd119aaa64d95fb5e8e (diff)
Stop trying to parse the continue url in the logout controller because
it requires us to reproduce a bunch of complex routing logic. Instead, just have the logout link generating code generate a link that's visible to guests.
Diffstat (limited to 'modules/gallery/helpers')
-rw-r--r--modules/gallery/helpers/gallery_event.php13
1 files changed, 12 insertions, 1 deletions
diff --git a/modules/gallery/helpers/gallery_event.php b/modules/gallery/helpers/gallery_event.php
index ae7131ae..1b688843 100644
--- a/modules/gallery/helpers/gallery_event.php
+++ b/modules/gallery/helpers/gallery_event.php
@@ -157,11 +157,22 @@ class gallery_event_Core {
->view("login_current_user.html")
->url(user_profile::url($user->id))
->label($user->display_name()));
+
+ if (isset($theme->item)) {
+ if (access::user_can(identity::guest(), "view", $theme->item)) {
+ $continue_url = $theme->item->abs_url();
+ } else {
+ $continue_url = item::root()->abs_url();
+ }
+ } else {
+ $continue_url = url::abs_current();
+ }
+
$menu->append(Menu::factory("link")
->id("user_menu_logout")
->css_id("g-logout-link")
->url(url::site("logout?csrf=$csrf&amp;continue=" .
- urlencode(url::abs_current())))
+ urlencode($continue_url)))
->label(t("Logout")));
}
}