From 32d18920680ee63dc75c3a2b710ef805b31c127c Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Thu, 2 Sep 2010 22:53:06 -0700 Subject: Follow on to 2a86446249c4782287e1e6e472f422b851c2fb47; fix a bug where guest access to admin pages fails because we try to go to the login page but you can't do that from the admin theme. Thanks to mamouneyya for catching this. http://github.com/gallery/gallery3/commit/2a86446249c4782287e1e6e472f422b851c2fb47 --- modules/gallery/helpers/gallery.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'modules') diff --git a/modules/gallery/helpers/gallery.php b/modules/gallery/helpers/gallery.php index 924ee76a..9430231c 100644 --- a/modules/gallery/helpers/gallery.php +++ b/modules/gallery/helpers/gallery.php @@ -45,10 +45,17 @@ class gallery_Core { Router::$controller != "combined" && identity::active_user()->guest && !access::user_can(identity::guest(), "view", item::root())) { - Session::instance()->set("continue_url", url::abs_current()); - Router::$controller = "login"; - Router::$controller_path = MODPATH . "gallery/controllers/login.php"; - Router::$method = "html"; + if (Router::$controller == "admin") { + // At this point we're in the admin theme and it doesn't have a themed login page, so + // we can't just swap in the login controller and have it work. So redirect back to the + // root item where we'll run this code again with the site theme. + url::redirect(item::root()->abs_url()); + } else { + Session::instance()->set("continue_url", url::abs_current()); + Router::$controller = "login"; + Router::$controller_path = MODPATH . "gallery/controllers/login.php"; + Router::$method = "html"; + } } } -- cgit v1.2.3 From db75ac642a6ff62e814929af99e7c9af4d492706 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 4 Sep 2010 13:40:39 -0700 Subject: Use the title of the root album as the site title for all RSS feeds. Fixes ticket #1307. --- modules/comment/helpers/comment_rss.php | 10 ++++++++-- modules/gallery/helpers/gallery_rss.php | 10 ++++++++-- modules/tag/helpers/tag_rss.php | 3 ++- 3 files changed, 18 insertions(+), 5 deletions(-) (limited to 'modules') diff --git a/modules/comment/helpers/comment_rss.php b/modules/comment/helpers/comment_rss.php index 26d98d21..cc4180bf 100644 --- a/modules/comment/helpers/comment_rss.php +++ b/modules/comment/helpers/comment_rss.php @@ -57,13 +57,19 @@ class comment_rss_Core { "thumb_height" => $item->thumb_height, "thumb_width" => $item->thumb_width, "item_uri" => url::abs_site("{$item->type}s/$item->id"), - "title" => html::purify($item->title), + "title" => ( + ($item->id == item::root()->id) ? + html::purify($item->title) : + t("%site_title - %item_title", + array("site_title" => item::root()->title, + "item_title" => $item->title))), "author" => html::clean($comment->author_name())), ArrayObject::ARRAY_AS_PROPS); } $feed->max_pages = ceil($comments->count_all() / $limit); - $feed->title = htmlspecialchars(t("Recent Comments")); + $feed->title = html::purify(t("%site_title - Recent Comments", + array("site_title" => item::root()->title))); $feed->uri = url::abs_site("albums/" . (empty($id) ? "1" : $id)); $feed->description = t("Recent comments"); diff --git a/modules/gallery/helpers/gallery_rss.php b/modules/gallery/helpers/gallery_rss.php index bec34912..fb617934 100644 --- a/modules/gallery/helpers/gallery_rss.php +++ b/modules/gallery/helpers/gallery_rss.php @@ -40,7 +40,7 @@ class gallery_rss_Core { ->order_by("created", "DESC"); $feed->max_pages = ceil($all_items->find_all()->count() / $limit); - $feed->title = t("Recent updates"); + $feed->title = t("%site_title - Recent updates", array("site_title" => item::root()->title)); $feed->description = t("Recent updates"); return $feed; @@ -53,7 +53,13 @@ class gallery_rss_Core { ->descendants($limit, $offset, array(array("type", "=", "photo"))); $feed->max_pages = ceil( $item->viewable()->descendants_count(array(array("type", "=", "photo"))) / $limit); - $feed->title = html::purify($item->title); + if ($item->id == item::root()->id) { + $feed->title = html::purify($item->title); + } else { + $feed->title = t("%site_title - %item_title", + array("site_title" => item::root()->title, + "item_title" => $item->title)); + } $feed->description = nl2br(html::purify($item->description)); return $feed; diff --git a/modules/tag/helpers/tag_rss.php b/modules/tag/helpers/tag_rss.php index ea3865be..f60bd908 100644 --- a/modules/tag/helpers/tag_rss.php +++ b/modules/tag/helpers/tag_rss.php @@ -38,7 +38,8 @@ class tag_rss_Core { $feed = new stdClass(); $feed->items = $tag->items($limit, $offset, "photo"); $feed->max_pages = ceil($tag->count / $limit); - $feed->title = $tag->name; + $feed->title = t("%site_title - %tag_name", + array("site_title" => item::root()->title, "tag_name" => $tag->name)); $feed->description = t("Photos related to %tag_name", array("tag_name" => $tag->name)); return $feed; -- cgit v1.2.3 From c51b6ab38d7f16d64127fd3a73df38166a698f0f Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 4 Sep 2010 15:54:07 -0700 Subject: Fix full size dimensions after rotating an image on the photo view page. The photo view page caches the dimensions of the full size and then renders it in Javascript. But after rotation, those dimensions are no longer valid. Create a new function on the items controller that returns the appropriate dimensions, then add a hook on $.gallery_replace_image and implement the hook on the photo view page to have it make an async call to get the new dimensions. Fixes ticket #1317 --- lib/gallery.common.js | 3 +++ modules/gallery/controllers/items.php | 9 +++++++++ themes/wind/views/photo.html.php | 15 ++++++++++++++- 3 files changed, 26 insertions(+), 1 deletion(-) (limited to 'modules') diff --git a/lib/gallery.common.js b/lib/gallery.common.js index a8b237bf..69452f39 100644 --- a/lib/gallery.common.js +++ b/lib/gallery.common.js @@ -121,6 +121,9 @@ // Ajax handler for replacing an image, used in Ajax thumbnail rotation $.gallery_replace_image = function(data, thumb) { $(thumb).attr({src: data.src, width: data.width, height: data.height}); + if (typeof gallery_image_replaced_hook == 'function') { + gallery_image_replaced_hook(data, thumb); + } }; // Initialize context menus diff --git a/modules/gallery/controllers/items.php b/modules/gallery/controllers/items.php index f205bf86..39b0f638 100644 --- a/modules/gallery/controllers/items.php +++ b/modules/gallery/controllers/items.php @@ -31,4 +31,13 @@ class Items_Controller extends Controller { access::required("view", $item); url::redirect($item->abs_url()); } + + // Return the width/height dimensinons for the given item + public function dimensions($id) { + $item = ORM::factory("item", $id); + access::required("view", $item); + json::reply(array("thumb" => array((int)$item->thumb_width, (int)$item->thumb_height), + "resize" => array((int)$item->resize_width, (int)$item->resize_height), + "full" => array((int)$item->width, (int)$item->height))); + } } diff --git a/themes/wind/views/photo.html.php b/themes/wind/views/photo.html.php index f8b5511c..cb830e23 100644 --- a/themes/wind/views/photo.html.php +++ b/themes/wind/views/photo.html.php @@ -4,10 +4,23 @@ -- cgit v1.2.3 From ca0c3b3e7f154ffceee944049247e15cf0190e48 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 5 Sep 2010 21:25:46 -0700 Subject: Force "Options +FollowSymLinks" since that's a requirement for mod_rewrite to work. This is surprisingly obscure in the docs. Thanks to bromide for turning this up in http://gallery.menalto.com/node/97791! --- .htaccess | 1 + modules/gallery/helpers/access.php | 1 + 2 files changed, 2 insertions(+) (limited to 'modules') diff --git a/.htaccess b/.htaccess index 5e9b96d6..bea9a10a 100644 --- a/.htaccess +++ b/.htaccess @@ -60,6 +60,7 @@ # putting this block into your Apache config files. # # +# Options +FollowSymLinks # RewriteEngine On # RewriteBase / # RewriteCond %{REQUEST_FILENAME} !-f diff --git a/modules/gallery/helpers/access.php b/modules/gallery/helpers/access.php index f1ea00c0..86ea9572 100644 --- a/modules/gallery/helpers/access.php +++ b/modules/gallery/helpers/access.php @@ -694,6 +694,7 @@ class access_Core { @mkdir(VARPATH . "security_test"); try { if ($fp = @fopen(VARPATH . "security_test/.htaccess", "w+")) { + fwrite($fp, "Options +FollowSymLinks\n"); fwrite($fp, "RewriteEngine On\n"); fwrite($fp, "RewriteRule verify $success_url [L]\n"); fclose($fp); -- cgit v1.2.3 From 46b30ce949d6371bc3d2bcfe42221c599c7a85e3 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 5 Sep 2010 22:00:28 -0700 Subject: Add Setswana (tn_ZA). Fixes ticket #1336. --- modules/gallery/helpers/locales.php | 1 + 1 file changed, 1 insertion(+) (limited to 'modules') diff --git a/modules/gallery/helpers/locales.php b/modules/gallery/helpers/locales.php index aacb37ca..1f5473ff 100644 --- a/modules/gallery/helpers/locales.php +++ b/modules/gallery/helpers/locales.php @@ -103,6 +103,7 @@ class locales_Core { $l["sl_SI"] = "Slovenščina"; // Slovenian $l["sr_CS"] = "Srpski"; // Serbian $l["sv_SE"] = "Svenska"; // Swedish + $l["tn_ZA"] = "Setswana"; // Setswana $l["tr_TR"] = "Türkçe"; // Turkish $l["uk_UA"] = "українська"; // Ukrainian $l["vi_VN"] = "Tiếng Việt"; // Vietnamese -- cgit v1.2.3 From b3b6021b0a70979a1084111ae43c1170a7592b37 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 6 Sep 2010 12:41:27 -0700 Subject: Don't bomb on the race condition when we're trying to create the gallery/_cache row and it already exists. Fixes ticket #1338. --- modules/gallery/helpers/module.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/gallery/helpers/module.php b/modules/gallery/helpers/module.php index ca6651f1..736b6854 100644 --- a/modules/gallery/helpers/module.php +++ b/modules/gallery/helpers/module.php @@ -448,7 +448,17 @@ class module_Core { $cache->module_name = "gallery"; $cache->name = "_cache"; $cache->value = serialize(self::$var_cache); - $cache->save(); + try { + $cache->save(); + } catch (Database_Exception $e) { + // There's a potential race condition here. Don't fail if that happens because it's + // bound to be transient and not a huge deal, but at least put something in the logs. + if (stristr($e->getMessage(), "duplicate entry")) { + Kohana_Log::add("error", "Failed to cache vars"); + } else { + throw $e; + } + } } } -- cgit v1.2.3 From 2d948cb39fd2da6a5f966a10cbeb4f5d5caec5a3 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 6 Sep 2010 14:05:48 -0700 Subject: change the Setswana locale from tn_ZA to tn_BW since it's mostly Botswana anyway according to @sagemaniac in http://gallery.menalto.com/node/97840 --- modules/gallery/helpers/locales.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/gallery/helpers/locales.php b/modules/gallery/helpers/locales.php index 1f5473ff..624ff9cb 100644 --- a/modules/gallery/helpers/locales.php +++ b/modules/gallery/helpers/locales.php @@ -103,7 +103,7 @@ class locales_Core { $l["sl_SI"] = "Slovenščina"; // Slovenian $l["sr_CS"] = "Srpski"; // Serbian $l["sv_SE"] = "Svenska"; // Swedish - $l["tn_ZA"] = "Setswana"; // Setswana + $l["tn_BW"] = "Setswana"; // Setswana $l["tr_TR"] = "Türkçe"; // Turkish $l["uk_UA"] = "українська"; // Ukrainian $l["vi_VN"] = "Tiếng Việt"; // Vietnamese -- cgit v1.2.3 From fc856b6abaa24d27cba5273147da11fc2446c1ba Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 6 Sep 2010 14:08:05 -0700 Subject: Add retry logic to the task framework. We retry 4 times with increasing backoff and if that fails, we put up a manual "retry" link. Fixes ticket #1270. --- .../gallery/views/admin_maintenance_task.html.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'modules') diff --git a/modules/gallery/views/admin_maintenance_task.html.php b/modules/gallery/views/admin_maintenance_task.html.php index 76756b66..013ac01f 100644 --- a/modules/gallery/views/admin_maintenance_task.html.php +++ b/modules/gallery/views/admin_maintenance_task.html.php @@ -3,6 +3,7 @@ var target_value; var animation = null; var delta = 1; + var consecutive_error_count = 0; animate_progress_bar = function() { var current_value = parseInt($(".g-progress-bar div").css("width").replace("%", "")); if (target_value > current_value) { @@ -26,12 +27,15 @@ $.fn.gallery_hover_init(); } + var FAILED_MSG = Retry or check the task log for details")->for_js() ?>; + var ERROR_MSG = for_js() ?>; update = function() { $.ajax({ url: id?csrf=$csrf")) ?>, dataType: "json", success: function(data) { target_value = data.task.percent_complete; + consecutive_error_count = 0; if (!animation) { animate_progress_bar(); } @@ -42,6 +46,22 @@ } else { setTimeout(update, 100); } + }, + error: function(req, textStatus, errorThrown) { + if (textStatus == "timeout" || textStatus == "parsererror") { + consecutive_error_count++; + if (consecutive_error_count == 5) { + $("#g-status").html(FAILED_MSG); + $("#g-pause-button").hide(); + $("#g-done-button").show(); + consecutive_error_count = 0; // in case of a manual retry + $("#g-status a").attr("href", "javascript:update()"); + } else { + $("#g-status").html(ERROR_MSG.replace("__COUNT__", consecutive_error_count)); + // Give a little time to back off before retrying + setTimeout(update, 1500 * consecutive_error_count); + } + } } }); } -- cgit v1.2.3 From cb22f23be64096234197cdb1c97d7a42ba504aa4 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 6 Sep 2010 14:16:26 -0700 Subject: Show the "view log" button for tasks that are running, in case they're paused/abandoned for some reason and we want to know more details. --- modules/gallery/views/admin_maintenance.html.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'modules') diff --git a/modules/gallery/views/admin_maintenance.html.php b/modules/gallery/views/admin_maintenance.html.php index 4bfc57f0..c28def1d 100644 --- a/modules/gallery/views/admin_maintenance.html.php +++ b/modules/gallery/views/admin_maintenance.html.php @@ -109,16 +109,21 @@ owner()->name) ?> - id?csrf=$csrf") ?>" - class="g-button g-right ui-icon-left ui-state-default ui-corner-all"> - - state == "stalled"): ?> id?csrf=$csrf") ?>"> + get_log()): ?> + id?csrf=$csrf") ?>" class="g-dialog-link g-button ui-state-default ui-corner-all"> + + + + id?csrf=$csrf") ?>" + class="g-button ui-icon-left ui-state-default ui-corner-all"> + + @@ -183,7 +188,7 @@ get_log()): ?> id?csrf=$csrf") ?>" class="g-dialog-link g-button ui-state-default ui-corner-all"> - + -- cgit v1.2.3 From 883d8f1e23ba000320daf535d97a2e388cc42cd1 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 6 Sep 2010 15:06:37 -0700 Subject: Whitespace. --- modules/gallery/libraries/Gallery_I18n.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'modules') diff --git a/modules/gallery/libraries/Gallery_I18n.php b/modules/gallery/libraries/Gallery_I18n.php index f8068eec..6cb36f07 100644 --- a/modules/gallery/libraries/Gallery_I18n.php +++ b/modules/gallery/libraries/Gallery_I18n.php @@ -44,7 +44,7 @@ function t($message, $options=array()) { */ function t2($singular, $plural, $count, $options=array()) { return Gallery_I18n::instance()->translate(array("one" => $singular, "other" => $plural), - array_merge($options, array("count" => $count))); + array_merge($options, array("count" => $count))); } class Gallery_I18n_Core { @@ -175,7 +175,7 @@ class Gallery_I18n_Core { ->execute() as $row) { $translations[$row->key] = unserialize($row->translation); } - + // Override incoming with outgoing... foreach (db::build() ->select("key", "translation") @@ -184,7 +184,7 @@ class Gallery_I18n_Core { ->execute() as $row) { $translations[$row->key] = unserialize($row->translation); } - + $cache->set($cache_key, $translations, array("translation"), 0); } return $translations; -- cgit v1.2.3 From ec2c9dad64ecb8aca6ab71461e76715f39071c9f Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 6 Sep 2010 15:20:04 -0700 Subject: Verified checkpoint. --- modules/gallery/tests/controller_auth_data.txt | 1 + modules/gallery/tests/xss_data.txt | 90 ++++++++++++-------------- 2 files changed, 43 insertions(+), 48 deletions(-) (limited to 'modules') diff --git a/modules/gallery/tests/controller_auth_data.txt b/modules/gallery/tests/controller_auth_data.txt index 8b776fb9..212577c7 100644 --- a/modules/gallery/tests/controller_auth_data.txt +++ b/modules/gallery/tests/controller_auth_data.txt @@ -17,6 +17,7 @@ modules/gallery/controllers/logout.php index modules/gallery/controllers/quick.php form_edit DIRTY_CSRF modules/gallery/controllers/upgrader.php index DIRTY_AUTH modules/gallery/controllers/uploader.php start DIRTY_AUTH +modules/gallery/controllers/uploader.php status DIRTY_AUTH modules/gallery/controllers/uploader.php finish DIRTY_AUTH modules/gallery/controllers/user_profile.php show DIRTY_AUTH modules/gallery/controllers/user_profile.php contact DIRTY_AUTH diff --git a/modules/gallery/tests/xss_data.txt b/modules/gallery/tests/xss_data.txt index 3eae3d07..4405dad3 100644 --- a/modules/gallery/tests/xss_data.txt +++ b/modules/gallery/tests/xss_data.txt @@ -88,15 +88,15 @@ modules/gallery/views/admin_maintenance.html.php 87 DIRTY_ATTR $tas modules/gallery/views/admin_maintenance.html.php 88 DIRTY gallery::date_time($task->updated) modules/gallery/views/admin_maintenance.html.php 91 DIRTY $task->name modules/gallery/views/admin_maintenance.html.php 106 DIRTY $task->status -modules/gallery/views/admin_maintenance.html.php 157 DIRTY_ATTR text::alternate("g-odd","g-even") -modules/gallery/views/admin_maintenance.html.php 157 DIRTY_ATTR $task->state=="success"?"g-success":"g-error" -modules/gallery/views/admin_maintenance.html.php 158 DIRTY_ATTR $task->state=="success"?"g-success":"g-error" -modules/gallery/views/admin_maintenance.html.php 159 DIRTY gallery::date_time($task->updated) -modules/gallery/views/admin_maintenance.html.php 162 DIRTY $task->name -modules/gallery/views/admin_maintenance.html.php 174 DIRTY $task->status +modules/gallery/views/admin_maintenance.html.php 162 DIRTY_ATTR text::alternate("g-odd","g-even") +modules/gallery/views/admin_maintenance.html.php 162 DIRTY_ATTR $task->state=="success"?"g-success":"g-error" +modules/gallery/views/admin_maintenance.html.php 163 DIRTY_ATTR $task->state=="success"?"g-success":"g-error" +modules/gallery/views/admin_maintenance.html.php 164 DIRTY gallery::date_time($task->updated) +modules/gallery/views/admin_maintenance.html.php 167 DIRTY $task->name +modules/gallery/views/admin_maintenance.html.php 179 DIRTY $task->status modules/gallery/views/admin_maintenance_show_log.html.php 8 DIRTY_JS url::site("admin/maintenance/save_log/$task->id?csrf=$csrf") modules/gallery/views/admin_maintenance_show_log.html.php 13 DIRTY $task->name -modules/gallery/views/admin_maintenance_task.html.php 55 DIRTY $task->name +modules/gallery/views/admin_maintenance_task.html.php 75 DIRTY $task->name modules/gallery/views/admin_modules.html.php 51 DIRTY access::csrf_form_field() modules/gallery/views/admin_modules.html.php 60 DIRTY_ATTR text::alternate("g-odd","g-even") modules/gallery/views/admin_modules.html.php 63 DIRTY form::checkbox($data,'1',module::is_active($module_name)) @@ -109,7 +109,7 @@ modules/gallery/views/admin_sidebar.html.php 50 DIRTY $avail modules/gallery/views/admin_sidebar.html.php 58 DIRTY $active modules/gallery/views/admin_sidebar_blocks.html.php 4 DIRTY_ATTR $ref modules/gallery/views/admin_sidebar_blocks.html.php 4 DIRTY $text -modules/gallery/views/admin_theme_options.html.php 36 DIRTY $form +modules/gallery/views/admin_theme_options.html.php 5 DIRTY $form modules/gallery/views/admin_themes.html.php 3 DIRTY_JS url::site("admin/themes/choose") modules/gallery/views/admin_themes.html.php 5 DIRTY_JS $csrf modules/gallery/views/admin_themes.html.php 22 DIRTY $themes[$site]->name @@ -168,10 +168,13 @@ modules/gallery/views/error_admin.html.php 284 DIRTY $var modules/gallery/views/error_admin.html.php 285 DIRTY_ATTR $env_id modules/gallery/views/error_admin.html.php 291 DIRTY $key modules/gallery/views/error_admin.html.php 295 DIRTY Kohana_Exception::safe_dump($value,$key) -modules/gallery/views/form_uploadify.html.php 9 DIRTY_JS url::file("lib/uploadify/uploadify.swf") -modules/gallery/views/form_uploadify.html.php 10 DIRTY_JS url::site("uploader/add_photo/{$album->id}") -modules/gallery/views/form_uploadify.html.php 14 DIRTY_JS url::file("lib/uploadify/cancel.png") -modules/gallery/views/form_uploadify.html.php 15 DIRTY_JS $simultaneous_upload_limit +modules/gallery/views/form_uploadify.html.php 16 DIRTY_JS url::site("uploader/status/_S/_E") +modules/gallery/views/form_uploadify.html.php 24 DIRTY_JS $flash_minimum_version +modules/gallery/views/form_uploadify.html.php 28 DIRTY_JS url::file("lib/uploadify/uploadify.swf") +modules/gallery/views/form_uploadify.html.php 29 DIRTY_JS url::site("uploader/add_photo/{$album->id}") +modules/gallery/views/form_uploadify.html.php 33 DIRTY_JS url::file("lib/uploadify/cancel.png") +modules/gallery/views/form_uploadify.html.php 34 DIRTY_JS $simultaneous_upload_limit +modules/gallery/views/form_uploadify.html.php 160 DIRTY_ATTR request::protocol() modules/gallery/views/in_place_edit.html.php 2 DIRTY form::open($action,array("method"=>"post","id"=>"g-in-place-edit-form","class"=>"g-short-form")) modules/gallery/views/in_place_edit.html.php 3 DIRTY access::csrf_form_field() modules/gallery/views/in_place_edit.html.php 6 DIRTY form::input("input",$form["input"]," class=\"textbox\"") @@ -207,17 +210,6 @@ modules/gallery/views/menu_dialog.html.php 5 DIRTY_JS $menu- modules/gallery/views/menu_link.html.php 3 DIRTY $menu->css_id?"id='{$menu->css_id}'":"" modules/gallery/views/menu_link.html.php 4 DIRTY_ATTR $menu->css_class modules/gallery/views/menu_link.html.php 5 DIRTY_JS $menu->url -modules/gallery/views/move_browse.html.php 5 DIRTY_JS url::site("move/show_sub_tree/{$source->id}/__TARGETID__") -modules/gallery/views/move_browse.html.php 40 DIRTY $tree -modules/gallery/views/move_browse.html.php 44 DIRTY access::csrf_form_field() -modules/gallery/views/move_tree.html.php 2 DIRTY $parent->thumb_img(array(),25); -modules/gallery/views/move_tree.html.php 4 DIRTY_JS $parent->id -modules/gallery/views/move_tree.html.php 6 DIRTY_JS $parent->id -modules/gallery/views/move_tree.html.php 8 DIRTY_ATTR $parent->id -modules/gallery/views/move_tree.html.php 10 DIRTY_ATTR $child->id -modules/gallery/views/move_tree.html.php 11 DIRTY $child->thumb_img(array(),25); -modules/gallery/views/move_tree.html.php 13 DIRTY_JS $child->id -modules/gallery/views/move_tree.html.php 15 DIRTY_JS $child->id modules/gallery/views/movieplayer.html.php 2 DIRTY html::anchor($item->file_url(true),"",$attrs) modules/gallery/views/movieplayer.html.php 5 DIRTY_JS $attrs["id"] modules/gallery/views/movieplayer.html.php 7 DIRTY_JS url::abs_file("lib/flowplayer.swf") @@ -281,18 +273,19 @@ modules/notification/views/item_updated.html.php 20 DIRTY_JS $item- modules/notification/views/item_updated.html.php 20 DIRTY $item->abs_url() modules/notification/views/user_profile_notification.html.php 5 DIRTY_ATTR $subscription->id modules/notification/views/user_profile_notification.html.php 6 DIRTY_JS $subscription->url -modules/organize/views/organize_dialog.html.php 90 DIRTY_JS $domain -modules/organize/views/organize_dialog.html.php 91 DIRTY_JS $access_key -modules/organize/views/organize_dialog.html.php 92 DIRTY_JS request::protocol() -modules/organize/views/organize_dialog.html.php 93 DIRTY_JS $file_filter -modules/organize/views/organize_dialog.html.php 94 DIRTY_JS $sort_order -modules/organize/views/organize_dialog.html.php 95 DIRTY_JS $sort_fields -modules/organize/views/organize_dialog.html.php 96 DIRTY_JS $album->id -modules/organize/views/organize_dialog.html.php 97 DIRTY_JS $rest_uri -modules/organize/views/organize_dialog.html.php 98 DIRTY_JS $controller_uri -modules/organize/views/organize_dialog.html.php 104 DIRTY_JS $flash_minimum_version="10.0.0" -modules/organize/views/organize_dialog.html.php 122 DIRTY_JS $swf_uri -modules/organize/views/organize_dialog.html.php 136 DIRTY_ATTR request::protocol() +modules/organize/views/organize_dialog.html.php 86 DIRTY_JS $domain +modules/organize/views/organize_dialog.html.php 87 DIRTY_JS $access_key +modules/organize/views/organize_dialog.html.php 88 DIRTY_JS request::protocol() +modules/organize/views/organize_dialog.html.php 89 DIRTY_JS $file_filter +modules/organize/views/organize_dialog.html.php 90 DIRTY_JS $sort_order +modules/organize/views/organize_dialog.html.php 91 DIRTY_JS $sort_fields +modules/organize/views/organize_dialog.html.php 92 DIRTY_JS $album->id +modules/organize/views/organize_dialog.html.php 93 DIRTY_JS $selected_id +modules/organize/views/organize_dialog.html.php 94 DIRTY_JS $rest_uri +modules/organize/views/organize_dialog.html.php 95 DIRTY_JS $controller_uri +modules/organize/views/organize_dialog.html.php 101 DIRTY_JS $flash_minimum_version="10.0.0" +modules/organize/views/organize_dialog.html.php 119 DIRTY_JS $swf_uri +modules/organize/views/organize_dialog.html.php 132 DIRTY_ATTR request::protocol() modules/recaptcha/views/admin_recaptcha.html.php 11 DIRTY $form modules/recaptcha/views/admin_recaptcha.html.php 23 DIRTY_JS $public_key modules/recaptcha/views/form_recaptcha.html.php 7 DIRTY_JS $public_key @@ -385,10 +378,10 @@ themes/admin_wind/views/pager.html.php 37 DIRTY_JS str_re themes/wind/views/album.html.php 16 DIRTY_ATTR $child->id themes/wind/views/album.html.php 16 DIRTY_ATTR $item_class themes/wind/views/album.html.php 18 DIRTY_JS $child->url() -themes/wind/views/album.html.php 19 DIRTY $child->thumb_img(array("class"=>"g-thumbnail")) -themes/wind/views/album.html.php 23 DIRTY_ATTR $item_class -themes/wind/views/album.html.php 24 DIRTY_JS $child->url() -themes/wind/views/album.html.php 42 DIRTY $theme->paginator() +themes/wind/views/album.html.php 20 DIRTY $child->thumb_img(array("class"=>"g-thumbnail")) +themes/wind/views/album.html.php 25 DIRTY_ATTR $item_class +themes/wind/views/album.html.php 26 DIRTY_JS $child->url() +themes/wind/views/album.html.php 44 DIRTY $theme->paginator() themes/wind/views/block.html.php 3 DIRTY_ATTR $anchor themes/wind/views/block.html.php 5 DIRTY_ATTR $css_id themes/wind/views/block.html.php 6 DIRTY $title @@ -410,16 +403,17 @@ themes/wind/views/page.html.php 44 DIRTY $thumb themes/wind/views/page.html.php 81 DIRTY $header_text themes/wind/views/page.html.php 83 DIRTY_JS item::root()->url() themes/wind/views/page.html.php 87 DIRTY $theme->user_menu() -themes/wind/views/page.html.php 108 DIRTY_JS $parent->url($parent==$theme->item()->parent()?"show={$theme->item()->id}":null) -themes/wind/views/page.html.php 126 DIRTY $content -themes/wind/views/page.html.php 132 DIRTY newView("sidebar.html") -themes/wind/views/page.html.php 139 DIRTY $footer_text +themes/wind/views/page.html.php 108 DIRTY_JS $parent->url($parent->id==$theme->item()->parent_id?"show={$theme->item()->id}":null) +themes/wind/views/page.html.php 129 DIRTY $content +themes/wind/views/page.html.php 135 DIRTY newView("sidebar.html") +themes/wind/views/page.html.php 142 DIRTY $footer_text themes/wind/views/paginator.html.php 33 DIRTY_JS $first_page_url themes/wind/views/paginator.html.php 42 DIRTY_JS $previous_page_url themes/wind/views/paginator.html.php 70 DIRTY_JS $next_page_url themes/wind/views/paginator.html.php 79 DIRTY_JS $last_page_url -themes/wind/views/photo.html.php 8 DIRTY_JS $theme->item()->width -themes/wind/views/photo.html.php 8 DIRTY_JS $theme->item()->height -themes/wind/views/photo.html.php 18 DIRTY $theme->paginator() -themes/wind/views/photo.html.php 23 DIRTY_JS $item->file_url() -themes/wind/views/photo.html.php 25 DIRTY $item->resize_img(array("id"=>"g-item-id-{$item->id}","class"=>"g-resize")) +themes/wind/views/photo.html.php 7 DIRTY_JS $theme->item()->width +themes/wind/views/photo.html.php 7 DIRTY_JS $theme->item()->height +themes/wind/views/photo.html.php 17 DIRTY_JS url::site("items/dimensions/".$theme->item()->id) +themes/wind/views/photo.html.php 31 DIRTY $theme->paginator() +themes/wind/views/photo.html.php 36 DIRTY_JS $item->file_url() +themes/wind/views/photo.html.php 38 DIRTY $item->resize_img(array("id"=>"g-item-id-{$item->id}","class"=>"g-resize")) -- cgit v1.2.3 From cc399bf4f07fd7060536f442373a1e9c0ea4a5aa Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 6 Sep 2010 16:20:37 -0700 Subject: Track the language of the user receiving the notification and send the email in that user's language. Incidentally, send one email per recipient, else we're leaking email addresses which is bad for community sites. Bump notification module to v2 in the process. Fixes ticket #1287. --- modules/notification/helpers/notification.php | 156 ++++++++++----------- .../helpers/notification_installer.php | 8 ++ modules/notification/module.info | 2 +- 3 files changed, 81 insertions(+), 85 deletions(-) (limited to 'modules') diff --git a/modules/notification/helpers/notification.php b/modules/notification/helpers/notification.php index e4212203..0564d336 100644 --- a/modules/notification/helpers/notification.php +++ b/modules/notification/helpers/notification.php @@ -67,7 +67,7 @@ class notification { } static function get_subscribers($item) { - $subscriber_ids = array(); + $subscriber_ids = array(); foreach (ORM::factory("subscription") ->select("user_id") ->join("items", "subscriptions.item_id", "items.id") @@ -86,88 +86,76 @@ class notification { $subscribers = array(); foreach ($users as $user) { if (access::user_can($user, "view", $item) && !empty($user->email)) { - $subscribers[$user->email] = 1; + $subscribers[$user->email] = $user->locale; } } - return array_keys($subscribers); + return $subscribers; } static function send_item_updated($original, $item) { - $subscribers = self::get_subscribers($item); - if (!$subscribers) { - return; + foreach (self::get_subscribers($item) as $email => $locale) { + $v = new View("item_updated.html"); + $v->original = $original; + $v->item = $item; + $v->subject = $item->is_album() ? + t("Album \"%title\" updated", array("title" => $original->title, "locale" => $locale)) : + ($item->is_photo() ? + t("Photo \"%title\" updated", array("title" => $original->title, "locale" => $locale)) + : t("Movie \"%title\" updated", array("title" => $original->title, "locale" => $locale))); + self::_notify($email, $locale, $item, $v->render(), $v->subject); } - - $v = new View("item_updated.html"); - $v->original = $original; - $v->item = $item; - $v->subject = $item->is_album() ? - t("Album \"%title\" updated", array("title" => $original->title)) : - ($item->is_photo() ? - t("Photo \"%title\" updated", array("title" => $original->title)) - : t("Movie \"%title\" updated", array("title" => $original->title))); - - self::_notify($subscribers, $item, $v->render(), $v->subject); } static function send_item_add($item) { - $subscribers = self::get_subscribers($item); - if (!$subscribers) { - return; - } - $parent = $item->parent(); - $v = new View("item_added.html"); - $v->item = $item; - $v->subject = $item->is_album() ? - t("Album \"%title\" added to \"%parent_title\"", - array("title" => $item->title, "parent_title" => $parent->title)) : - ($item->is_photo() ? - t("Photo \"%title\" added to \"%parent_title\"", - array("title" => $item->title, "parent_title" => $parent->title)) : - t("Movie \"%title\" added to \"%parent_title\"", - array("title" => $item->title, "parent_title" => $parent->title))); - - self::_notify($subscribers, $item, $v->render(), $v->subject); + foreach (self::get_subscribers($item) as $email => $locale) { + $v = new View("item_added.html"); + $v->item = $item; + $v->subject = $item->is_album() ? + t("Album \"%title\" added to \"%parent_title\"", + array("title" => $item->title, "parent_title" => $parent->title, "locale" => $locale)) : + ($item->is_photo() ? + t("Photo \"%title\" added to \"%parent_title\"", + array("title" => $item->title, "parent_title" => $parent->title, "locale" => $locale)) : + t("Movie \"%title\" added to \"%parent_title\"", + array("title" => $item->title, "parent_title" => $parent->title, "locale" => $locale))); + self::_notify($email, $locale, $item, $v->render(), $v->subject); + } } static function send_item_deleted($item) { - $subscribers = self::get_subscribers($item); - if (!$subscribers) { - return; - } - $parent = $item->parent(); - $v = new View("item_deleted.html"); - $v->item = $item; - $v->subject = $item->is_album() ? - t("Album \"%title\" removed from \"%parent_title\"", - array("title" => $item->title, "parent_title" => $parent->title)) : - ($item->is_photo() ? - t("Photo \"%title\" removed from \"%parent_title\"", - array("title" => $item->title, "parent_title" => $parent->title)) - : t("Movie \"%title\" removed from \"%parent_title\"", - array("title" => $item->title, "parent_title" => $parent->title))); - - self::_notify($subscribers, $item, $v->render(), $v->subject); + foreach (self::get_subscribers($item) as $email => $locale) { + $v = new View("item_deleted.html"); + $v->item = $item; + $v->subject = $item->is_album() ? + t("Album \"%title\" removed from \"%parent_title\"", + array("title" => $item->title, "parent_title" => $parent->title, "locale" => $locale)) : + ($item->is_photo() ? + t("Photo \"%title\" removed from \"%parent_title\"", + array("title" => $item->title, "parent_title" => $parent->title, "locale" => $locale)) + : t("Movie \"%title\" removed from \"%parent_title\"", + array("title" => $item->title, "parent_title" => $parent->title, + "locale" => $locale))); + self::_notify($email, $locale, $item, $v->render(), $v->subject); + } } static function send_comment_published($comment) { $item = $comment->item(); - $subscribers = self::get_subscribers($item); - if (!$subscribers) { - return; - } - - $v = new View("comment_published.html"); - $v->comment = $comment; - $v->subject = $item->is_album() ? - t("A new comment was published for album \"%title\"", array("title" => $item->title)) : + foreach (self::get_subscribers($item) as $email => $locale) { + $v = new View("comment_published.html"); + $v->comment = $comment; + $v->subject = $item->is_album() ? + t("A new comment was published for album \"%title\"", + array("title" => $item->title, "locale" => $locale)) : ($item->is_photo() ? - t("A new comment was published for photo \"%title\"", array("title" => $item->title)) - : t("A new comment was published for movie \"%title\"", array("title" => $item->title))); - - self::_notify($subscribers, $item, $v->render(), $v->subject); + t("A new comment was published for photo \"%title\"", + array("title" => $item->title, "locale" => $locale)) + : t("A new comment was published for movie \"%title\"", + array("title" => $item->title, "locale" => $locale))); + self::_notify($email, $locale, $item, $v->render(), $v->subject); + } } static function send_pending_notifications() { @@ -191,13 +179,16 @@ class notification { $pending->delete(); } else { $text = ""; + $locale = null; foreach ($result as $pending) { $text .= $pending->text; + $locale = $pending->locale; $pending->delete(); } Sendmail::factory() ->to($email) - ->subject(t("Multiple events have occurred")) // @todo fix this terrible subject line + ->subject(t("New activity for %site_name", + array("site_name" => item::root()->title, "locale" => $locale))) ->header("Mime-Version", "1.0") ->header("Content-Type", "text/html; charset=UTF-8") ->message($text) @@ -206,25 +197,22 @@ class notification { } } - private static function _notify($subscribers, $item, $text, $subject) { - if (!empty($subscribers)) { - if (!batch::in_progress()) { - Sendmail::factory() - ->to($subscribers) - ->subject($subject) - ->header("Mime-Version", "1.0") - ->header("Content-Type", "text/html; charset=UTF-8") - ->message($text) - ->send(); - } else { - foreach ($subscribers as $subscriber) { - $pending = ORM::factory("pending_notification"); - $pending->subject = $subject; - $pending->text = $text; - $pending->email = $subscriber; - $pending->save(); - } - } + private static function _notify($email, $locale, $item, $text, $subject) { + if (!batch::in_progress()) { + Sendmail::factory() + ->to($email) + ->subject($subject) + ->header("Mime-Version", "1.0") + ->header("Content-Type", "text/html; charset=UTF-8") + ->message($text) + ->send(); + } else { + $pending = ORM::factory("pending_notification"); + $pending->subject = $subject; + $pending->text = $text; + $pending->email = $email; + $pending->locale = $locale; + $pending->save(); } } } diff --git a/modules/notification/helpers/notification_installer.php b/modules/notification/helpers/notification_installer.php index d082d80f..78f72194 100644 --- a/modules/notification/helpers/notification_installer.php +++ b/modules/notification/helpers/notification_installer.php @@ -39,6 +39,14 @@ class notification_installer { module::set_version("notification", 1); } + static function upgrade($version) { + $db = Database::instance(); + if ($version == 1) { + $db->query("ALTER TABLE {pending_notifications} ADD COLUMN `locale` char(10) default NULL"); + module::set_version("notification", $version = 2); + } + } + static function uninstall() { $db = Database::instance(); $db->query("DROP TABLE IF EXISTS {subscriptions};"); diff --git a/modules/notification/module.info b/modules/notification/module.info index 31684ccf..8c5e1162 100644 --- a/modules/notification/module.info +++ b/modules/notification/module.info @@ -1,3 +1,3 @@ name = "Notification" description = "Send notifications to users when changes are made to watched albums." -version = 1 +version = 2 -- cgit v1.2.3 From 8a36c24f39e7a6111f7872ec443e6efa63580c82 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 6 Sep 2010 18:20:46 -0700 Subject: Fix some broken identity APIs: - add_user_to_group and remove_user_from_group should take Group_Definition instances to be consistent - add_user_to_group and remove_user_from_group in drivers/IdentityProvider.php should not be static --- modules/gallery/helpers/identity.php | 8 ++++---- modules/gallery/libraries/drivers/IdentityProvider.php | 12 ++++++------ modules/user/helpers/group.php | 8 ++++---- modules/user/libraries/drivers/IdentityProvider/Gallery.php | 7 ++----- 4 files changed, 16 insertions(+), 19 deletions(-) (limited to 'modules') diff --git a/modules/gallery/helpers/identity.php b/modules/gallery/helpers/identity.php index 5de05948..5ca024e9 100644 --- a/modules/gallery/helpers/identity.php +++ b/modules/gallery/helpers/identity.php @@ -233,14 +233,14 @@ class identity_Core { /** * @see IdentityProvider_Driver::add_user_to_group. */ - static function add_user_to_group($user, $group_id) { - return IdentityProvider::instance()->add_user_to_group($user, $group_id); + static function add_user_to_group($user, $group) { + return IdentityProvider::instance()->add_user_to_group($user, $group); } /** * @see IdentityProvider_Driver::remove_user_to_group. */ - static function remove_user_from_group($user, $group_id) { - return IdentityProvider::instance()->remove_user_from_group($user, $group_id); + static function remove_user_from_group($user, $group) { + return IdentityProvider::instance()->remove_user_from_group($user, $group); } } \ No newline at end of file diff --git a/modules/gallery/libraries/drivers/IdentityProvider.php b/modules/gallery/libraries/drivers/IdentityProvider.php index 3e85a57b..ac2473f5 100644 --- a/modules/gallery/libraries/drivers/IdentityProvider.php +++ b/modules/gallery/libraries/drivers/IdentityProvider.php @@ -116,17 +116,17 @@ interface IdentityProvider_Driver { /** * Add the user to the specified group - * @param User_Definition the user to add to the group - * @param int the group_id + * @param User_Definition the user to add + * @param Group_Definition the target group */ - static function add_user_to_group($user, $group_id); + public function add_user_to_group($user, $group); /** * Remove the user to the specified group - * @param User_Definition the user to add to the group - * @param int the group id + * @param User_Definition the user to remove + * @param Group_Definition the owning group */ - static function remove_user_from_group($user, $group_id); + public function remove_user_from_group($user, $group); } // End Identity Driver Definition interface Group_Definition {} diff --git a/modules/user/helpers/group.php b/modules/user/helpers/group.php index c84910f1..88bfac35 100644 --- a/modules/user/helpers/group.php +++ b/modules/user/helpers/group.php @@ -68,13 +68,13 @@ class group_Core { */ private static function _lookup_by_field($field_name, $value) { try { - $user = model_cache::get("group", $value, $field_name); - if ($user->loaded()) { - return $user; + $group = model_cache::get("group", $value, $field_name); + if ($group->loaded()) { + return $group; } } catch (Exception $e) { if (strpos($e->getMessage(), "MISSING_MODEL") === false) { - throw $e; + throw $e; } } return null; diff --git a/modules/user/libraries/drivers/IdentityProvider/Gallery.php b/modules/user/libraries/drivers/IdentityProvider/Gallery.php index 1ed7dd4f..44433ad7 100644 --- a/modules/user/libraries/drivers/IdentityProvider/Gallery.php +++ b/modules/user/libraries/drivers/IdentityProvider/Gallery.php @@ -148,9 +148,7 @@ class IdentityProvider_Gallery_Driver implements IdentityProvider_Driver { /** * @see IdentityProvider_Driver::add_user_to_group. */ - static function add_user_to_group($user, $group_id) { - $group = self::lookup_group($group_id); - + public function add_user_to_group($user, $group) { $group->add($user); $group->save(); } @@ -158,8 +156,7 @@ class IdentityProvider_Gallery_Driver implements IdentityProvider_Driver { /** * @see IdentityProvider_Driver::remove_user_to_group. */ - static function remove_user_from_group($user, $group_id) { - $group = self::lookup_group_by_name($group_id); + public function remove_user_from_group($user, $group_id) { $group->remove($user); $group->save(); } -- cgit v1.2.3 From 886b88fccf5de7fb3b17e1f3a2acd539268d1e8b Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 6 Sep 2010 18:49:37 -0700 Subject: Revert "change the Setswana locale from tn_ZA to tn_BW since it's mostly" This reverts commit 2d948cb39fd2da6a5f966a10cbeb4f5d5caec5a3. Valiant said that tn_ZA is right: http://gallery.menalto.com/node/97840#comment-352865 --- modules/gallery/helpers/locales.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/gallery/helpers/locales.php b/modules/gallery/helpers/locales.php index 624ff9cb..1f5473ff 100644 --- a/modules/gallery/helpers/locales.php +++ b/modules/gallery/helpers/locales.php @@ -103,7 +103,7 @@ class locales_Core { $l["sl_SI"] = "Slovenščina"; // Slovenian $l["sr_CS"] = "Srpski"; // Serbian $l["sv_SE"] = "Svenska"; // Swedish - $l["tn_BW"] = "Setswana"; // Setswana + $l["tn_ZA"] = "Setswana"; // Setswana $l["tr_TR"] = "Türkçe"; // Turkish $l["uk_UA"] = "українська"; // Ukrainian $l["vi_VN"] = "Tiếng Việt"; // Vietnamese -- cgit v1.2.3 From 2f810ec12624eefa3eb47ad7174dbbe03936135d Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 6 Sep 2010 19:28:34 -0700 Subject: Add "web_url" with the url to the web version of the item. Fixes ticket #1341. --- modules/gallery/models/item.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'modules') diff --git a/modules/gallery/models/item.php b/modules/gallery/models/item.php index 1db766e9..34c22021 100644 --- a/modules/gallery/models/item.php +++ b/modules/gallery/models/item.php @@ -975,6 +975,8 @@ class Item_Model extends ORM_MPTT { } unset($data["album_cover_item_id"]); + $data["web_url"] = $this->abs_url(); + if (access::can("view_full", $this) && !$this->is_album()) { $data["file_url"] = rest::url("data", $this, "full"); } -- cgit v1.2.3 From 2f94dfc67c809ae356e5d3e1a5ab21c7ba0a2a27 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 6 Sep 2010 19:40:36 -0700 Subject: Add "Options +FollowSymLinks" to the example mod_rewrite rules and put it in a textarea for easy copying. --- modules/g2_import/views/admin_g2_import.html.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'modules') diff --git a/modules/g2_import/views/admin_g2_import.html.php b/modules/g2_import/views/admin_g2_import.html.php index 05cbab71..8ec4b5ce 100644 --- a/modules/g2_import/views/admin_g2_import.html.php +++ b/modules/g2_import/views/admin_g2_import.html.php @@ -99,13 +99,12 @@

- - <IfModule mod_rewrite.c>
- RewriteEngine On
- RewriteBase
- RewriteRule ^(.*)$ [QSA,L,R=301]
- </IfModule>
-
+ -- cgit v1.2.3 From fa1fe47b6a0a377929a70748406eae589ecf2a00 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 6 Sep 2010 22:13:41 -0700 Subject: Use the absolute site url when logging out of the admin site else we wind up with weird url doubling effects. Fixes ticket #1342. --- modules/gallery/helpers/gallery_event.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/gallery/helpers/gallery_event.php b/modules/gallery/helpers/gallery_event.php index ec7d1882..0ba98025 100644 --- a/modules/gallery/helpers/gallery_event.php +++ b/modules/gallery/helpers/gallery_event.php @@ -210,7 +210,7 @@ class gallery_event_Core { ->label($user->display_name())); if (Router::$controller == "admin") { - $continue_url = url::site(""); + $continue_url = url::abs_site(""); } else if (isset($theme->item)) { if (access::user_can(identity::guest(), "view", $theme->item)) { $continue_url = $theme->item->abs_url(); -- cgit v1.2.3