summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/gallery/helpers/MY_url.php21
-rw-r--r--modules/gallery/views/simple_uploader.html.php2
-rw-r--r--modules/user/controllers/logout.php7
3 files changed, 21 insertions, 9 deletions
diff --git a/modules/gallery/helpers/MY_url.php b/modules/gallery/helpers/MY_url.php
index c8645c4d..e9a5f860 100644
--- a/modules/gallery/helpers/MY_url.php
+++ b/modules/gallery/helpers/MY_url.php
@@ -46,7 +46,19 @@ class url extends url_Core {
return;
}
- $current_uri = html_entity_decode(Router::$current_uri, ENT_QUOTES);
+ $item = self:: get_item_from_uri(Router::$current_uri);
+ if ($item && $item->loaded) {
+ Router::$controller = "{$item->type}s";
+ Router::$controller_path = MODPATH . "gallery/controllers/{$item->type}s.php";
+ Router::$method = $item->id;
+ }
+ }
+
+ /**
+ * Return the item that the uri is referencing
+ */
+ static function get_item_from_uri($uri) {
+ $current_uri = html_entity_decode($uri);
$item = ORM::factory("item")->where("relative_path_cache", $current_uri)->find();
if (!$item->loaded) {
// It's possible that the relative path cache for the item we're looking for is out of date,
@@ -61,12 +73,7 @@ class url extends url_Core {
}
}
}
-
- if ($item && $item->loaded) {
- Router::$controller = "{$item->type}s";
- Router::$controller_path = MODPATH . "gallery/controllers/{$item->type}s.php";
- Router::$method = $item->id;
- }
+ return $item;
}
/**
diff --git a/modules/gallery/views/simple_uploader.html.php b/modules/gallery/views/simple_uploader.html.php
index 79919d50..f10d764c 100644
--- a/modules/gallery/views/simple_uploader.html.php
+++ b/modules/gallery/views/simple_uploader.html.php
@@ -93,7 +93,7 @@
button_width: "202",
button_height: "45",
button_placeholder_id: "gChooseFilesButtonPlaceholder",
- button_text: '<span class="swfUploadFont">Select photos...</span>',
+ button_text: '<span class="swfUploadFont"><?= t("Select photos...") ?></span>',
button_text_style: ".swfUploadFont { color: #2E6E9E; font-size: 16px; font-family: Lucida Grande,Lucida Sans,Arial,sans-serif; font-weight: bold; }",
button_text_left_padding: 30,
button_text_top_padding: 10,
diff --git a/modules/user/controllers/logout.php b/modules/user/controllers/logout.php
index 6ceb7192..a541ed9b 100644
--- a/modules/user/controllers/logout.php
+++ b/modules/user/controllers/logout.php
@@ -26,7 +26,12 @@ class Logout_Controller extends Controller {
log::info("user", t("User %name logged out", array("name" => $user->name)),
html::anchor("user/$user->id", $user->name));
if ($this->input->get("continue")) {
- url::redirect($this->input->get("continue"));
+ $item = url::get_item_from_uri($this->input->get("continue"));
+ if (access::can("view", $item)) {
+ url::redirect($this->input->get("continue"));
+ } else {
+ url::redirect("");
+ }
}
}
} \ No newline at end of file