From 89737c09d572efe35014e668cdd06407c2c19d62 Mon Sep 17 00:00:00 2001 From: Joe7 Date: Sun, 9 Jan 2011 20:52:31 +0100 Subject: Paginator for user manager admin view Closes ticket #1557 Note: also optimizes the way item count is retrieved for users, saving -1 queries when displaying this page --- modules/gallery/libraries/MY_Controller.php | 26 ++++++++++++++++++++++ modules/user/controllers/admin_users.php | 34 ++++++++++++++++++++++++++++- modules/user/views/admin_users.html.php | 31 +++++++++++++++++++++++++- 3 files changed, 89 insertions(+), 2 deletions(-) create mode 100644 modules/gallery/libraries/MY_Controller.php diff --git a/modules/gallery/libraries/MY_Controller.php b/modules/gallery/libraries/MY_Controller.php new file mode 100644 index 00000000..ea2a7502 --- /dev/null +++ b/modules/gallery/libraries/MY_Controller.php @@ -0,0 +1,26 @@ +page_title = t("Users and groups"); $view->content = new View("admin_users.html"); - $view->content->users = ORM::factory("user")->order_by("name", "ASC")->find_all(); + + // @todo: add this as a config option + $page_size = module::get_var("user", "page_size", 10); + $page = Input::instance()->get("page", "1"); + $builder = db::build(); + $user_count = $builder->from("users")->count_records(); + list($offset, $max_pages) = Controller::get_pager_params($page, $user_count, $page_size); + + // Make sure that the page references a valid offset + if ($page < 1) { + url::redirect(url::merge(array("page" => 1))); + } else if ($page > $max_pages) { + url::redirect(url::merge(array("page" => $max_pages))); + } + $view->content->users = ORM::factory("user") + ->select(array("users.id", "users.admin", "users.name", "users.email", "users.full_name", + "users.last_login", "users.guest", db::expr("COUNT(items.id) as item_count"))) + ->join("items", "items.owner_id", "users.id", "LEFT") + ->group_by("users.id") + ->order_by("users.name", "ASC") + ->find_all($page_size, $offset); + $view->content->groups = ORM::factory("group")->order_by("name", "ASC")->find_all(); + $view->content->page = $page; + $view->content->max_pages = $max_pages; + + if ($page < $max_pages) { + $view->content->next_page_url = url::site(url::merge(array("page" => $page + 1))); + } + if ( $page > 1 ) + { + $view->content->previous_page_url = url::site(url::merge(array("page" => $page - 1))); + } + print $view; } diff --git a/modules/user/views/admin_users.html.php b/modules/user/views/admin_users.html.php index f067cae8..028d44eb 100644 --- a/modules/user/views/admin_users.html.php +++ b/modules/user/views/admin_users.html.php @@ -88,7 +88,7 @@ last_login == 0) ? "" : gallery::date($user->last_login) ?> - from("items")->where("owner_id", "=", $user->id)->count_records() ?> + item_count ?> id") ?>" @@ -108,6 +108,35 @@ + + + -- cgit v1.2.3 From 97fc535411478f939b303c75a067b7dad9123112 Mon Sep 17 00:00:00 2001 From: Joe7 Date: Sun, 9 Jan 2011 21:19:55 +0100 Subject: Minor css mod to make it obvious paging belongs to user block --- modules/user/css/user.css | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/user/css/user.css b/modules/user/css/user.css index 084eac31..93e3d02e 100644 --- a/modules/user/css/user.css +++ b/modules/user/css/user.css @@ -12,6 +12,7 @@ #g-user-admin { width: auto; + margin-bottom: 4em; } #g-group-admin { -- cgit v1.2.3 From 00b520fffd867389b5a030ddefee9f468cad044c Mon Sep 17 00:00:00 2001 From: Joe7 Date: Tue, 11 Jan 2011 20:53:48 +0100 Subject: coding style --- modules/user/controllers/admin_users.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/user/controllers/admin_users.php b/modules/user/controllers/admin_users.php index 6850f8af..2ae9788e 100644 --- a/modules/user/controllers/admin_users.php +++ b/modules/user/controllers/admin_users.php @@ -51,8 +51,7 @@ class Admin_Users_Controller extends Admin_Controller { if ($page < $max_pages) { $view->content->next_page_url = url::site(url::merge(array("page" => $page + 1))); } - if ( $page > 1 ) - { + if ($page > 1) { $view->content->previous_page_url = url::site(url::merge(array("page" => $page - 1))); } -- cgit v1.2.3 From df802de6ae3cc0c294a1a3dc76db29ff21949b9f Mon Sep 17 00:00:00 2001 From: Joe7 Date: Tue, 11 Jan 2011 21:28:25 +0100 Subject: Making good use of Pagination class to reduce code (removed MY_Controller which duplicated some functionality available in Pagination as well) --- modules/gallery/libraries/MY_Controller.php | 26 -------------------------- modules/user/controllers/admin_users.php | 24 +++++++++++------------- modules/user/views/admin_users.html.php | 28 ++-------------------------- 3 files changed, 13 insertions(+), 65 deletions(-) delete mode 100644 modules/gallery/libraries/MY_Controller.php diff --git a/modules/gallery/libraries/MY_Controller.php b/modules/gallery/libraries/MY_Controller.php deleted file mode 100644 index ea2a7502..00000000 --- a/modules/gallery/libraries/MY_Controller.php +++ /dev/null @@ -1,26 +0,0 @@ -get("page", "1"); $builder = db::build(); $user_count = $builder->from("users")->count_records(); - list($offset, $max_pages) = Controller::get_pager_params($page, $user_count, $page_size); + + $view->content->pager = new Pagination(); + $view->content->pager->initialize( + array("query_string" => "page", + "total_items" => $user_count, + "items_per_page" => $page_size, + "style" => "classic")); // Make sure that the page references a valid offset if ($page < 1) { url::redirect(url::merge(array("page" => 1))); - } else if ($page > $max_pages) { - url::redirect(url::merge(array("page" => $max_pages))); + } else if ($page > $view->content->pager->total_pages) { + url::redirect(url::merge(array("page" => $view->content->pager->total_pages))); } + $view->content->users = ORM::factory("user") ->select(array("users.id", "users.admin", "users.name", "users.email", "users.full_name", "users.last_login", "users.guest", db::expr("COUNT(items.id) as item_count"))) ->join("items", "items.owner_id", "users.id", "LEFT") ->group_by("users.id") ->order_by("users.name", "ASC") - ->find_all($page_size, $offset); + ->find_all($page_size, $view->content->pager->sql_offset); $view->content->groups = ORM::factory("group")->order_by("name", "ASC")->find_all(); - $view->content->page = $page; - $view->content->max_pages = $max_pages; - - if ($page < $max_pages) { - $view->content->next_page_url = url::site(url::merge(array("page" => $page + 1))); - } - if ($page > 1) { - $view->content->previous_page_url = url::site(url::merge(array("page" => $page - 1))); - } print $view; } diff --git a/modules/user/views/admin_users.html.php b/modules/user/views/admin_users.html.php index 028d44eb..74b13ec5 100644 --- a/modules/user/views/admin_users.html.php +++ b/modules/user/views/admin_users.html.php @@ -109,32 +109,8 @@ - -- cgit v1.2.3 From d511fc77adfa628b04968d153e397425e3a93358 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 15 Jan 2011 12:33:51 -0800 Subject: Tweake Joe's change to admin_users to revert the code that joins against the items table; it's not clear that this is going to be efficient for large data sets. --- modules/user/controllers/admin_users.php | 7 ++----- modules/user/views/admin_users.html.php | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/modules/user/controllers/admin_users.php b/modules/user/controllers/admin_users.php index e11145de..8dbc4cbb 100644 --- a/modules/user/controllers/admin_users.php +++ b/modules/user/controllers/admin_users.php @@ -43,14 +43,11 @@ class Admin_Users_Controller extends Admin_Controller { url::redirect(url::merge(array("page" => $view->content->pager->total_pages))); } + // Join our users against the items table so that we can get a count of their items + // in the same query. $view->content->users = ORM::factory("user") - ->select(array("users.id", "users.admin", "users.name", "users.email", "users.full_name", - "users.last_login", "users.guest", db::expr("COUNT(items.id) as item_count"))) - ->join("items", "items.owner_id", "users.id", "LEFT") - ->group_by("users.id") ->order_by("users.name", "ASC") ->find_all($page_size, $view->content->pager->sql_offset); - $view->content->groups = ORM::factory("group")->order_by("name", "ASC")->find_all(); print $view; diff --git a/modules/user/views/admin_users.html.php b/modules/user/views/admin_users.html.php index 74b13ec5..a7bd6b27 100644 --- a/modules/user/views/admin_users.html.php +++ b/modules/user/views/admin_users.html.php @@ -88,7 +88,7 @@ last_login == 0) ? "" : gallery::date($user->last_login) ?> - item_count ?> + from("items")->where("owner_id", "=", $user->id)->count_records() ?> id") ?>" -- cgit v1.2.3 From 376f09c4e171e03a5b3764e51e0d28f1f57a233b Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 15 Jan 2011 12:47:15 -0800 Subject: Reorganize the url() function out from in the middle of the script/css combining functions. --- modules/gallery/libraries/Gallery_View.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/modules/gallery/libraries/Gallery_View.php b/modules/gallery/libraries/Gallery_View.php index 8befda95..e27dc41a 100644 --- a/modules/gallery/libraries/Gallery_View.php +++ b/modules/gallery/libraries/Gallery_View.php @@ -21,6 +21,15 @@ class Gallery_View_Core extends View { protected $theme_name = null; protected $combine_queue = array(); + /** + * Provide a url to a resource within the current theme. This allows us to refer to theme + * resources without naming the theme itself which makes themes easier to copy. + */ + public function url($path, $absolute_url=false) { + $arg = "themes/{$this->theme_name}/$path"; + return $absolute_url ? url::abs_file($arg) : url::file($arg); + } + /** * Begin gather up scripts or css files so that they can be combined into a single request. * @@ -53,15 +62,6 @@ class Gallery_View_Core extends View { } } - /** - * Provide a url to a resource within the current theme. This allows us to refer to theme - * resources without naming the theme itself which makes themes easier to copy. - */ - public function url($path, $absolute_url=false) { - $arg = "themes/{$this->theme_name}/$path"; - return $absolute_url ? url::abs_file($arg) : url::file($arg); - } - /** * If css combining is enabled, add this css to the list of css that will be * combined into a single style element. When combined, the order of style elements -- cgit v1.2.3 From 375e3b1fa4616c77fd37764c3812f6e03b20b95d Mon Sep 17 00:00:00 2001 From: Joe7 Date: Sat, 15 Jan 2011 21:49:22 +0100 Subject: Fixed paging for albums ordered by random. MySql has problems when comparing float values against -seemingly same- float input, see http://dev.mysql.com/doc/refman/5.0/en/problems-with-float.html for details. Fixes #1610 --- installer/install.sql | 4 ++-- modules/gallery/helpers/gallery_installer.php | 9 +++++++-- modules/gallery/module.info | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/installer/install.sql b/installer/install.sql index 0ed7f2f3..07aae36d 100644 --- a/installer/install.sql +++ b/installer/install.sql @@ -160,7 +160,7 @@ CREATE TABLE {items} ( `name` varchar(255) DEFAULT NULL, `owner_id` int(9) DEFAULT NULL, `parent_id` int(9) NOT NULL, - `rand_key` float DEFAULT NULL, + `rand_key` decimal(11,10) DEFAULT NULL, `relative_path_cache` varchar(255) DEFAULT NULL, `relative_url_cache` varchar(255) DEFAULT NULL, `resize_dirty` tinyint(1) DEFAULT '1', @@ -244,7 +244,7 @@ CREATE TABLE {modules} ( KEY `weight` (`weight`) ) AUTO_INCREMENT=10 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -INSERT INTO {modules} VALUES (1,1,'gallery',43,1); +INSERT INTO {modules} VALUES (1,1,'gallery',44,1); INSERT INTO {modules} VALUES (2,1,'user',3,2); INSERT INTO {modules} VALUES (3,1,'comment',3,3); INSERT INTO {modules} VALUES (4,1,'organize',3,4); diff --git a/modules/gallery/helpers/gallery_installer.php b/modules/gallery/helpers/gallery_installer.php index f7b8da5f..3c7b1c84 100644 --- a/modules/gallery/helpers/gallery_installer.php +++ b/modules/gallery/helpers/gallery_installer.php @@ -92,7 +92,7 @@ class gallery_installer { `name` varchar(255) default NULL, `owner_id` int(9) default NULL, `parent_id` int(9) NOT NULL, - `rand_key` float default NULL, + `rand_key` decimal(11,10) default NULL, `relative_path_cache` varchar(255) default NULL, `relative_url_cache` varchar(255) default NULL, `resize_dirty` boolean default 1, @@ -309,7 +309,7 @@ class gallery_installer { module::set_var("gallery", "show_user_profiles_to", "registered_users"); module::set_var("gallery", "extra_binary_paths", "/usr/local/bin:/opt/local/bin:/opt/bin"); - module::set_version("gallery", 43); + module::set_version("gallery", 44); } static function upgrade($version) { @@ -653,6 +653,11 @@ class gallery_installer { $db->query("ALTER TABLE {items} CHANGE `description` `description` text DEFAULT NULL"); module::set_version("gallery", $version = 43); } + + if ($version == 43) { + $db->query("ALTER TABLE {items} CHANGE `rand_key` `rand_key` DECIMAL(11, 10)"); + module::set_version("gallery", $version = 44); + } } static function uninstall() { diff --git a/modules/gallery/module.info b/modules/gallery/module.info index eb579ab6..4c4e63a1 100644 --- a/modules/gallery/module.info +++ b/modules/gallery/module.info @@ -1,3 +1,3 @@ name = "Gallery 3" description = "Gallery core application" -version = 43 +version = 44 -- cgit v1.2.3 From 38b74932878e8e0c7eb071552568bbb014355996 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 15 Jan 2011 13:07:14 -0800 Subject: whitespace fix. --- modules/search/helpers/search_theme.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/search/helpers/search_theme.php b/modules/search/helpers/search_theme.php index 07066caa..45a88dc2 100644 --- a/modules/search/helpers/search_theme.php +++ b/modules/search/helpers/search_theme.php @@ -22,7 +22,7 @@ class search_theme_Core { if ($theme->page_subtype() != "login") { $view = new View("search_link.html"); return $view->render(); - }else { + } else { return ""; } } -- cgit v1.2.3 From ee13b934f46d67982e5eeea21f81ac58f166741c Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 15 Jan 2011 13:14:43 -0800 Subject: Fix all the head() and admin_head() theme callbacks to return the results of the $theme->css() and $theme->script() calls. This handles the case where combining scripts/css returns HTML instead of putting it in the queue for combination. Fixes #1611. --- modules/comment/helpers/comment_theme.php | 8 +++----- modules/digibug/helpers/digibug_theme.php | 2 +- modules/gallery/helpers/gallery_theme.php | 27 +++++++++++++------------ modules/recaptcha/helpers/recaptcha_theme.php | 4 ++-- modules/server_add/helpers/server_add_theme.php | 18 ++++++++--------- modules/tag/helpers/tag_theme.php | 10 ++++----- modules/user/helpers/user_theme.php | 8 ++++---- 7 files changed, 38 insertions(+), 39 deletions(-) diff --git a/modules/comment/helpers/comment_theme.php b/modules/comment/helpers/comment_theme.php index b993cdae..9cc93fa1 100644 --- a/modules/comment/helpers/comment_theme.php +++ b/modules/comment/helpers/comment_theme.php @@ -19,14 +19,12 @@ */ class comment_theme_Core { static function head($theme) { - $theme->css("comment.css"); - $theme->script("comment.js"); - return ""; + return $theme->css("comment.css") + . $theme->script("comment.js"); } static function admin_head($theme) { - $theme->css("comment.css"); - return ""; + return $theme->css("comment.css"); } static function photo_bottom($theme) { diff --git a/modules/digibug/helpers/digibug_theme.php b/modules/digibug/helpers/digibug_theme.php index d146e17d..1106910e 100644 --- a/modules/digibug/helpers/digibug_theme.php +++ b/modules/digibug/helpers/digibug_theme.php @@ -19,6 +19,6 @@ */ class digibug_theme_Core { static function head($theme) { - $theme->script("digibug.js"); + return $theme->script("digibug.js"); } } diff --git a/modules/gallery/helpers/gallery_theme.php b/modules/gallery/helpers/gallery_theme.php index 978c69a6..ebf8f38e 100644 --- a/modules/gallery/helpers/gallery_theme.php +++ b/modules/gallery/helpers/gallery_theme.php @@ -21,9 +21,9 @@ class gallery_theme_Core { static function head($theme) { $session = Session::instance(); $buf = ""; - $theme->css("gallery.css"); + $buf .= $theme->css("gallery.css"); if ($session->get("debug")) { - $theme->css("debug.css"); + $buf .= $theme->css("debug.css"); } if (module::is_active("rss")) { @@ -40,32 +40,33 @@ class gallery_theme_Core { if (count(locales::installed())) { // Needed by the languages block - $theme->script("jquery.cookie.js"); + $buf .= $theme->script("jquery.cookie.js"); } if ($session->get("l10n_mode", false)) { - $theme->css("l10n_client.css"); - $theme->script("jquery.cookie.js"); - $theme->script("l10n_client.js"); + $buf .= $theme->css("l10n_client.css") + . $theme->script("jquery.cookie.js") + . $theme->script("l10n_client.js"); } - $theme->css("uploadify/uploadify.css"); + $buf .= $theme->css("uploadify/uploadify.css"); return $buf; } static function admin_head($theme) { - $theme->css("gallery.css"); - $theme->script("gallery.panel.js"); + $buf = $theme->css("gallery.css"); + $buf .= $theme->script("gallery.panel.js"); $session = Session::instance(); if ($session->get("debug")) { - $theme->css("debug.css"); + $buf .= $theme->css("debug.css"); } if ($session->get("l10n_mode", false)) { - $theme->css("l10n_client.css"); - $theme->script("jquery.cookie.js"); - $theme->script("l10n_client.js"); + $buf .= $theme->css("l10n_client.css"); + $buf .= $theme->script("jquery.cookie.js"); + $buf .=$theme->script("l10n_client.js"); } + return $buf; } static function page_bottom($theme) { diff --git a/modules/recaptcha/helpers/recaptcha_theme.php b/modules/recaptcha/helpers/recaptcha_theme.php index ee880986..3677a7c7 100644 --- a/modules/recaptcha/helpers/recaptcha_theme.php +++ b/modules/recaptcha/helpers/recaptcha_theme.php @@ -19,10 +19,10 @@ */ class recaptcha_theme_Core { static function head($theme) { - $theme->css("recaptcha.css"); + return $theme->css("recaptcha.css"); } static function admin_head($theme) { - $theme->css("recaptcha.css"); + return $theme->css("recaptcha.css"); } } \ No newline at end of file diff --git a/modules/server_add/helpers/server_add_theme.php b/modules/server_add/helpers/server_add_theme.php index 53f78772..6395c2f0 100644 --- a/modules/server_add/helpers/server_add_theme.php +++ b/modules/server_add/helpers/server_add_theme.php @@ -20,24 +20,24 @@ class server_add_theme_Core { static function head($theme) { if (identity::active_user()->admin) { - $theme->css("server_add.css"); - $theme->script("server_add.js"); + return $theme->css("server_add.css") + . $theme->script("server_add.js"); } } static function admin_head($theme) { - $head = array(); + $buf = ""; if (strpos(Router::$current_uri, "admin/server_add") !== false) { - $theme->css("server_add.css"); - $theme->css("jquery.autocomplete.css"); + $buf .= $theme->css("server_add.css") + . $theme->css("jquery.autocomplete.css"); $base = url::site("__ARGS__"); $csrf = access::csrf_token(); - $head[] = ""; + $buf .= ""; - $theme->script("jquery.autocomplete.js"); - $theme->script("admin.js"); + $buf .= $theme->script("jquery.autocomplete.js") + . $theme->script("admin.js"); } - return implode("\n", $head); + return $buf; } } \ No newline at end of file diff --git a/modules/tag/helpers/tag_theme.php b/modules/tag/helpers/tag_theme.php index f731dbb7..3325a832 100644 --- a/modules/tag/helpers/tag_theme.php +++ b/modules/tag/helpers/tag_theme.php @@ -19,13 +19,13 @@ */ class tag_theme_Core { static function head($theme) { - $theme->css("jquery.autocomplete.css"); - $theme->script("jquery.autocomplete.js"); - $theme->css("tag.css"); + return $theme->css("jquery.autocomplete.css") + . $theme->script("jquery.autocomplete.js") + . $theme->css("tag.css"); } static function admin_head($theme) { - $theme->css("tag.css"); - $theme->script("gallery.in_place_edit.js"); + return $theme->css("tag.css") + . $theme->script("gallery.in_place_edit.js"); } } \ No newline at end of file diff --git a/modules/user/helpers/user_theme.php b/modules/user/helpers/user_theme.php index 5a7161ed..70e96f70 100644 --- a/modules/user/helpers/user_theme.php +++ b/modules/user/helpers/user_theme.php @@ -19,12 +19,12 @@ */ class user_theme_Core { static function head($theme) { - $theme->css("user.css"); - $theme->script("password_strength.js"); + return $theme->css("user.css") + . $theme->script("password_strength.js"); } static function admin_head($theme) { - $theme->css("user.css"); - $theme->script("password_strength.js"); + return $theme->css("user.css") + . $theme->script("password_strength.js"); } } \ No newline at end of file -- cgit v1.2.3 From 02f30b91bf8f68118a578de2194e66a7a16a291a Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 15 Jan 2011 14:20:26 -0800 Subject: Follow on to 966dee8628293f78fbf9431281709ceba011d3c2 for #1586 -- don't try to update the tag item count if we didn't change any items with this change (ie: a tag rename). In that case, we haven't loaded the related items so we don't have any idea what the count is going to be. --- modules/tag/models/tag.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/modules/tag/models/tag.php b/modules/tag/models/tag.php index 25df87e0..2b73b5be 100644 --- a/modules/tag/models/tag.php +++ b/modules/tag/models/tag.php @@ -78,12 +78,14 @@ class Tag_Model_Core extends ORM { $related_item_ids[$row->item_id] = 1; } - $added = array_diff($this->changed_relations["items"], $this->object_relations["items"]); - $removed = array_diff($this->object_relations["items"], $this->changed_relations["items"]); - if (isset($this->changed_relations["items"])) { - $changed = array_merge($added, $removed); + if (isset($this->object_relations["items"])) { + $added = array_diff($this->changed_relations["items"], $this->object_relations["items"]); + $removed = array_diff($this->object_relations["items"], $this->changed_relations["items"]); + if (isset($this->changed_relations["items"])) { + $changed = array_merge($added, $removed); + } + $this->count = count($this->object_relations["items"]) + count($added) - count($removed); } - $this->count = count($this->object_relations["items"]) + count($added) - count($removed); $result = parent::save(); -- cgit v1.2.3 From f0dd16efc428d372cca6ec90ca31251e3ce24382 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 15 Jan 2011 14:59:25 -0800 Subject: Revive the code from Cache_Driver::exists and put it into a helper function in the test so that we can keep our tests functioning. Follow on to 66fd8c7518ab71466aca72d20fb7bcd5f374af26 for #1559. --- modules/gallery/tests/Cache_Test.php | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/modules/gallery/tests/Cache_Test.php b/modules/gallery/tests/Cache_Test.php index b95ef0a2..5e14051a 100644 --- a/modules/gallery/tests/Cache_Test.php +++ b/modules/gallery/tests/Cache_Test.php @@ -24,8 +24,16 @@ class Cache_Test extends Gallery_Unit_Test_Case { $this->_driver = new Cache_Database_Driver(); } - public function cache_exists_test() { - $this->assert_false($this->_driver->exists("test_key"), "test_key should not be defined"); + private function _exists($id) { + return db::build() + ->where("key", "=", $id) + ->where("expiration", ">=", time()) + ->limit("1") + ->count_records("caches") > 0; + } + + public function cache_exists_test_helper_function_test() { + $this->assert_false($this->_exists("test_key"), "test_key should not be defined"); $id = random::hash(); db::build() @@ -34,7 +42,7 @@ class Cache_Test extends Gallery_Unit_Test_Case { ->values($id, ", ", 84600 + time(), serialize("some test data")) ->execute(); - $this->assert_true($this->_driver->exists($id), "test_key should be defined"); + $this->assert_true($this->_exists($id), "test_key should be defined"); } public function cache_get_test() { @@ -100,9 +108,9 @@ class Cache_Test extends Gallery_Unit_Test_Case { $this->_driver->delete(array($id1)); - $this->assert_false($this->_driver->exists($id1), "$id1 should have been deleted"); - $this->assert_true($this->_driver->exists($id2), "$id2 should not have been deleted"); - $this->assert_true($this->_driver->exists($id3), "$id3 should not have been deleted"); + $this->assert_false($this->_exists($id1), "$id1 should have been deleted"); + $this->assert_true($this->_exists($id2), "$id2 should not have been deleted"); + $this->assert_true($this->_exists($id3), "$id3 should not have been deleted"); } public function cache_delete_tag_test() { @@ -120,9 +128,9 @@ class Cache_Test extends Gallery_Unit_Test_Case { $data = $this->_driver->delete_tag(array("tag3")); - $this->assert_true($this->_driver->exists($id1), "$id1 should not have been deleted"); - $this->assert_false($this->_driver->exists($id2), "$id2 should have been deleted"); - $this->assert_false($this->_driver->exists($id3), "$id3 should have been deleted"); + $this->assert_true($this->_exists($id1), "$id1 should not have been deleted"); + $this->assert_false($this->_exists($id2), "$id2 should have been deleted"); + $this->assert_false($this->_exists($id3), "$id3 should have been deleted"); } public function cache_delete_all_test() { @@ -140,8 +148,8 @@ class Cache_Test extends Gallery_Unit_Test_Case { $data = $this->_driver->delete(true); - $this->assert_false($this->_driver->exists($id1), "$id1 should have been deleted"); - $this->assert_false($this->_driver->exists($id2), "$id2 should have been deleted"); - $this->assert_false($this->_driver->exists($id3), "$id3 should have been deleted"); + $this->assert_false($this->_exists($id1), "$id1 should have been deleted"); + $this->assert_false($this->_exists($id2), "$id2 should have been deleted"); + $this->assert_false($this->_exists($id3), "$id3 should have been deleted"); } } \ No newline at end of file -- cgit v1.2.3 From 8583c1d259e33ab8c85ade70ee521bb21452cff5 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 15 Jan 2011 15:10:27 -0800 Subject: Style fixes. --- modules/user/controllers/admin_users.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/user/controllers/admin_users.php b/modules/user/controllers/admin_users.php index 8dbc4cbb..9ef6f8c1 100644 --- a/modules/user/controllers/admin_users.php +++ b/modules/user/controllers/admin_users.php @@ -46,8 +46,8 @@ class Admin_Users_Controller extends Admin_Controller { // Join our users against the items table so that we can get a count of their items // in the same query. $view->content->users = ORM::factory("user") - ->order_by("users.name", "ASC") - ->find_all($page_size, $view->content->pager->sql_offset); + ->order_by("users.name", "ASC") + ->find_all($page_size, $view->content->pager->sql_offset); $view->content->groups = ORM::factory("group")->order_by("name", "ASC")->find_all(); print $view; -- cgit v1.2.3 From 44da46abd4aa2e210300d1d54c1d6896988fd71b Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 15 Jan 2011 15:11:37 -0800 Subject: Golden file updates for xss and controller authentication. --- modules/gallery/tests/controller_auth_data.txt | 5 +- modules/gallery/tests/xss_data.txt | 106 ++++++++++++++----------- 2 files changed, 62 insertions(+), 49 deletions(-) diff --git a/modules/gallery/tests/controller_auth_data.txt b/modules/gallery/tests/controller_auth_data.txt index 24170092..f1192071 100644 --- a/modules/gallery/tests/controller_auth_data.txt +++ b/modules/gallery/tests/controller_auth_data.txt @@ -22,8 +22,8 @@ modules/gallery/controllers/user_profile.php show modules/gallery/controllers/user_profile.php contact DIRTY_AUTH modules/gallery/controllers/user_profile.php send DIRTY_AUTH modules/gallery/controllers/welcome_message.php index DIRTY_AUTH -modules/organize/controllers/organize.php dialog DIRTY_CSRF -modules/organize/controllers/organize.php add_album_fields DIRTY_AUTH +modules/organize/controllers/organize.php tree DIRTY_CSRF +modules/organize/controllers/organize.php delete DIRTY_AUTH modules/rest/controllers/rest.php index DIRTY_CSRF|DIRTY_AUTH modules/rest/controllers/rest.php reset_api_key_confirm DIRTY_AUTH modules/rest/controllers/rest.php reset_api_key DIRTY_AUTH @@ -35,5 +35,6 @@ modules/server_add/controllers/server_add.php children modules/tag/controllers/admin_tags.php index DIRTY_CSRF modules/tag/controllers/tag.php __call DIRTY_CSRF|DIRTY_AUTH modules/tag/controllers/tags.php autocomplete DIRTY_CSRF|DIRTY_AUTH +modules/user/controllers/admin_users.php index DIRTY_CSRF modules/user/controllers/password.php reset DIRTY_AUTH modules/user/controllers/password.php do_reset DIRTY_CSRF|DIRTY_AUTH diff --git a/modules/gallery/tests/xss_data.txt b/modules/gallery/tests/xss_data.txt index 366391cf..609f786a 100644 --- a/modules/gallery/tests/xss_data.txt +++ b/modules/gallery/tests/xss_data.txt @@ -213,7 +213,7 @@ modules/gallery/views/menu_link.html.php 5 DIRTY_JS $menu- 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") -modules/gallery/views/movieplayer.html.php 14 DIRTY_JS url::abs_file("lib/flowplayer.pseudostreaming.swf") +modules/gallery/views/movieplayer.html.php 17 DIRTY_JS url::abs_file("lib/flowplayer.pseudostreaming.swf") modules/gallery/views/permissions_browse.html.php 3 DIRTY_JS url::site("permissions/form/__ITEM__") modules/gallery/views/permissions_browse.html.php 16 DIRTY_JS url::site("permissions/change/__CMD__/__GROUP__/__PERM__/__ITEM__?csrf=$csrf") modules/gallery/views/permissions_browse.html.php 43 DIRTY_ATTR $parent->id @@ -262,8 +262,8 @@ modules/gallery/views/user_profile.html.php 34 DIRTY_ATTR $use modules/gallery/views/user_profile.html.php 43 DIRTY $info->view modules/image_block/views/image_block_block.html.php 4 DIRTY_JS $item->url() modules/image_block/views/image_block_block.html.php 5 DIRTY $item->thumb_img(array("class"=>"g-thumbnail")) -modules/info/views/info_block.html.php 22 DIRTY gallery::date_time($item->captured) -modules/info/views/info_block.html.php 29 DIRTY_JS $item->owner->url +modules/info/views/info_block.html.php 5 DIRTY $info["label"] +modules/info/views/info_block.html.php 5 DIRTY $info["value"] modules/notification/views/comment_published.html.php 28 DIRTY_JS $comment->item()->abs_url() modules/notification/views/comment_published.html.php 29 DIRTY $comment->item()->abs_url() modules/notification/views/item_added.html.php 16 DIRTY_JS $item->abs_url() @@ -274,22 +274,29 @@ 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 94 DIRTY_JS $domain -modules/organize/views/organize_dialog.html.php 95 DIRTY_JS $access_key -modules/organize/views/organize_dialog.html.php 96 DIRTY_JS request::protocol() -modules/organize/views/organize_dialog.html.php 97 DIRTY_JS $file_filter -modules/organize/views/organize_dialog.html.php 98 DIRTY_JS $sort_order -modules/organize/views/organize_dialog.html.php 99 DIRTY_JS $sort_fields -modules/organize/views/organize_dialog.html.php 100 DIRTY_JS $album->id -modules/organize/views/organize_dialog.html.php 101 DIRTY_JS $selected_id -modules/organize/views/organize_dialog.html.php 102 DIRTY_JS $rest_uri -modules/organize/views/organize_dialog.html.php 103 DIRTY_JS $controller_uri -modules/organize/views/organize_dialog.html.php 109 DIRTY_JS $flash_minimum_version="10.0.0" -modules/organize/views/organize_dialog.html.php 127 DIRTY_JS $swf_uri -modules/organize/views/organize_dialog.html.php 140 DIRTY_ATTR request::protocol() +modules/organize/views/organize_dialog.html.php 8 DIRTY_JS url::site("items/__ID__") +modules/organize/views/organize_dialog.html.php 14 DIRTY_JS $album->title +modules/organize/views/organize_frame.html.php 12 DIRTY_JS url::file("modules/organize/vendor/ext/images/default/s.gif") +modules/organize/views/organize_frame.html.php 56 DIRTY_JS url::site("organize/album_info/__ID__") +modules/organize/views/organize_frame.html.php 94 DIRTY_JS access::csrf_token() +modules/organize/views/organize_frame.html.php 96 DIRTY_JS url::site("organize/set_sort/__ID__") +modules/organize/views/organize_frame.html.php 116 DIRTY_JS url::site("organize/delete") +modules/organize/views/organize_frame.html.php 125 DIRTY_JS access::csrf_token() +modules/organize/views/organize_frame.html.php 226 DIRTY_JS url::site("organize/rearrange") +modules/organize/views/organize_frame.html.php 237 DIRTY_JS access::csrf_token() +modules/organize/views/organize_frame.html.php 275 DIRTY_JS $key +modules/organize/views/organize_frame.html.php 398 DIRTY_JS url::site("organize/tree/{$album->id}") +modules/organize/views/organize_frame.html.php 456 DIRTY_JS url::site("organize/reparent") +modules/organize/views/organize_frame.html.php 479 DIRTY_JS access::csrf_token() +modules/organize/views/organize_frame.html.php 495 DIRTY_JS access::can("edit",item::root()) +modules/organize/views/organize_frame.html.php 497 DIRTY_JS item::root()->title +modules/organize/views/organize_frame.html.php 499 DIRTY_JS item::root()->id +modules/organize/views/organize_frame.html.php 507 DIRTY_JS $album->id +modules/organize/views/organize_frame.html.php 508 DIRTY_JS $album->id 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 +modules/recaptcha/views/form_recaptcha.html.php 3 DIRTY_ATTR request::protocol() +modules/recaptcha/views/form_recaptcha.html.php 8 DIRTY_JS $public_key modules/rest/views/reset_api_key_confirm.html.php 6 DIRTY $form modules/rss/views/feed.mrss.php 10 DIRTY $feed->uri modules/rss/views/feed.mrss.php 13 DIRTY_JS $feed->uri @@ -346,28 +353,31 @@ modules/user/views/admin_users.html.php 73 DIRTY_ATTR $use modules/user/views/admin_users.html.php 74 DIRTY_ATTR $user->avatar_url(20,$theme->url(,true)) modules/user/views/admin_users.html.php 88 DIRTY ($user->last_login==0)?"":gallery::date($user->last_login) modules/user/views/admin_users.html.php 91 DIRTY db::build()->from("items")->where("owner_id","=",$user->id)->count_records() -modules/user/views/admin_users.html.php 127 DIRTY_ATTR $group->id -modules/user/views/admin_users.html.php 127 DIRTY_ATTR ($group->special?"g-default-group":"") -modules/user/views/admin_users.html.php 129 DIRTY $v +modules/user/views/admin_users.html.php 113 DIRTY $pager +modules/user/views/admin_users.html.php 132 DIRTY_ATTR $group->id +modules/user/views/admin_users.html.php 132 DIRTY_ATTR ($group->special?"g-default-group":"") +modules/user/views/admin_users.html.php 134 DIRTY $v modules/user/views/admin_users_delete_user.html.php 6 DIRTY $form modules/user/views/admin_users_group.html.php 24 DIRTY_JS $user->id modules/user/views/admin_users_group.html.php 24 DIRTY_JS $group->id modules/watermark/views/admin_watermarks.html.php 20 DIRTY_ATTR $width modules/watermark/views/admin_watermarks.html.php 20 DIRTY_ATTR $height modules/watermark/views/admin_watermarks.html.php 20 DIRTY_ATTR $url -themes/admin_wind/views/admin.html.php 21 DIRTY_JS $theme->url() -themes/admin_wind/views/admin.html.php 38 DIRTY $theme->admin_head() -themes/admin_wind/views/admin.html.php 42 DIRTY $theme->admin_page_top() -themes/admin_wind/views/admin.html.php 50 DIRTY $theme->admin_header_top() -themes/admin_wind/views/admin.html.php 51 DIRTY_JS item::root()->url() -themes/admin_wind/views/admin.html.php 54 DIRTY $theme->user_menu() -themes/admin_wind/views/admin.html.php 57 DIRTY $theme->admin_menu() -themes/admin_wind/views/admin.html.php 60 DIRTY $theme->admin_header_bottom() -themes/admin_wind/views/admin.html.php 67 DIRTY $content -themes/admin_wind/views/admin.html.php 73 DIRTY $sidebar -themes/admin_wind/views/admin.html.php 78 DIRTY $theme->admin_footer() -themes/admin_wind/views/admin.html.php 81 DIRTY $theme->admin_credits() -themes/admin_wind/views/admin.html.php 86 DIRTY $theme->admin_page_bottom() +themes/admin_wind/views/admin.html.php 31 DIRTY $theme->admin_head() +themes/admin_wind/views/admin.html.php 40 DIRTY_JS $theme->url() +themes/admin_wind/views/admin.html.php 45 DIRTY $theme->get_combined("script") +themes/admin_wind/views/admin.html.php 48 DIRTY $theme->get_combined("css") +themes/admin_wind/views/admin.html.php 52 DIRTY $theme->admin_page_top() +themes/admin_wind/views/admin.html.php 60 DIRTY $theme->admin_header_top() +themes/admin_wind/views/admin.html.php 61 DIRTY_JS item::root()->url() +themes/admin_wind/views/admin.html.php 64 DIRTY $theme->user_menu() +themes/admin_wind/views/admin.html.php 67 DIRTY $theme->admin_menu() +themes/admin_wind/views/admin.html.php 70 DIRTY $theme->admin_header_bottom() +themes/admin_wind/views/admin.html.php 77 DIRTY $content +themes/admin_wind/views/admin.html.php 83 DIRTY $sidebar +themes/admin_wind/views/admin.html.php 88 DIRTY $theme->admin_footer() +themes/admin_wind/views/admin.html.php 91 DIRTY $theme->admin_credits() +themes/admin_wind/views/admin.html.php 96 DIRTY $theme->admin_page_bottom() themes/admin_wind/views/block.html.php 3 DIRTY_ATTR $anchor themes/admin_wind/views/block.html.php 5 DIRTY $id themes/admin_wind/views/block.html.php 5 DIRTY_ATTR $css_id @@ -398,20 +408,22 @@ themes/wind/views/dynamic.html.php 17 DIRTY_ATTR $chi themes/wind/views/dynamic.html.php 29 DIRTY $theme->paginator() themes/wind/views/movie.html.php 5 DIRTY $theme->paginator() themes/wind/views/movie.html.php 9 DIRTY $item->movie_img(array("class"=>"g-movie","id"=>"g-item-id-{$item->id}")) -themes/wind/views/page.html.php 9 DIRTY $page_title -themes/wind/views/page.html.php 12 DIRTY $theme->item()->title -themes/wind/views/page.html.php 16 DIRTY item::root()->title -themes/wind/views/page.html.php 26 DIRTY_JS $theme->url() -themes/wind/views/page.html.php 35 DIRTY $new_width -themes/wind/views/page.html.php 36 DIRTY $new_height -themes/wind/views/page.html.php 37 DIRTY $thumb_proportion -themes/wind/views/page.html.php 74 DIRTY $header_text -themes/wind/views/page.html.php 76 DIRTY_JS item::root()->url() -themes/wind/views/page.html.php 80 DIRTY $theme->user_menu() -themes/wind/views/page.html.php 101 DIRTY_JS $parent->url($parent->id==$theme->item()->parent_id?"show={$theme->item()->id}":null) -themes/wind/views/page.html.php 122 DIRTY $content -themes/wind/views/page.html.php 128 DIRTY newView("sidebar.html") -themes/wind/views/page.html.php 135 DIRTY $footer_text +themes/wind/views/page.html.php 10 DIRTY $page_title +themes/wind/views/page.html.php 13 DIRTY $theme->item()->title +themes/wind/views/page.html.php 17 DIRTY item::root()->title +themes/wind/views/page.html.php 31 DIRTY $new_width +themes/wind/views/page.html.php 32 DIRTY $new_height +themes/wind/views/page.html.php 33 DIRTY $thumb_proportion +themes/wind/views/page.html.php 70 DIRTY_JS $theme->url() +themes/wind/views/page.html.php 75 DIRTY $theme->get_combined("script") +themes/wind/views/page.html.php 78 DIRTY $theme->get_combined("css") +themes/wind/views/page.html.php 88 DIRTY $header_text +themes/wind/views/page.html.php 90 DIRTY_JS item::root()->url() +themes/wind/views/page.html.php 94 DIRTY $theme->user_menu() +themes/wind/views/page.html.php 115 DIRTY_JS $parent->url($parent->id==$theme->item()->parent_id?"show={$theme->item()->id}":null) +themes/wind/views/page.html.php 136 DIRTY $content +themes/wind/views/page.html.php 142 DIRTY newView("sidebar.html") +themes/wind/views/page.html.php 149 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 -- cgit v1.2.3 From 0020f87d6a23ce00200074b678a9293d055e27a3 Mon Sep 17 00:00:00 2001 From: Joe7 Date: Sat, 15 Jan 2011 21:49:22 +0100 Subject: Fixed paging for albums ordered by random. MySql has problems when comparing float values against -seemingly same- float input, see http://dev.mysql.com/doc/refman/5.0/en/problems-with-float.html for details. Fixes #1610 --- installer/install.sql | 4 ++-- modules/gallery/helpers/gallery_installer.php | 9 +++++++-- modules/gallery/module.info | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/installer/install.sql b/installer/install.sql index 0ed7f2f3..07aae36d 100644 --- a/installer/install.sql +++ b/installer/install.sql @@ -160,7 +160,7 @@ CREATE TABLE {items} ( `name` varchar(255) DEFAULT NULL, `owner_id` int(9) DEFAULT NULL, `parent_id` int(9) NOT NULL, - `rand_key` float DEFAULT NULL, + `rand_key` decimal(11,10) DEFAULT NULL, `relative_path_cache` varchar(255) DEFAULT NULL, `relative_url_cache` varchar(255) DEFAULT NULL, `resize_dirty` tinyint(1) DEFAULT '1', @@ -244,7 +244,7 @@ CREATE TABLE {modules} ( KEY `weight` (`weight`) ) AUTO_INCREMENT=10 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -INSERT INTO {modules} VALUES (1,1,'gallery',43,1); +INSERT INTO {modules} VALUES (1,1,'gallery',44,1); INSERT INTO {modules} VALUES (2,1,'user',3,2); INSERT INTO {modules} VALUES (3,1,'comment',3,3); INSERT INTO {modules} VALUES (4,1,'organize',3,4); diff --git a/modules/gallery/helpers/gallery_installer.php b/modules/gallery/helpers/gallery_installer.php index f7b8da5f..3c7b1c84 100644 --- a/modules/gallery/helpers/gallery_installer.php +++ b/modules/gallery/helpers/gallery_installer.php @@ -92,7 +92,7 @@ class gallery_installer { `name` varchar(255) default NULL, `owner_id` int(9) default NULL, `parent_id` int(9) NOT NULL, - `rand_key` float default NULL, + `rand_key` decimal(11,10) default NULL, `relative_path_cache` varchar(255) default NULL, `relative_url_cache` varchar(255) default NULL, `resize_dirty` boolean default 1, @@ -309,7 +309,7 @@ class gallery_installer { module::set_var("gallery", "show_user_profiles_to", "registered_users"); module::set_var("gallery", "extra_binary_paths", "/usr/local/bin:/opt/local/bin:/opt/bin"); - module::set_version("gallery", 43); + module::set_version("gallery", 44); } static function upgrade($version) { @@ -653,6 +653,11 @@ class gallery_installer { $db->query("ALTER TABLE {items} CHANGE `description` `description` text DEFAULT NULL"); module::set_version("gallery", $version = 43); } + + if ($version == 43) { + $db->query("ALTER TABLE {items} CHANGE `rand_key` `rand_key` DECIMAL(11, 10)"); + module::set_version("gallery", $version = 44); + } } static function uninstall() { diff --git a/modules/gallery/module.info b/modules/gallery/module.info index eb579ab6..4c4e63a1 100644 --- a/modules/gallery/module.info +++ b/modules/gallery/module.info @@ -1,3 +1,3 @@ name = "Gallery 3" description = "Gallery core application" -version = 43 +version = 44 -- cgit v1.2.3 From ac44e9c930ec83545b37e1e31381919fbd849d26 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 16 Jan 2011 15:49:34 -0800 Subject: First step in setting up version checking. We now have two types of packages (release, git). Instead of using constants, we now have gallery::version_string() which returns the current version string. If you're on a release package, then the version string looks like: 3.0 (Santa Fe) If you're on a git package, then the version string looks like this: 3.0.1 (branch 3.0.x build 3) We track the build number in a new file in the gallery3 root called BUILD_NUMBER which we will update periodically with the latest build number for each branch. --- BUILD_NUMBER | 1 + modules/gallery/helpers/gallery.php | 25 +++++++++++++++++++++++- modules/gallery/helpers/gallery_theme.php | 2 +- modules/gallery/views/admin_block_stats.html.php | 2 +- 4 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 BUILD_NUMBER diff --git a/BUILD_NUMBER b/BUILD_NUMBER new file mode 100644 index 00000000..d00491fd --- /dev/null +++ b/BUILD_NUMBER @@ -0,0 +1 @@ +1 diff --git a/modules/gallery/helpers/gallery.php b/modules/gallery/helpers/gallery.php index 282289b5..c4a6286c 100644 --- a/modules/gallery/helpers/gallery.php +++ b/modules/gallery/helpers/gallery.php @@ -18,7 +18,10 @@ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ class gallery_Core { - const VERSION = "3.0+ (git)"; + const VERSION = "3.0+"; + const CODE_NAME = ""; + const RELEASE_CHANNEL = "git"; + const RELEASE_BRANCH = "master"; /** * If Gallery is in maintenance mode, then force all non-admins to get routed to a "This site is @@ -184,4 +187,24 @@ class gallery_Core { } putenv("PATH=" . implode(":", $path_env)); } + + /** + * Return a string describing this version of Gallery and the type of release. + */ + static function version_string() { + if (gallery::RELEASE_CHANNEL == "git") { + return sprintf( + "%s (branch %s build %s)", gallery::VERSION, gallery::RELEASE_BRANCH, gallery::build_number()); + } else { + return sprintf("%s (%s)", gallery::VERSION, gallery::CODE_NAME); + } + } + + /** + * Return the contents of the BUILD_NUMBER file, which should be a single integer. + */ + static function build_number() { + $lines = file(DOCROOT . "BUILD_NUMBER", FILE_IGNORE_NEW_LINES); + return $lines[0]; + } } \ No newline at end of file diff --git a/modules/gallery/helpers/gallery_theme.php b/modules/gallery/helpers/gallery_theme.php index ebf8f38e..d75c6fc6 100644 --- a/modules/gallery/helpers/gallery_theme.php +++ b/modules/gallery/helpers/gallery_theme.php @@ -115,7 +115,7 @@ class gallery_theme_Core { static function credits() { $version_string = SafeString::of_safe_html( - 'Gallery ' . gallery::VERSION . ''); + 'Gallery ' . gallery::version_string() . ''); return "
  • " . t(module::get_var("gallery", "credits"), array("url" => "http://gallery.menalto.com", diff --git a/modules/gallery/views/admin_block_stats.html.php b/modules/gallery/views/admin_block_stats.html.php index 1dec8ccd..c8c54765 100644 --- a/modules/gallery/views/admin_block_stats.html.php +++ b/modules/gallery/views/admin_block_stats.html.php @@ -1,7 +1,7 @@
    • - gallery::VERSION)) ?> + gallery::version_string())) ?>
    • $album_count)) ?> -- cgit v1.2.3 From e22c2e64ba9ba18706083710de7b15401fc4c9da Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 16 Jan 2011 16:08:58 -0800 Subject: Arbitrarily set the build number for master to 50 --- BUILD_NUMBER | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BUILD_NUMBER b/BUILD_NUMBER index d00491fd..e373ee69 100644 --- a/BUILD_NUMBER +++ b/BUILD_NUMBER @@ -1 +1 @@ -1 +50 -- cgit v1.2.3 From 684958144817a724b41db9637486b9ced853c020 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 16 Jan 2011 16:01:30 -0800 Subject: Specify that we don't want the BUILD_NUMBER changes that happen in other branches by using a custom merge-keep-ours merge algorithm. --- .gitattributes | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..9122eeb1 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +BUILD_NUMBER merge=merge-keep-ours + -- cgit v1.2.3 From b78b1090184dd863c984e54652935963cc502eb8 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 16 Jan 2011 17:10:30 -0800 Subject: Fix indentation. --- modules/gallery/helpers/gallery.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/gallery/helpers/gallery.php b/modules/gallery/helpers/gallery.php index c4a6286c..31b342db 100644 --- a/modules/gallery/helpers/gallery.php +++ b/modules/gallery/helpers/gallery.php @@ -194,7 +194,8 @@ class gallery_Core { static function version_string() { if (gallery::RELEASE_CHANNEL == "git") { return sprintf( - "%s (branch %s build %s)", gallery::VERSION, gallery::RELEASE_BRANCH, gallery::build_number()); + "%s (branch %s build %s)", gallery::VERSION, gallery::RELEASE_BRANCH, + gallery::build_number()); } else { return sprintf("%s (%s)", gallery::VERSION, gallery::CODE_NAME); } -- cgit v1.2.3 From 84d576606d709dcccef2549fdb926d47494a876c Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 16 Jan 2011 21:46:03 -0800 Subject: Change the value column of the messages table from a varchar(255) to a text. Fixes #1612. --- modules/gallery/helpers/gallery_installer.php | 9 +++++++-- modules/gallery/module.info | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/modules/gallery/helpers/gallery_installer.php b/modules/gallery/helpers/gallery_installer.php index 3c7b1c84..92e5b7b8 100644 --- a/modules/gallery/helpers/gallery_installer.php +++ b/modules/gallery/helpers/gallery_installer.php @@ -136,7 +136,7 @@ class gallery_installer { `id` int(9) NOT NULL auto_increment, `key` varchar(255) default NULL, `severity` varchar(32) default NULL, - `value` varchar(255) default NULL, + `value` text default NULL, PRIMARY KEY (`id`), UNIQUE KEY(`key`)) DEFAULT CHARSET=utf8;"); @@ -309,7 +309,7 @@ class gallery_installer { module::set_var("gallery", "show_user_profiles_to", "registered_users"); module::set_var("gallery", "extra_binary_paths", "/usr/local/bin:/opt/local/bin:/opt/bin"); - module::set_version("gallery", 44); + module::set_version("gallery", 45); } static function upgrade($version) { @@ -658,6 +658,11 @@ class gallery_installer { $db->query("ALTER TABLE {items} CHANGE `rand_key` `rand_key` DECIMAL(11, 10)"); module::set_version("gallery", $version = 44); } + + if ($version == 44) { + $db->query("ALTER TABLE {messages} CHANGE `value` `value` text default NULL"); + module::set_version("gallery", $version = 45); + } } static function uninstall() { diff --git a/modules/gallery/module.info b/modules/gallery/module.info index 4c4e63a1..b79df7be 100644 --- a/modules/gallery/module.info +++ b/modules/gallery/module.info @@ -1,3 +1,3 @@ name = "Gallery 3" description = "Gallery core application" -version = 44 +version = 45 -- cgit v1.2.3 From 70abfb2a20734802c922c0e9917d2a1778aef3f2 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 16 Jan 2011 22:16:09 -0800 Subject: Upgrade checking code is now here, along with a bump of the Gallery module to v46. There's a new block in the admin dashboard which controls whether automatic checking happens, and lets you check immediately. If a newer version is detected, a site status message appears for admins providing upgrade instructions. Automatic checking is not yet implemented (even though the UI claims that it exists). This is all for #1605. --- .../gallery/controllers/admin_upgrade_checker.php | 49 ++++++++++++ modules/gallery/helpers/gallery_block.php | 12 ++- modules/gallery/helpers/gallery_installer.php | 16 +++- modules/gallery/helpers/upgrade_checker.php | 91 ++++++++++++++++++++++ modules/gallery/module.info | 2 +- .../gallery/views/upgrade_checker_block.html.php | 45 +++++++++++ 6 files changed, 212 insertions(+), 3 deletions(-) create mode 100644 modules/gallery/controllers/admin_upgrade_checker.php create mode 100644 modules/gallery/helpers/upgrade_checker.php create mode 100644 modules/gallery/views/upgrade_checker_block.html.php diff --git a/modules/gallery/controllers/admin_upgrade_checker.php b/modules/gallery/controllers/admin_upgrade_checker.php new file mode 100644 index 00000000..4b1467cd --- /dev/null +++ b/modules/gallery/controllers/admin_upgrade_checker.php @@ -0,0 +1,49 @@ +server("HTTP_REFERER")) { + url::redirect($referer); + } else { + url::redirect(item::root()->abs_url()); + } + } + + function set_auto($val) { + access::verify_csrf(); + module::set_var("gallery", "upgrade_checker_auto_enabled", (bool)$val); + + if ((bool)$val) { + message::success(t("Automatic upgrade checking is enabled.")); + } else { + message::success(t("Automatic upgrade checking is disabled.")); + } + url::redirect("admin/dashboard"); + } +} diff --git a/modules/gallery/helpers/gallery_block.php b/modules/gallery/helpers/gallery_block.php index 1d92d66d..2189a710 100644 --- a/modules/gallery/helpers/gallery_block.php +++ b/modules/gallery/helpers/gallery_block.php @@ -25,7 +25,9 @@ class gallery_block_Core { "log_entries" => t("Log entries"), "stats" => t("Gallery stats"), "platform_info" => t("Platform information"), - "project_news" => t("Gallery project news")); + "project_news" => t("Gallery project news"), + "upgrade_checker" => t("Check for Gallery upgrades") + ); } static function get_site_list() { @@ -101,6 +103,14 @@ class gallery_block_Core { $block = ""; } break; + + case "upgrade_checker": + $block = new Block(); + $block->css_id = "g-upgrade-available-block"; + $block->title = t("Check for Gallery upgrades"); + $block->content = new View("upgrade_checker_block.html"); + $block->content->version_info = upgrade_checker::version_info(); + $block->content->auto_check_enabled = upgrade_checker::auto_check_enabled(); } return $block; } diff --git a/modules/gallery/helpers/gallery_installer.php b/modules/gallery/helpers/gallery_installer.php index 92e5b7b8..1ffe9bae 100644 --- a/modules/gallery/helpers/gallery_installer.php +++ b/modules/gallery/helpers/gallery_installer.php @@ -259,6 +259,7 @@ class gallery_installer { module::set_var("gallery", "default_locale", "en_US"); module::set_var("gallery", "image_quality", 75); module::set_var("gallery", "image_sharpen", 15); + module::set_var("gallery", "upgrade_checker_auto_enabled", true); // Add rules for generating our thumbnails and resizes graphics::add_rule( @@ -285,6 +286,7 @@ class gallery_installer { block_manager::add("dashboard_sidebar", "gallery", "platform_info"); block_manager::add("dashboard_sidebar", "gallery", "project_news"); block_manager::add("dashboard_center", "gallery", "welcome"); + block_manager::add("dashboard_center", "gallery", "upgrade_checker"); block_manager::add("dashboard_center", "gallery", "photo_stream"); block_manager::add("dashboard_center", "gallery", "log_entries"); @@ -309,7 +311,7 @@ class gallery_installer { module::set_var("gallery", "show_user_profiles_to", "registered_users"); module::set_var("gallery", "extra_binary_paths", "/usr/local/bin:/opt/local/bin:/opt/bin"); - module::set_version("gallery", 45); + module::set_version("gallery", 46); } static function upgrade($version) { @@ -663,6 +665,18 @@ class gallery_installer { $db->query("ALTER TABLE {messages} CHANGE `value` `value` text default NULL"); module::set_version("gallery", $version = 45); } + + if ($version == 45) { + // Splice the upgrade_checker block into the admin dashboard at the top + // of the page, but under the welcome block if it's in the first position. + $blocks = block_manager::get_active("dashboard_center"); + $index = count($blocks) && current($blocks) == array("gallery", "welcome") ? 1 : 0; + array_splice($blocks, $index, 0, array(random::int() => array("gallery", "upgrade_checker"))); + block_manager::set_active("dashboard_center", $blocks); + + module::set_var("gallery", "upgrade_checker_auto_enabled", true); + module::set_version("gallery", $version = 46); + } } static function uninstall() { diff --git a/modules/gallery/helpers/upgrade_checker.php b/modules/gallery/helpers/upgrade_checker.php new file mode 100644 index 00000000..9311cf4a --- /dev/null +++ b/modules/gallery/helpers/upgrade_checker.php @@ -0,0 +1,91 @@ +get("upgrade_checker_version_info")); + } + + static function auto_check_enabled() { + return (bool)module::get_var("gallery", "upgrade_checker_auto_enabled"); + } + + static function fetch_version_info() { + $result = new stdClass(); + try { + list ($status, $headers, $body) = remote::do_request(upgrade_checker::CHECK_URL); + if ($status == "HTTP/1.1 200 OK") { + $result->status = "success"; + foreach (explode("\n", $body) as $line) { + if ($line) { + list($key, $val) = explode("=", $line, 2); + $result->data[$key] = $val; + } + } + } else { + $result->status = "error"; + } + } catch (Exception $e) { + Kohana_Log::add("error", + sprintf("%s in %s at line %s:\n%s", $e->getMessage(), $e->getFile(), + $e->getLine(), $e->getTraceAsString())); + } + $result->timestamp = time(); + Cache::instance()->set("upgrade_checker_version_info", serialize($result), null, 86400 * 365); + } + + static function check_for_upgrade() { + $version_info = upgrade_checker::version_info(); + $upgrade_available = false; + if ($version_info) { + if (gallery::RELEASE_CHANNEL == "release") { + if (version_compare($version_info->data["release_version"], gallery::VERSION, ">")) { + site_status::warning( + t("A newer version of Gallery is available! Upgrade now to version %version or wait until later.", + array("version" => $version_info->data["release_version"], + "upgrade-url" => $version_info->data["release_upgrade_url"], + "hide-url" => url::site("admin/upgrade_checker/remind_me_later?csrf=__CSRF__"))), + "upgrade_checker"); + $upgrade_available = true; + } + } else { + $branch = gallery::RELEASE_BRANCH; + if (isset($version_info->data["{$branch}_build_number"]) && + version_compare($version_info->data["{$branch}_build_number"], + gallery::build_number(), ">")) { + site_status::warning( + t("A newer version of Gallery is available! Upgrade now to version %version (build %build on branch %branch) or wait until later.", + array("version" => $version_info->data["{$branch}_version"], + "upgrade-url" => $version_info->data["{$branch}_upgrade_url"], + "build" => $version_info->data["{$branch}_build_number"], + "branch" => $branch, + "hide-url" => url::site("admin/upgrade_checker/remind_me_later?csrf=__CSRF__"))), + "upgrade_checker"); + $upgrade_available = true; + } + } + } + + if (!$upgrade_available) { + site_status::clear("upgrade_checker"); + } + } +} diff --git a/modules/gallery/module.info b/modules/gallery/module.info index b79df7be..4c0c8866 100644 --- a/modules/gallery/module.info +++ b/modules/gallery/module.info @@ -1,3 +1,3 @@ name = "Gallery 3" description = "Gallery core application" -version = 45 +version = 46 diff --git a/modules/gallery/views/upgrade_checker_block.html.php b/modules/gallery/views/upgrade_checker_block.html.php new file mode 100644 index 00000000..30e18305 --- /dev/null +++ b/modules/gallery/views/upgrade_checker_block.html.php @@ -0,0 +1,45 @@ + +

      + +

      + +

      + + %code_name.", array("version" => gallery::VERSION, "code_name" => gallery::CODE_NAME)) ?> + + gallery::VERSION, "branch" => gallery::RELEASE_BRANCH, "build_number" => gallery::build_number())) ?> + +

      + +

      + "> + + + + "> + + + + "> + + + +

      + +

      + + + + + + + + + gallery::date_time($version_info->timestamp))) ?> + +

      + -- cgit v1.2.3 From 167f635a6ce5a71b35450844f9b5c647aa14bcc1 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 16 Jan 2011 23:06:19 -0800 Subject: Add arguments to random::int() to match mt_rand(). Follow on to cd48b89f3166e7fa732b5cb06d33fba018af9127 for #1527. --- modules/gallery/helpers/random.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/gallery/helpers/random.php b/modules/gallery/helpers/random.php index a26762bd..dfc7558c 100644 --- a/modules/gallery/helpers/random.php +++ b/modules/gallery/helpers/random.php @@ -42,9 +42,13 @@ class random_Core { } /** - * Return a random number between 0 and mt_getrandmax() + * Return a random number between $min and $max. If $min and $max are not specified, + * return a random number between 0 and mt_getrandmax() */ - static function int() { + static function int($min=null, $max=null) { + if ($min || $max) { + return mt_rand($min, $max); + } return mt_rand(); } } \ No newline at end of file -- cgit v1.2.3 From 66bb496b6c2ad9c5341644b2e303e694078374d1 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 16 Jan 2011 23:14:57 -0800 Subject: If the logged in user is an admin and it's been more than 7 days since the last check and auto upgrade checking is enabled, fire off an XHR to check for a possible upgrade. Finishes off #1605. --- modules/gallery/helpers/gallery_installer.php | 3 +++ modules/gallery/helpers/gallery_theme.php | 20 ++++++++++++++++++-- modules/gallery/helpers/upgrade_checker.php | 25 +++++++++++++++++++++++++ 3 files changed, 46 insertions(+), 2 deletions(-) diff --git a/modules/gallery/helpers/gallery_installer.php b/modules/gallery/helpers/gallery_installer.php index 1ffe9bae..41ed1c6e 100644 --- a/modules/gallery/helpers/gallery_installer.php +++ b/modules/gallery/helpers/gallery_installer.php @@ -677,6 +677,9 @@ class gallery_installer { module::set_var("gallery", "upgrade_checker_auto_enabled", true); module::set_version("gallery", $version = 46); } + + // Clear any upgrade check strings, we are probably up to date. + site_status::clear("upgrade_check"); } static function uninstall() { diff --git a/modules/gallery/helpers/gallery_theme.php b/modules/gallery/helpers/gallery_theme.php index d75c6fc6..a6ca5eb7 100644 --- a/modules/gallery/helpers/gallery_theme.php +++ b/modules/gallery/helpers/gallery_theme.php @@ -76,13 +76,22 @@ class gallery_theme_Core { $profiler = new Profiler(); $profiler->render(); } + $content = ""; if ($session->get("l10n_mode", false)) { - return L10n_Client_Controller::l10n_form(); + $content .= L10n_Client_Controller::l10n_form(); } if ($session->get_once("after_install")) { - return new View("welcome_message_loader.html"); + $content .= new View("welcome_message_loader.html"); } + + if (identity::active_user()->admin && upgrade_checker::should_auto_check()) { + $content .= ''; + } + return $content; } static function admin_page_bottom($theme) { @@ -107,6 +116,13 @@ class gallery_theme_Core { setInterval("adminReauthCheck();", 60 * 1000); '; + if (upgrade_checker::should_auto_check()) { + $content .= ''; + } + if ($session->get("l10n_mode", false)) { $content .= "\n" . L10n_Client_Controller::l10n_form(); } diff --git a/modules/gallery/helpers/upgrade_checker.php b/modules/gallery/helpers/upgrade_checker.php index 9311cf4a..ef1308d7 100644 --- a/modules/gallery/helpers/upgrade_checker.php +++ b/modules/gallery/helpers/upgrade_checker.php @@ -19,15 +19,37 @@ */ class upgrade_checker_Core { const CHECK_URL = "http://gallery.menalto.com/versioncheck/gallery3"; + const AUTO_CHECK_INTERVAL = 604800; // 7 days in seconds + /** + * Return the last version info blob retrieved from the Gallery website or + * null if no checks have been performed. + */ static function version_info() { return unserialize(Cache::instance()->get("upgrade_checker_version_info")); } + /** + * Return true if auto checking is enabled. + */ static function auto_check_enabled() { return (bool)module::get_var("gallery", "upgrade_checker_auto_enabled"); } + /** + * Return true if it's time to auto check. + */ + static function should_auto_check() { + if (upgrade_checker::auto_check_enabled() && random::int(1, 100) == 1) { + $version_info = upgrade_checker::version_info(); + return (!$version_info || (time() - $version_info->timestamp) > AUTO_CHECK_INTERVAL); + } + return false; + } + + /** + * Fech version info from the Gallery website. + */ static function fetch_version_info() { $result = new stdClass(); try { @@ -52,6 +74,9 @@ class upgrade_checker_Core { Cache::instance()->set("upgrade_checker_version_info", serialize($result), null, 86400 * 365); } + /** + * Check the latest version info blob to see if it's time for an upgrade. + */ static function check_for_upgrade() { $version_info = upgrade_checker::version_info(); $upgrade_available = false; -- cgit v1.2.3 From fdb1127d7c46013c918678f6466cf3081cca481f Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 17 Jan 2011 12:51:36 -0800 Subject: Cosmetic improvements to the README --- README | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README b/README index 50a2475d..11256921 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -Gallery 3.0 (code name "Santa Fe") +Gallery 3.0+ (development version) ABOUT: Gallery 3 is a web based software product that lets you manage your @@ -33,6 +33,9 @@ SUPPORTED CONFIGURATION: filter, and json must be installed). - Database: MySQL 5 and newer. +For complete system requirements, please refer to: + http://codex.gallery2.org/Gallery3:Requirements + INSTALLING AND UPGRADING INSTRUCTIONS: For comprehensive instructions, The online User Guide is your best resource: @@ -61,8 +64,7 @@ INSTALLATION FROM THE COMMAND LINE: BUGS? Go to http://apps.sourceforge.net/trac/gallery/ click the "login" link and log in with your SourceForge username and password, then click the -"new ticket" button. Mark any issues you find with the "3.1" -milestone and we'll try to get 'em done for the next release. +"new ticket" button. QUESTIONS, PROBLEMS: -- cgit v1.2.3 From 33c21406ebab0c481cfbcf0e5564dd67626f6ae0 Mon Sep 17 00:00:00 2001 From: Automatic Build Number Updater Date: Mon, 17 Jan 2011 14:22:20 -0700 Subject: Updating BUILD_NUMBER to 51 for branch master Last update: e22c2e64ba9ba18706083710de7b15401fc4c9da (8 commits ago) --- BUILD_NUMBER | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BUILD_NUMBER b/BUILD_NUMBER index e373ee69..82cced27 100644 --- a/BUILD_NUMBER +++ b/BUILD_NUMBER @@ -1 +1 @@ -50 +51 -- cgit v1.2.3 From 14ae5d854400d632b63a331f541f180b8d1f3ea1 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 17 Jan 2011 17:07:32 -0800 Subject: Update version checking code to expect "branch_" as the prefix for all branch related lines. For #1605. --- modules/gallery/helpers/upgrade_checker.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/gallery/helpers/upgrade_checker.php b/modules/gallery/helpers/upgrade_checker.php index ef1308d7..0e72bb94 100644 --- a/modules/gallery/helpers/upgrade_checker.php +++ b/modules/gallery/helpers/upgrade_checker.php @@ -93,14 +93,14 @@ class upgrade_checker_Core { } } else { $branch = gallery::RELEASE_BRANCH; - if (isset($version_info->data["{$branch}_build_number"]) && - version_compare($version_info->data["{$branch}_build_number"], + if (isset($version_info->data["branch_{$branch}_build_number"]) && + version_compare($version_info->data["branch_{$branch}_build_number"], gallery::build_number(), ">")) { site_status::warning( t("A newer version of Gallery is available! Upgrade now to version %version (build %build on branch %branch) or wait until later.", - array("version" => $version_info->data["{$branch}_version"], - "upgrade-url" => $version_info->data["{$branch}_upgrade_url"], - "build" => $version_info->data["{$branch}_build_number"], + array("version" => $version_info->data["branch_{$branch}_version"], + "upgrade-url" => $version_info->data["branch_{$branch}_upgrade_url"], + "build" => $version_info->data["branch_{$branch}_build_number"], "branch" => $branch, "hide-url" => url::site("admin/upgrade_checker/remind_me_later?csrf=__CSRF__"))), "upgrade_checker"); -- cgit v1.2.3 From c1c67ecf8df8084ed0381b1fcbfa749500af5840 Mon Sep 17 00:00:00 2001 From: Automatic Build Number Updater Date: Mon, 17 Jan 2011 18:12:15 -0700 Subject: Updating BUILD_NUMBER to 52 for branch master Last update: e22c2e64ba9ba18706083710de7b15401fc4c9da (10 commits ago) --- BUILD_NUMBER | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BUILD_NUMBER b/BUILD_NUMBER index 82cced27..0691f67b 100644 --- a/BUILD_NUMBER +++ b/BUILD_NUMBER @@ -1 +1 @@ -51 +52 -- cgit v1.2.3 From 29be21bb0deaf70558b1aa02a115e67daefea0bd Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 17 Jan 2011 17:27:16 -0800 Subject: Add BUILD_NUMBER to the security check in .htaccess Change BUILD_NUMBER to be .ini format and add a big "do not edit" comment. --- .htaccess | 2 +- BUILD_NUMBER | 7 ++++++- modules/gallery/helpers/gallery.php | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.htaccess b/.htaccess index 5a329520..771a8df0 100644 --- a/.htaccess +++ b/.htaccess @@ -29,7 +29,7 @@ # in your Apache2 config file before you uncomment this block or # you'll get an "Internal Server Error". # -# +# # Order deny,allow # Deny from all # diff --git a/BUILD_NUMBER b/BUILD_NUMBER index 0691f67b..d32d51e9 100644 --- a/BUILD_NUMBER +++ b/BUILD_NUMBER @@ -1 +1,6 @@ -52 +; This file keeps track of the build number for the "master" +; branch of gallery3. It's kept up to date by an automated +; process. You don't need to edit it. In fact.. +; +; DO NOT EDIT THIS FILE BY HAND! +build_number=52 diff --git a/modules/gallery/helpers/gallery.php b/modules/gallery/helpers/gallery.php index 31b342db..7a60f56a 100644 --- a/modules/gallery/helpers/gallery.php +++ b/modules/gallery/helpers/gallery.php @@ -205,7 +205,7 @@ class gallery_Core { * Return the contents of the BUILD_NUMBER file, which should be a single integer. */ static function build_number() { - $lines = file(DOCROOT . "BUILD_NUMBER", FILE_IGNORE_NEW_LINES); - return $lines[0]; + $result = parse_ini_file(DOCROOT . "BUILD_NUMBER"); + return $result["build_number"]; } } \ No newline at end of file -- cgit v1.2.3 From 76411d7d6d481bc2ab51e24ec2dbf003f43ce40b Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 17 Jan 2011 17:33:10 -0800 Subject: Rename BUILD_NUMBER to .build_number so it's not so loud. --- .build_number | 6 ++++++ .gitattributes | 2 +- BUILD_NUMBER | 6 ------ modules/gallery/helpers/gallery.php | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) create mode 100644 .build_number delete mode 100644 BUILD_NUMBER diff --git a/.build_number b/.build_number new file mode 100644 index 00000000..d32d51e9 --- /dev/null +++ b/.build_number @@ -0,0 +1,6 @@ +; This file keeps track of the build number for the "master" +; branch of gallery3. It's kept up to date by an automated +; process. You don't need to edit it. In fact.. +; +; DO NOT EDIT THIS FILE BY HAND! +build_number=52 diff --git a/.gitattributes b/.gitattributes index 9122eeb1..fdf9d072 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,2 @@ -BUILD_NUMBER merge=merge-keep-ours +.build_number merge=merge-keep-ours diff --git a/BUILD_NUMBER b/BUILD_NUMBER deleted file mode 100644 index d32d51e9..00000000 --- a/BUILD_NUMBER +++ /dev/null @@ -1,6 +0,0 @@ -; This file keeps track of the build number for the "master" -; branch of gallery3. It's kept up to date by an automated -; process. You don't need to edit it. In fact.. -; -; DO NOT EDIT THIS FILE BY HAND! -build_number=52 diff --git a/modules/gallery/helpers/gallery.php b/modules/gallery/helpers/gallery.php index 7a60f56a..ad9f40e8 100644 --- a/modules/gallery/helpers/gallery.php +++ b/modules/gallery/helpers/gallery.php @@ -202,10 +202,10 @@ class gallery_Core { } /** - * Return the contents of the BUILD_NUMBER file, which should be a single integer. + * Return the contents of the .build_number file, which should be a single integer. */ static function build_number() { - $result = parse_ini_file(DOCROOT . "BUILD_NUMBER"); + $result = parse_ini_file(DOCROOT . ".build_number"); return $result["build_number"]; } } \ No newline at end of file -- cgit v1.2.3 From c46d5f3da9dafb55045d9535ec5f9e09b9926c1a Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 17 Jan 2011 17:35:57 -0800 Subject: Rename BUILD_NUMBER->.build_number --- .htaccess | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.htaccess b/.htaccess index 771a8df0..d255efaa 100644 --- a/.htaccess +++ b/.htaccess @@ -29,7 +29,7 @@ # in your Apache2 config file before you uncomment this block or # you'll get an "Internal Server Error". # -# +# # Order deny,allow # Deny from all # -- cgit v1.2.3 From d5e7e1d52199221ad7d37aa5212cc960e8818778 Mon Sep 17 00:00:00 2001 From: Automatic Build Number Updater Date: Mon, 17 Jan 2011 19:05:33 -0700 Subject: Automated update of .build_number to 53 for branch master Last update: 29be21bb0deaf70558b1aa02a115e67daefea0bd (2 commits ago) --- .build_number | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.build_number b/.build_number index d32d51e9..e69de29b 100644 --- a/.build_number +++ b/.build_number @@ -1,6 +0,0 @@ -; This file keeps track of the build number for the "master" -; branch of gallery3. It's kept up to date by an automated -; process. You don't need to edit it. In fact.. -; -; DO NOT EDIT THIS FILE BY HAND! -build_number=52 -- cgit v1.2.3 From 548627a9fd55cb6a2b3ece8ba261cbee7d721231 Mon Sep 17 00:00:00 2001 From: Automatic Build Number Updater Date: Mon, 17 Jan 2011 19:17:36 -0800 Subject: Revert "Automated update of .build_number to 53 for branch master" the automated script got it wrong. This reverts commit d5e7e1d52199221ad7d37aa5212cc960e8818778. --- .build_number | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.build_number b/.build_number index e69de29b..d32d51e9 100644 --- a/.build_number +++ b/.build_number @@ -0,0 +1,6 @@ +; This file keeps track of the build number for the "master" +; branch of gallery3. It's kept up to date by an automated +; process. You don't need to edit it. In fact.. +; +; DO NOT EDIT THIS FILE BY HAND! +build_number=52 -- cgit v1.2.3 From 2b190c055922bbf37620bc104a6e06f3dd6f2b82 Mon Sep 17 00:00:00 2001 From: Automatic Build Number Updater Date: Mon, 17 Jan 2011 20:22:37 -0700 Subject: Automated update of .build_number to 53 for branch master Last update: 548627a9fd55cb6a2b3ece8ba261cbee7d721231 (0 commits ago) --- .build_number | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.build_number b/.build_number index d32d51e9..4b765ae6 100644 --- a/.build_number +++ b/.build_number @@ -3,4 +3,4 @@ ; process. You don't need to edit it. In fact.. ; ; DO NOT EDIT THIS FILE BY HAND! -build_number=52 +build_number=53 -- cgit v1.2.3 From 45caba09f81e53dfa4264bc74c4e6ed7935bd5f9 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 17 Jan 2011 20:03:11 -0800 Subject: Move the code that clears the upgrade_check site status message to the upgrader so that it's cleared any time we run an upgrade. Part of --- modules/gallery/controllers/upgrader.php | 3 +++ modules/gallery/helpers/gallery_installer.php | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/gallery/controllers/upgrader.php b/modules/gallery/controllers/upgrader.php index 66c71648..0932090f 100644 --- a/modules/gallery/controllers/upgrader.php +++ b/modules/gallery/controllers/upgrader.php @@ -94,6 +94,9 @@ class Upgrader_Controller extends Controller { // If the upgrade failed, this will get recreated site_status::clear("upgrade_now"); + // Clear any upgrade check strings, we are probably up to date. + site_status::clear("upgrade_check"); + if (php_sapi_name() == "cli") { if ($failed) { print "Upgrade completed ** WITH FAILURES **\n"; diff --git a/modules/gallery/helpers/gallery_installer.php b/modules/gallery/helpers/gallery_installer.php index 41ed1c6e..1ffe9bae 100644 --- a/modules/gallery/helpers/gallery_installer.php +++ b/modules/gallery/helpers/gallery_installer.php @@ -677,9 +677,6 @@ class gallery_installer { module::set_var("gallery", "upgrade_checker_auto_enabled", true); module::set_version("gallery", $version = 46); } - - // Clear any upgrade check strings, we are probably up to date. - site_status::clear("upgrade_check"); } static function uninstall() { -- cgit v1.2.3 From f985adad586cd4140afdadc88eda519cce7b79da Mon Sep 17 00:00:00 2001 From: Automatic Build Number Updater Date: Mon, 17 Jan 2011 21:04:41 -0700 Subject: Automated update of .build_number to 54 for branch master Last update: 2b190c055922bbf37620bc104a6e06f3dd6f2b82 (1 commits ago) --- .build_number | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.build_number b/.build_number index 4b765ae6..b801e8cd 100644 --- a/.build_number +++ b/.build_number @@ -3,4 +3,4 @@ ; process. You don't need to edit it. In fact.. ; ; DO NOT EDIT THIS FILE BY HAND! -build_number=53 +build_number=54 -- cgit v1.2.3 From df703fbd5cf8f3c5152cd6448dd0e08b3e48ea93 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 17 Jan 2011 20:06:54 -0800 Subject: Update installer for #1612 and #1605. --- installer/install.sql | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/installer/install.sql b/installer/install.sql index 07aae36d..1d2e6720 100644 --- a/installer/install.sql +++ b/installer/install.sql @@ -225,7 +225,7 @@ CREATE TABLE {messages} ( `id` int(9) NOT NULL AUTO_INCREMENT, `key` varchar(255) DEFAULT NULL, `severity` varchar(32) DEFAULT NULL, - `value` varchar(255) DEFAULT NULL, + `value` text, PRIMARY KEY (`id`), UNIQUE KEY `key` (`key`) ) DEFAULT CHARSET=utf8; @@ -244,7 +244,7 @@ CREATE TABLE {modules} ( KEY `weight` (`weight`) ) AUTO_INCREMENT=10 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -INSERT INTO {modules} VALUES (1,1,'gallery',44,1); +INSERT INTO {modules} VALUES (1,1,'gallery',46,1); INSERT INTO {modules} VALUES (2,1,'user',3,2); INSERT INTO {modules} VALUES (3,1,'comment',3,3); INSERT INTO {modules} VALUES (4,1,'organize',3,4); @@ -382,7 +382,7 @@ CREATE TABLE {vars} ( `value` text, PRIMARY KEY (`id`), UNIQUE KEY `module_name` (`module_name`,`name`) -) AUTO_INCREMENT=39 DEFAULT CHARSET=utf8; +) AUTO_INCREMENT=40 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO {vars} VALUES (NULL,'gallery','active_site_theme','wind'); INSERT INTO {vars} VALUES (NULL,'gallery','active_admin_theme','admin_wind'); @@ -392,8 +392,9 @@ INSERT INTO {vars} VALUES (NULL,'gallery','resize_size','640'); INSERT INTO {vars} VALUES (NULL,'gallery','default_locale','en_US'); INSERT INTO {vars} VALUES (NULL,'gallery','image_quality','75'); INSERT INTO {vars} VALUES (NULL,'gallery','image_sharpen','15'); +INSERT INTO {vars} VALUES (NULL,'gallery','upgrade_checker_auto_enabled','1'); INSERT INTO {vars} VALUES (NULL,'gallery','blocks_dashboard_sidebar','a:4:{i:2;a:2:{i:0;s:7:\"gallery\";i:1;s:11:\"block_adder\";}i:3;a:2:{i:0;s:7:\"gallery\";i:1;s:5:\"stats\";}i:4;a:2:{i:0;s:7:\"gallery\";i:1;s:13:\"platform_info\";}i:5;a:2:{i:0;s:7:\"gallery\";i:1;s:12:\"project_news\";}}'); -INSERT INTO {vars} VALUES (NULL,'gallery','blocks_dashboard_center','a:3:{i:6;a:2:{i:0;s:7:\"gallery\";i:1;s:7:\"welcome\";}i:7;a:2:{i:0;s:7:\"gallery\";i:1;s:12:\"photo_stream\";}i:8;a:2:{i:0;s:7:\"gallery\";i:1;s:11:\"log_entries\";}}'); +INSERT INTO {vars} VALUES (NULL,'gallery','blocks_dashboard_center','a:4:{i:6;a:2:{i:0;s:7:\"gallery\";i:1;s:7:\"welcome\";}i:7;a:2:{i:0;s:7:\"gallery\";i:1;s:15:\"upgrade_checker\";}i:8;a:2:{i:0;s:7:\"gallery\";i:1;s:12:\"photo_stream\";}i:9;a:2:{i:0;s:7:\"gallery\";i:1;s:11:\"log_entries\";}}'); INSERT INTO {vars} VALUES (NULL,'gallery','choose_default_tookit','1'); INSERT INTO {vars} VALUES (NULL,'gallery','date_format','Y-M-d'); INSERT INTO {vars} VALUES (NULL,'gallery','date_time_format','Y-M-d H:i:s'); @@ -411,7 +412,7 @@ INSERT INTO {vars} VALUES (NULL,'gallery','email_line_length','70'); INSERT INTO {vars} VALUES (NULL,'gallery','email_header_separator','s:1:\"\n\";'); INSERT INTO {vars} VALUES (NULL,'gallery','show_user_profiles_to','registered_users'); INSERT INTO {vars} VALUES (NULL,'gallery','extra_binary_paths','/usr/local/bin:/opt/local/bin:/opt/bin'); -INSERT INTO {vars} VALUES (NULL,'gallery','blocks_site_sidebar','a:4:{i:9;a:2:{i:0;s:7:\"gallery\";i:1;s:8:\"language\";}i:10;a:2:{i:0;s:4:\"info\";i:1;s:8:\"metadata\";}i:11;a:2:{i:0;s:3:\"rss\";i:1;s:9:\"rss_feeds\";}i:12;a:2:{i:0;s:3:\"tag\";i:1;s:3:\"tag\";}}'); +INSERT INTO {vars} VALUES (NULL,'gallery','blocks_site_sidebar','a:4:{i:10;a:2:{i:0;s:7:\"gallery\";i:1;s:8:\"language\";}i:11;a:2:{i:0;s:4:\"info\";i:1;s:8:\"metadata\";}i:12;a:2:{i:0;s:3:\"rss\";i:1;s:9:\"rss_feeds\";}i:13;a:2:{i:0;s:3:\"tag\";i:1;s:3:\"tag\";}}'); INSERT INTO {vars} VALUES (NULL,'gallery','identity_provider','user'); INSERT INTO {vars} VALUES (NULL,'user','mininum_password_length','5'); INSERT INTO {vars} VALUES (NULL,'comment','spam_caught','0'); -- cgit v1.2.3 From 0dfd7eb614a8b9b4db5b79742b25f5ff20db9534 Mon Sep 17 00:00:00 2001 From: Automatic Build Number Updater Date: Mon, 17 Jan 2011 21:07:57 -0700 Subject: Automated update of .build_number to 55 for branch master Last update: f985adad586cd4140afdadc88eda519cce7b79da (1 commits ago) --- .build_number | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.build_number b/.build_number index b801e8cd..0a18d910 100644 --- a/.build_number +++ b/.build_number @@ -3,4 +3,4 @@ ; process. You don't need to edit it. In fact.. ; ; DO NOT EDIT THIS FILE BY HAND! -build_number=54 +build_number=55 -- cgit v1.2.3 From 20ae106c22b9528d34fb85d09a7ab542e6c6c880 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 17 Jan 2011 21:15:33 -0800 Subject: Display a message in the "Check for Gallery upgrades" block when there's a newer version available, even if the user has dismissed the site status message. #1605. --- .../gallery/controllers/admin_upgrade_checker.php | 9 ++++++- modules/gallery/helpers/gallery_block.php | 1 + modules/gallery/helpers/upgrade_checker.php | 31 +++++++--------------- .../gallery/views/upgrade_checker_block.html.php | 8 ++++++ themes/admin_wind/css/screen.css | 2 +- 5 files changed, 27 insertions(+), 24 deletions(-) diff --git a/modules/gallery/controllers/admin_upgrade_checker.php b/modules/gallery/controllers/admin_upgrade_checker.php index 4b1467cd..456a982c 100644 --- a/modules/gallery/controllers/admin_upgrade_checker.php +++ b/modules/gallery/controllers/admin_upgrade_checker.php @@ -21,7 +21,14 @@ class Admin_Upgrade_Checker_Controller extends Admin_Controller { function check_now() { access::verify_csrf(); upgrade_checker::fetch_version_info(); - upgrade_checker::check_for_upgrade(); + $message = upgrade_checker::get_upgrade_message(); + if ($message) { + $message .= " [x]"; + site_status::info($message, "upgrade_checker"); + } else { + site_status::clear("upgrade_checker"); + } url::redirect("admin/dashboard"); } diff --git a/modules/gallery/helpers/gallery_block.php b/modules/gallery/helpers/gallery_block.php index 2189a710..fed786cc 100644 --- a/modules/gallery/helpers/gallery_block.php +++ b/modules/gallery/helpers/gallery_block.php @@ -111,6 +111,7 @@ class gallery_block_Core { $block->content = new View("upgrade_checker_block.html"); $block->content->version_info = upgrade_checker::version_info(); $block->content->auto_check_enabled = upgrade_checker::auto_check_enabled(); + $block->content->new_version = upgrade_checker::get_upgrade_message(); } return $block; } diff --git a/modules/gallery/helpers/upgrade_checker.php b/modules/gallery/helpers/upgrade_checker.php index 0e72bb94..f92203c8 100644 --- a/modules/gallery/helpers/upgrade_checker.php +++ b/modules/gallery/helpers/upgrade_checker.php @@ -77,40 +77,27 @@ class upgrade_checker_Core { /** * Check the latest version info blob to see if it's time for an upgrade. */ - static function check_for_upgrade() { + static function get_upgrade_message() { $version_info = upgrade_checker::version_info(); - $upgrade_available = false; if ($version_info) { if (gallery::RELEASE_CHANNEL == "release") { if (version_compare($version_info->data["release_version"], gallery::VERSION, ">")) { - site_status::warning( - t("A newer version of Gallery is available! Upgrade now to version %version or wait until later.", - array("version" => $version_info->data["release_version"], - "upgrade-url" => $version_info->data["release_upgrade_url"], - "hide-url" => url::site("admin/upgrade_checker/remind_me_later?csrf=__CSRF__"))), - "upgrade_checker"); - $upgrade_available = true; + return t("A newer version of Gallery is available! Upgrade now to version %version", + array("version" => $version_info->data["release_version"], + "upgrade-url" => $version_info->data["release_upgrade_url"])); } } else { $branch = gallery::RELEASE_BRANCH; if (isset($version_info->data["branch_{$branch}_build_number"]) && version_compare($version_info->data["branch_{$branch}_build_number"], gallery::build_number(), ">")) { - site_status::warning( - t("A newer version of Gallery is available! Upgrade now to version %version (build %build on branch %branch) or wait until later.", - array("version" => $version_info->data["branch_{$branch}_version"], - "upgrade-url" => $version_info->data["branch_{$branch}_upgrade_url"], - "build" => $version_info->data["branch_{$branch}_build_number"], - "branch" => $branch, - "hide-url" => url::site("admin/upgrade_checker/remind_me_later?csrf=__CSRF__"))), - "upgrade_checker"); - $upgrade_available = true; + return t("A newer version of Gallery is available! Upgrade now to version %version (build %build on branch %branch)", + array("version" => $version_info->data["branch_{$branch}_version"], + "upgrade-url" => $version_info->data["branch_{$branch}_upgrade_url"], + "build" => $version_info->data["branch_{$branch}_build_number"], + "branch" => $branch)); } } } - - if (!$upgrade_available) { - site_status::clear("upgrade_checker"); - } } } diff --git a/modules/gallery/views/upgrade_checker_block.html.php b/modules/gallery/views/upgrade_checker_block.html.php index 30e18305..b04887b2 100644 --- a/modules/gallery/views/upgrade_checker_block.html.php +++ b/modules/gallery/views/upgrade_checker_block.html.php @@ -11,6 +11,14 @@

      + +
        +
      • + +
      • +
      + +

      "> diff --git a/themes/admin_wind/css/screen.css b/themes/admin_wind/css/screen.css index 7d491cb7..a5376ff6 100644 --- a/themes/admin_wind/css/screen.css +++ b/themes/admin_wind/css/screen.css @@ -888,10 +888,10 @@ button { background-position: .4em .3em; border: 1px solid #ccc; padding: 0; + margin-bottom: 1em; } #g-action-status { - margin-bottom: 1em; } #g-action-status li, -- cgit v1.2.3 From 83bf1d767b9dac33ca1c2f01141358cd0b657523 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 17 Jan 2011 21:18:24 -0800 Subject: Fix typo: upgrade_check -> upgrade_checker #1605. --- modules/gallery/controllers/upgrader.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/gallery/controllers/upgrader.php b/modules/gallery/controllers/upgrader.php index 0932090f..6a34f19f 100644 --- a/modules/gallery/controllers/upgrader.php +++ b/modules/gallery/controllers/upgrader.php @@ -95,7 +95,7 @@ class Upgrader_Controller extends Controller { site_status::clear("upgrade_now"); // Clear any upgrade check strings, we are probably up to date. - site_status::clear("upgrade_check"); + site_status::clear("upgrade_checker"); if (php_sapi_name() == "cli") { if ($failed) { -- cgit v1.2.3 From 2999d38beb71b068f8e5f27ba6b01bf81e558e0a Mon Sep 17 00:00:00 2001 From: Automatic Build Number Updater Date: Mon, 17 Jan 2011 22:19:03 -0700 Subject: Automated update of .build_number to 56 for branch master Last update: f985adad586cd4140afdadc88eda519cce7b79da (4 commits ago) --- .build_number | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.build_number b/.build_number index 0a18d910..5a822d22 100644 --- a/.build_number +++ b/.build_number @@ -3,4 +3,4 @@ ; process. You don't need to edit it. In fact.. ; ; DO NOT EDIT THIS FILE BY HAND! -build_number=55 +build_number=56 -- cgit v1.2.3 From 56e6cb998f9b2f55af88fef426f8a69cc0058cb2 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Mon, 17 Jan 2011 21:37:51 -0800 Subject: Change the [x] close box to "(remind me later)". #1605. --- modules/gallery/controllers/admin_upgrade_checker.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/gallery/controllers/admin_upgrade_checker.php b/modules/gallery/controllers/admin_upgrade_checker.php index 456a982c..366bd64e 100644 --- a/modules/gallery/controllers/admin_upgrade_checker.php +++ b/modules/gallery/controllers/admin_upgrade_checker.php @@ -23,8 +23,9 @@ class Admin_Upgrade_Checker_Controller extends Admin_Controller { upgrade_checker::fetch_version_info(); $message = upgrade_checker::get_upgrade_message(); if ($message) { - $message .= " [x]"; + $message .= t( + " (remind me later)", + array("url" => url::site("admin/upgrade_checker/remind_me_later?csrf=__CSRF__"))); site_status::info($message, "upgrade_checker"); } else { site_status::clear("upgrade_checker"); -- cgit v1.2.3 From 412f8f73e33d2f8b02eeedc69bc8a486b2d8e2e8 Mon Sep 17 00:00:00 2001 From: Automatic Build Number Updater Date: Mon, 17 Jan 2011 22:38:48 -0700 Subject: Automated update of .build_number to 57 for branch master Last update: 2999d38beb71b068f8e5f27ba6b01bf81e558e0a (1 commits ago) --- .build_number | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.build_number b/.build_number index 5a822d22..ad47da68 100644 --- a/.build_number +++ b/.build_number @@ -3,4 +3,4 @@ ; process. You don't need to edit it. In fact.. ; ; DO NOT EDIT THIS FILE BY HAND! -build_number=56 +build_number=57 -- cgit v1.2.3 From f657a05d7ed21423afb925755bacbb07a1384044 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Tue, 18 Jan 2011 10:06:29 -0800 Subject: Get rid of the "organize needs rest" message when upgrading to the new organize; it may be hanging around from a prior version. Reinstate the installer for this. Bump organize module to v4. Follow-on for #1584. --- installer/install.sql | 2 +- modules/organize/helpers/organize_installer.php | 28 +++++++++++++++++++++++++ modules/organize/module.info | 2 +- 3 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 modules/organize/helpers/organize_installer.php diff --git a/installer/install.sql b/installer/install.sql index 1d2e6720..865cb2a4 100644 --- a/installer/install.sql +++ b/installer/install.sql @@ -247,7 +247,7 @@ CREATE TABLE {modules} ( INSERT INTO {modules} VALUES (1,1,'gallery',46,1); INSERT INTO {modules} VALUES (2,1,'user',3,2); INSERT INTO {modules} VALUES (3,1,'comment',3,3); -INSERT INTO {modules} VALUES (4,1,'organize',3,4); +INSERT INTO {modules} VALUES (4,1,'organize',4,4); INSERT INTO {modules} VALUES (5,1,'info',2,5); INSERT INTO {modules} VALUES (6,1,'rss',1,6); INSERT INTO {modules} VALUES (7,1,'search',1,7); diff --git a/modules/organize/helpers/organize_installer.php b/modules/organize/helpers/organize_installer.php new file mode 100644 index 00000000..d68bc3b6 --- /dev/null +++ b/modules/organize/helpers/organize_installer.php @@ -0,0 +1,28 @@ + Date: Tue, 18 Jan 2011 11:12:01 -0700 Subject: Automated update of .build_number to 58 for branch master Last update: 412f8f73e33d2f8b02eeedc69bc8a486b2d8e2e8 (1 commits ago) --- .build_number | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.build_number b/.build_number index ad47da68..8c736f82 100644 --- a/.build_number +++ b/.build_number @@ -3,4 +3,4 @@ ; process. You don't need to edit it. In fact.. ; ; DO NOT EDIT THIS FILE BY HAND! -build_number=57 +build_number=58 -- cgit v1.2.3 From c06017991636c21582926c0977896c63bbefd85f Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Tue, 18 Jan 2011 21:22:24 -0800 Subject: Revert "Temporarily removed ref tag to get the page validated. (Was also pointing at a rather semi-finished looking page)" This was breaking the tag autocomplete code, which depends on this value. This reverts commit 5e8d92552b1384d99d5fef56333deb7eb67a8f92. --- modules/tag/views/tag_block.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/tag/views/tag_block.html.php b/modules/tag/views/tag_block.html.php index a6536361..813f24b5 100644 --- a/modules/tag/views/tag_block.html.php +++ b/modules/tag/views/tag_block.html.php @@ -22,7 +22,7 @@ }); }); -

      +
      ">
      -- cgit v1.2.3 From b78fd8eeff0c952d48a886698153c42209eb52b9 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Tue, 18 Jan 2011 21:25:58 -0800 Subject: Create a hidden anchor containing the tag cloud autocomplete url. This way validates. Fix for #1577. --- modules/tag/views/tag_block.html.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/tag/views/tag_block.html.php b/modules/tag/views/tag_block.html.php index 813f24b5..98fa0d4f 100644 --- a/modules/tag/views/tag_block.html.php +++ b/modules/tag/views/tag_block.html.php @@ -1,7 +1,7 @@ -
      "> +
      +
      -- cgit v1.2.3 From 265e39fb57537d73302da620c1be542f3246dfcc Mon Sep 17 00:00:00 2001 From: Automatic Build Number Updater Date: Tue, 18 Jan 2011 22:43:49 -0700 Subject: Automated update of .build_number to 59 for branch master Last update: 412f8f73e33d2f8b02eeedc69bc8a486b2d8e2e8 (4 commits ago) --- .build_number | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.build_number b/.build_number index 8c736f82..e2afa970 100644 --- a/.build_number +++ b/.build_number @@ -3,4 +3,4 @@ ; process. You don't need to edit it. In fact.. ; ; DO NOT EDIT THIS FILE BY HAND! -build_number=58 +build_number=59 -- cgit v1.2.3 From 0126a0385d5a763b4920bc9ffe63ed9ec03d64f0 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Wed, 19 Jan 2011 19:50:50 -0800 Subject: Fix a bug introduced in 65ff2470a505fbc18211093ac131c29b1e820c3e, clearly I didn't test this enough. Further fix for #1460. --- modules/server_add/controllers/server_add.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/server_add/controllers/server_add.php b/modules/server_add/controllers/server_add.php index 71688605..11d4cb0a 100644 --- a/modules/server_add/controllers/server_add.php +++ b/modules/server_add/controllers/server_add.php @@ -169,7 +169,7 @@ class Server_Add_Controller extends Admin_Controller { $child_paths = glob(preg_quote($entry->path) . "/*"); if (!$child_paths) { - $child_paths = glob("$path/*"); + $child_paths = glob("{$entry->path}/*"); } foreach ($child_paths as $child_path) { if (!is_dir($child_path)) { -- cgit v1.2.3 From f25c1fab32d603ee0a835caabb6ccc52451f4891 Mon Sep 17 00:00:00 2001 From: Automatic Build Number Updater Date: Wed, 19 Jan 2011 20:52:37 -0700 Subject: Automated update of .build_number to 60 for branch master Last update: 265e39fb57537d73302da620c1be542f3246dfcc (1 commits ago) --- .build_number | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.build_number b/.build_number index e2afa970..ca806661 100644 --- a/.build_number +++ b/.build_number @@ -3,4 +3,4 @@ ; process. You don't need to edit it. In fact.. ; ; DO NOT EDIT THIS FILE BY HAND! -build_number=59 +build_number=60 -- cgit v1.2.3 From 029fa606be07c6fab0c1de6326a26f0ee442523a Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Thu, 20 Jan 2011 23:42:36 -0800 Subject: Fix a bug introduced in the refactor in 65448548637f462ad17c12b149cdb2a169d07026 for #1547. By skipping the staging dirs, we wind up scanning the entire filesystem because the first model is blank so there's no leading path before the /*. --- modules/server_add/controllers/server_add.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/modules/server_add/controllers/server_add.php b/modules/server_add/controllers/server_add.php index 11d4cb0a..6639fbae 100644 --- a/modules/server_add/controllers/server_add.php +++ b/modules/server_add/controllers/server_add.php @@ -162,11 +162,6 @@ class Server_Add_Controller extends Admin_Controller { ->find(); if ($entry->loaded()) { - // Ignore the staging directories as directories to be imported. - if (!empty($paths[$entry->path])) { - $entry->delete(); - } - $child_paths = glob(preg_quote($entry->path) . "/*"); if (!$child_paths) { $child_paths = glob("{$entry->path}/*"); -- cgit v1.2.3 From 09a593c832cc768f7e2496273eff4b9b0f77afe0 Mon Sep 17 00:00:00 2001 From: Automatic Build Number Updater Date: Fri, 21 Jan 2011 00:49:13 -0700 Subject: Automated update of .build_number to 61 for branch master Last update: f25c1fab32d603ee0a835caabb6ccc52451f4891 (1 commits ago) --- .build_number | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.build_number b/.build_number index ca806661..bc4ff05b 100644 --- a/.build_number +++ b/.build_number @@ -3,4 +3,4 @@ ; process. You don't need to edit it. In fact.. ; ; DO NOT EDIT THIS FILE BY HAND! -build_number=60 +build_number=61 -- cgit v1.2.3 From 08c41f2976cb49b85ec896b11735edb008d53881 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Fri, 21 Jan 2011 00:07:00 -0800 Subject: Add "html_attributes" theme callback to allow modules to inject attributes into the element, including things like namespaces. Fixes #1615. --- modules/gallery/libraries/Admin_View.php | 1 + modules/gallery/libraries/Theme_View.php | 1 + themes/admin_wind/views/admin.html.php | 2 +- themes/wind/views/page.html.php | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/gallery/libraries/Admin_View.php b/modules/gallery/libraries/Admin_View.php index 1a633a34..b5d3871e 100644 --- a/modules/gallery/libraries/Admin_View.php +++ b/modules/gallery/libraries/Admin_View.php @@ -86,6 +86,7 @@ class Admin_View_Core extends Gallery_View { case "admin_page_top": case "admin_head": case "body_attributes": + case "html_attributes": $blocks = array(); foreach (module::active() as $module) { $helper_class = "{$module->name}_theme"; diff --git a/modules/gallery/libraries/Theme_View.php b/modules/gallery/libraries/Theme_View.php index 04784ca1..cdc7a7cd 100644 --- a/modules/gallery/libraries/Theme_View.php +++ b/modules/gallery/libraries/Theme_View.php @@ -224,6 +224,7 @@ class Theme_View_Core extends Gallery_View { case "head": case "header_bottom": case "header_top": + case "html_attributes": case "page_bottom": case "page_top": case "photo_blocks": diff --git a/themes/admin_wind/views/admin.html.php b/themes/admin_wind/views/admin.html.php index 54b30c6f..9e011c69 100644 --- a/themes/admin_wind/views/admin.html.php +++ b/themes/admin_wind/views/admin.html.php @@ -1,7 +1,7 @@ - +html_attributes() ?> xml:lang="en" lang="en"> start_combining("script,css") ?> diff --git a/themes/wind/views/page.html.php b/themes/wind/views/page.html.php index 441866d5..0e5bdf6b 100644 --- a/themes/wind/views/page.html.php +++ b/themes/wind/views/page.html.php @@ -1,7 +1,7 @@ - +html_attributes() ?> xml:lang="en" lang="en"> start_combining("script,css") ?> -- cgit v1.2.3 From 52aef6c8fd4b41688417bb0197df85dba3d27325 Mon Sep 17 00:00:00 2001 From: Automatic Build Number Updater Date: Fri, 21 Jan 2011 01:09:22 -0700 Subject: Automated update of .build_number to 62 for branch master Last update: 09a593c832cc768f7e2496273eff4b9b0f77afe0 (1 commits ago) --- .build_number | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.build_number b/.build_number index bc4ff05b..0f9070a3 100644 --- a/.build_number +++ b/.build_number @@ -3,4 +3,4 @@ ; process. You don't need to edit it. In fact.. ; ; DO NOT EDIT THIS FILE BY HAND! -build_number=61 +build_number=62 -- cgit v1.2.3 From 6b4ccc56ceabd5721c7ff996e01be719880564f9 Mon Sep 17 00:00:00 2001 From: Joe7 Date: Fri, 21 Jan 2011 15:39:38 +0100 Subject: Fix: photos get added as albums in case only some photos are selected via server ad Fixes #1619 --- modules/server_add/controllers/server_add.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/server_add/controllers/server_add.php b/modules/server_add/controllers/server_add.php index 6639fbae..89a36cbe 100644 --- a/modules/server_add/controllers/server_add.php +++ b/modules/server_add/controllers/server_add.php @@ -95,7 +95,7 @@ class Server_Add_Controller extends Admin_Controller { if (server_add::is_valid_path($path)) { $entry = ORM::factory("server_add_entry"); $entry->path = $path; - $entry->is_directory = 1; + $entry->is_directory = intval(is_dir($path)); $entry->parent_id = null; $entry->task_id = $task->id; $entry->save(); -- cgit v1.2.3 From 5ac74cc268a52305514bd4dff68b28847542521f Mon Sep 17 00:00:00 2001 From: Automatic Build Number Updater Date: Fri, 21 Jan 2011 10:33:37 -0700 Subject: Automated update of .build_number to 63 for branch master Last update: 52aef6c8fd4b41688417bb0197df85dba3d27325 (1 commits ago) --- .build_number | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.build_number b/.build_number index 0f9070a3..6c18ff99 100644 --- a/.build_number +++ b/.build_number @@ -3,4 +3,4 @@ ; process. You don't need to edit it. In fact.. ; ; DO NOT EDIT THIS FILE BY HAND! -build_number=62 +build_number=63 -- cgit v1.2.3 From 423daa52d55a5298b461384baedc995eee09a0d1 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Fri, 21 Jan 2011 23:01:06 -0800 Subject: Update copyright to 2011. --- application/Bootstrap.php | 2 +- application/config/config.php | 2 +- index.php | 2 +- installer/cli.php | 2 +- installer/index.php | 2 +- installer/installer.php | 2 +- installer/web.php | 2 +- modules/akismet/controllers/admin_akismet.php | 2 +- modules/akismet/helpers/akismet.php | 2 +- modules/akismet/helpers/akismet_event.php | 2 +- modules/akismet/helpers/akismet_installer.php | 2 +- modules/akismet/tests/Akismet_Helper_Test.php | 2 +- modules/comment/controllers/admin_comments.php | 2 +- modules/comment/controllers/admin_manage_comments.php | 2 +- modules/comment/controllers/comments.php | 2 +- modules/comment/helpers/comment.php | 2 +- modules/comment/helpers/comment_block.php | 2 +- modules/comment/helpers/comment_event.php | 2 +- modules/comment/helpers/comment_installer.php | 2 +- modules/comment/helpers/comment_rest.php | 2 +- modules/comment/helpers/comment_rss.php | 2 +- modules/comment/helpers/comment_theme.php | 2 +- modules/comment/helpers/comments_rest.php | 2 +- modules/comment/helpers/item_comments_rest.php | 2 +- modules/comment/models/comment.php | 2 +- modules/comment/tests/Comment_Event_Test.php | 2 +- modules/comment/tests/Comment_Helper_Test.php | 2 +- modules/comment/tests/Comment_Model_Test.php | 2 +- modules/digibug/config/digibug.php | 2 +- modules/digibug/controllers/admin_digibug.php | 2 +- modules/digibug/controllers/digibug.php | 2 +- modules/digibug/helpers/digibug_event.php | 2 +- modules/digibug/helpers/digibug_installer.php | 2 +- modules/digibug/helpers/digibug_theme.php | 2 +- modules/digibug/models/digibug_proxy.php | 2 +- modules/digibug/tests/Digibug_Controller_Test.php | 2 +- modules/exif/controllers/exif.php | 2 +- modules/exif/helpers/exif.php | 2 +- modules/exif/helpers/exif_event.php | 2 +- modules/exif/helpers/exif_installer.php | 2 +- modules/exif/helpers/exif_task.php | 2 +- modules/exif/helpers/exif_theme.php | 2 +- modules/exif/models/exif_key.php | 2 +- modules/exif/models/exif_record.php | 2 +- modules/exif/tests/Exif_Test.php | 2 +- modules/g2_import/controllers/admin_g2_import.php | 2 +- modules/g2_import/controllers/g2.php | 2 +- modules/g2_import/helpers/g2_import.php | 2 +- modules/g2_import/helpers/g2_import_event.php | 2 +- modules/g2_import/helpers/g2_import_installer.php | 2 +- modules/g2_import/helpers/g2_import_task.php | 2 +- modules/g2_import/libraries/G2_Import_Exception.php | 2 +- modules/g2_import/models/g2_map.php | 2 +- modules/gallery/config/cache.php | 2 +- modules/gallery/config/cookie.php | 2 +- modules/gallery/config/database.php | 2 +- modules/gallery/config/locale.php | 2 +- modules/gallery/config/log_file.php | 2 +- modules/gallery/config/routes.php | 2 +- modules/gallery/config/session.php | 2 +- modules/gallery/config/upload.php | 2 +- modules/gallery/config/user_agents.php | 2 +- modules/gallery/controllers/admin.php | 2 +- modules/gallery/controllers/admin_advanced_settings.php | 2 +- modules/gallery/controllers/admin_dashboard.php | 2 +- modules/gallery/controllers/admin_graphics.php | 2 +- modules/gallery/controllers/admin_languages.php | 2 +- modules/gallery/controllers/admin_maintenance.php | 2 +- modules/gallery/controllers/admin_modules.php | 2 +- modules/gallery/controllers/admin_sidebar.php | 2 +- modules/gallery/controllers/admin_theme_options.php | 2 +- modules/gallery/controllers/admin_themes.php | 2 +- modules/gallery/controllers/admin_upgrade_checker.php | 2 +- modules/gallery/controllers/albums.php | 2 +- modules/gallery/controllers/combined.php | 2 +- modules/gallery/controllers/file_proxy.php | 2 +- modules/gallery/controllers/items.php | 2 +- modules/gallery/controllers/l10n_client.php | 2 +- modules/gallery/controllers/login.php | 2 +- modules/gallery/controllers/logout.php | 2 +- modules/gallery/controllers/movies.php | 2 +- modules/gallery/controllers/packager.php | 2 +- modules/gallery/controllers/permissions.php | 2 +- modules/gallery/controllers/photos.php | 2 +- modules/gallery/controllers/quick.php | 2 +- modules/gallery/controllers/reauthenticate.php | 2 +- modules/gallery/controllers/upgrader.php | 2 +- modules/gallery/controllers/uploader.php | 2 +- modules/gallery/controllers/user_profile.php | 2 +- modules/gallery/controllers/welcome_message.php | 2 +- modules/gallery/helpers/MY_html.php | 2 +- modules/gallery/helpers/MY_num.php | 2 +- modules/gallery/helpers/MY_remote.php | 2 +- modules/gallery/helpers/MY_url.php | 2 +- modules/gallery/helpers/access.php | 2 +- modules/gallery/helpers/album.php | 2 +- modules/gallery/helpers/auth.php | 2 +- modules/gallery/helpers/batch.php | 2 +- modules/gallery/helpers/block_manager.php | 2 +- modules/gallery/helpers/data_rest.php | 2 +- modules/gallery/helpers/dir.php | 2 +- modules/gallery/helpers/gallery.php | 2 +- modules/gallery/helpers/gallery_block.php | 2 +- modules/gallery/helpers/gallery_error.php | 2 +- modules/gallery/helpers/gallery_event.php | 2 +- modules/gallery/helpers/gallery_graphics.php | 2 +- modules/gallery/helpers/gallery_installer.php | 2 +- modules/gallery/helpers/gallery_rss.php | 2 +- modules/gallery/helpers/gallery_task.php | 2 +- modules/gallery/helpers/gallery_theme.php | 2 +- modules/gallery/helpers/graphics.php | 2 +- modules/gallery/helpers/identity.php | 2 +- modules/gallery/helpers/item.php | 2 +- modules/gallery/helpers/item_rest.php | 2 +- modules/gallery/helpers/items_rest.php | 2 +- modules/gallery/helpers/json.php | 2 +- modules/gallery/helpers/l10n_client.php | 2 +- modules/gallery/helpers/l10n_scanner.php | 2 +- modules/gallery/helpers/locales.php | 2 +- modules/gallery/helpers/log.php | 2 +- modules/gallery/helpers/message.php | 2 +- modules/gallery/helpers/model_cache.php | 2 +- modules/gallery/helpers/module.php | 2 +- modules/gallery/helpers/movie.php | 2 +- modules/gallery/helpers/photo.php | 2 +- modules/gallery/helpers/random.php | 2 +- modules/gallery/helpers/site_status.php | 2 +- modules/gallery/helpers/system.php | 2 +- modules/gallery/helpers/task.php | 2 +- modules/gallery/helpers/theme.php | 2 +- modules/gallery/helpers/tree_rest.php | 2 +- modules/gallery/helpers/upgrade_checker.php | 2 +- modules/gallery/helpers/user_profile.php | 2 +- modules/gallery/helpers/xml.php | 2 +- modules/gallery/hooks/init_gallery.php | 2 +- modules/gallery/libraries/Admin_View.php | 2 +- modules/gallery/libraries/Block.php | 2 +- modules/gallery/libraries/Form_Script.php | 2 +- modules/gallery/libraries/Form_Uploadify.php | 2 +- modules/gallery/libraries/Form_Uploadify_buttons.php | 2 +- modules/gallery/libraries/Gallery_I18n.php | 2 +- modules/gallery/libraries/Gallery_View.php | 2 +- modules/gallery/libraries/IdentityProvider.php | 2 +- modules/gallery/libraries/InPlaceEdit.php | 2 +- modules/gallery/libraries/MY_Database.php | 2 +- modules/gallery/libraries/MY_Forge.php | 2 +- modules/gallery/libraries/MY_Input.php | 2 +- modules/gallery/libraries/MY_Kohana_Exception.php | 2 +- modules/gallery/libraries/MY_ORM.php | 2 +- modules/gallery/libraries/MY_Pagination.php | 2 +- modules/gallery/libraries/MY_View.php | 2 +- modules/gallery/libraries/Menu.php | 2 +- modules/gallery/libraries/ORM_MPTT.php | 2 +- modules/gallery/libraries/SafeString.php | 2 +- modules/gallery/libraries/Sendmail.php | 2 +- modules/gallery/libraries/Task_Definition.php | 2 +- modules/gallery/libraries/Theme_View.php | 2 +- modules/gallery/libraries/drivers/Cache/Database.php | 2 +- modules/gallery/libraries/drivers/IdentityProvider.php | 2 +- modules/gallery/models/access_cache.php | 2 +- modules/gallery/models/access_intent.php | 2 +- modules/gallery/models/cache.php | 2 +- modules/gallery/models/failed_auth.php | 2 +- modules/gallery/models/graphics_rule.php | 2 +- modules/gallery/models/incoming_translation.php | 2 +- modules/gallery/models/item.php | 2 +- modules/gallery/models/log.php | 2 +- modules/gallery/models/message.php | 2 +- modules/gallery/models/module.php | 2 +- modules/gallery/models/outgoing_translation.php | 2 +- modules/gallery/models/permission.php | 2 +- modules/gallery/models/task.php | 2 +- modules/gallery/models/theme.php | 2 +- modules/gallery/models/var.php | 2 +- modules/gallery/tests/Access_Helper_Test.php | 2 +- modules/gallery/tests/Albums_Controller_Test.php | 2 +- modules/gallery/tests/Cache_Test.php | 2 +- modules/gallery/tests/Controller_Auth_Test.php | 2 +- modules/gallery/tests/Database_Test.php | 2 +- modules/gallery/tests/Dir_Helper_Test.php | 2 +- modules/gallery/tests/DrawForm_Test.php | 2 +- modules/gallery/tests/File_Structure_Test.php | 4 ++-- modules/gallery/tests/Gallery_Filters.php | 2 +- modules/gallery/tests/Gallery_I18n_Test.php | 2 +- modules/gallery/tests/Gallery_Installer_Test.php | 2 +- modules/gallery/tests/Html_Helper_Test.php | 2 +- modules/gallery/tests/Input_Library_Test.php | 2 +- modules/gallery/tests/Item_Helper_Test.php | 2 +- modules/gallery/tests/Item_Model_Test.php | 2 +- modules/gallery/tests/Item_Rest_Helper_Test.php | 2 +- modules/gallery/tests/Items_Rest_Helper_Test.php | 2 +- modules/gallery/tests/Kohana_Exception_Test.php | 2 +- modules/gallery/tests/Locales_Helper_Test.php | 2 +- modules/gallery/tests/Menu_Test.php | 2 +- modules/gallery/tests/ORM_MPTT_Test.php | 2 +- modules/gallery/tests/Photos_Controller_Test.php | 2 +- modules/gallery/tests/SafeString_Test.php | 2 +- modules/gallery/tests/Sendmail_Test.php | 2 +- modules/gallery/tests/Url_Security_Test.php | 2 +- modules/gallery/tests/Var_Test.php | 2 +- modules/gallery/tests/Xss_Security_Test.php | 2 +- modules/gallery_unit_test/controllers/gallery_unit_test.php | 2 +- modules/gallery_unit_test/helpers/MY_request.php | 2 +- modules/gallery_unit_test/helpers/test.php | 2 +- modules/gallery_unit_test/libraries/Gallery_Unit_Test_Case.php | 2 +- modules/image_block/helpers/image_block_block.php | 2 +- modules/image_block/helpers/image_block_installer.php | 2 +- modules/info/helpers/info_block.php | 2 +- modules/info/helpers/info_installer.php | 2 +- modules/info/helpers/info_theme.php | 2 +- modules/kohana23_compat/config/pagination.php | 2 +- modules/kohana23_compat/libraries/MY_Database_Builder.php | 2 +- modules/kohana23_compat/libraries/Pagination.php | 2 +- modules/notification/controllers/notification.php | 2 +- modules/notification/helpers/notification.php | 2 +- modules/notification/helpers/notification_event.php | 2 +- modules/notification/helpers/notification_installer.php | 2 +- modules/notification/models/pending_notification.php | 2 +- modules/notification/models/subscription.php | 2 +- modules/organize/controllers/organize.php | 2 +- modules/organize/helpers/organize_event.php | 2 +- modules/organize/helpers/organize_installer.php | 2 +- modules/recaptcha/controllers/admin_recaptcha.php | 2 +- modules/recaptcha/helpers/recaptcha.php | 2 +- modules/recaptcha/helpers/recaptcha_event.php | 2 +- modules/recaptcha/helpers/recaptcha_installer.php | 2 +- modules/recaptcha/helpers/recaptcha_theme.php | 2 +- modules/recaptcha/libraries/Form_Recaptcha.php | 2 +- modules/rest/controllers/rest.php | 2 +- modules/rest/helpers/registry_rest.php | 2 +- modules/rest/helpers/rest.php | 2 +- modules/rest/helpers/rest_event.php | 2 +- modules/rest/helpers/rest_installer.php | 2 +- modules/rest/libraries/Rest_Exception.php | 2 +- modules/rest/models/user_access_key.php | 2 +- modules/rest/tests/Rest_Controller_Test.php | 2 +- modules/rss/controllers/rss.php | 2 +- modules/rss/helpers/rss.php | 2 +- modules/rss/helpers/rss_block.php | 2 +- modules/search/controllers/search.php | 2 +- modules/search/helpers/search.php | 2 +- modules/search/helpers/search_event.php | 2 +- modules/search/helpers/search_installer.php | 2 +- modules/search/helpers/search_task.php | 2 +- modules/search/helpers/search_theme.php | 2 +- modules/search/models/search_record.php | 2 +- modules/server_add/controllers/admin_server_add.php | 2 +- modules/server_add/controllers/server_add.php | 2 +- modules/server_add/helpers/server_add.php | 2 +- modules/server_add/helpers/server_add_event.php | 2 +- modules/server_add/helpers/server_add_installer.php | 2 +- modules/server_add/helpers/server_add_theme.php | 2 +- modules/server_add/models/server_add_entry.php | 2 +- modules/slideshow/helpers/slideshow_event.php | 2 +- modules/slideshow/helpers/slideshow_installer.php | 2 +- modules/slideshow/helpers/slideshow_theme.php | 2 +- modules/tag/controllers/admin_tags.php | 2 +- modules/tag/controllers/tag.php | 2 +- modules/tag/controllers/tags.php | 2 +- modules/tag/helpers/item_tags_rest.php | 2 +- modules/tag/helpers/tag.php | 2 +- modules/tag/helpers/tag_block.php | 2 +- modules/tag/helpers/tag_event.php | 2 +- modules/tag/helpers/tag_installer.php | 2 +- modules/tag/helpers/tag_item_rest.php | 2 +- modules/tag/helpers/tag_items_rest.php | 2 +- modules/tag/helpers/tag_rest.php | 2 +- modules/tag/helpers/tag_rss.php | 2 +- modules/tag/helpers/tag_task.php | 2 +- modules/tag/helpers/tag_theme.php | 2 +- modules/tag/helpers/tags_rest.php | 2 +- modules/tag/models/tag.php | 2 +- modules/tag/tests/Tag_Item_Rest_Helper_Test.php | 2 +- modules/tag/tests/Tag_Rest_Helper_Test.php | 2 +- modules/tag/tests/Tag_Test.php | 2 +- modules/tag/tests/Tags_Rest_Helper_Test.php | 2 +- modules/user/config/identity.php | 2 +- modules/user/controllers/admin_users.php | 2 +- modules/user/controllers/password.php | 2 +- modules/user/controllers/users.php | 2 +- modules/user/helpers/group.php | 2 +- modules/user/helpers/user.php | 2 +- modules/user/helpers/user_event.php | 2 +- modules/user/helpers/user_installer.php | 2 +- modules/user/helpers/user_theme.php | 2 +- modules/user/libraries/drivers/IdentityProvider/Gallery.php | 2 +- modules/user/models/group.php | 2 +- modules/user/models/user.php | 2 +- modules/user/tests/No_Direct_ORM_Access_Test.php | 2 +- modules/user/tests/User_Groups_Test.php | 2 +- modules/user/tests/User_Installer_Test.php | 2 +- modules/watermark/controllers/admin_watermarks.php | 2 +- modules/watermark/helpers/watermark.php | 2 +- modules/watermark/helpers/watermark_event.php | 2 +- modules/watermark/helpers/watermark_installer.php | 2 +- 295 files changed, 296 insertions(+), 296 deletions(-) diff --git a/application/Bootstrap.php b/application/Bootstrap.php index fbd83ce1..ff021fd5 100644 --- a/application/Bootstrap.php +++ b/application/Bootstrap.php @@ -1,7 +1,7 @@ Date: Fri, 21 Jan 2011 23:09:27 -0800 Subject: Update XSS golden file --- modules/gallery/tests/xss_data.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/gallery/tests/xss_data.txt b/modules/gallery/tests/xss_data.txt index 609f786a..0c812fb4 100644 --- a/modules/gallery/tests/xss_data.txt +++ b/modules/gallery/tests/xss_data.txt @@ -248,6 +248,7 @@ modules/gallery/views/permissions_form.html.php 80 DIRTY_JS $permi modules/gallery/views/permissions_form.html.php 80 DIRTY_JS $item->id modules/gallery/views/quick_delete_confirm.html.php 11 DIRTY $form modules/gallery/views/reauthenticate.html.php 9 DIRTY $form +modules/gallery/views/upgrade_checker_block.html.php 17 DIRTY $new_version modules/gallery/views/upgrader.html.php 76 DIRTY_ATTR $done?"muted":"" modules/gallery/views/upgrader.html.php 94 DIRTY_ATTR $done?"muted":"" modules/gallery/views/upgrader.html.php 102 DIRTY_ATTR $module->version==$module->code_version?"current":"upgradeable" @@ -338,8 +339,8 @@ modules/server_add/views/server_add_tree_dialog.html.php 4 DIRTY_JS url::s modules/server_add/views/server_add_tree_dialog.html.php 21 DIRTY $tree modules/tag/views/admin_tags.html.php 45 DIRTY_ATTR $tag->id modules/tag/views/admin_tags.html.php 46 DIRTY $tag->count -modules/tag/views/tag_block.html.php 26 DIRTY $cloud -modules/tag/views/tag_block.html.php 28 DIRTY $form +modules/tag/views/tag_block.html.php 28 DIRTY $cloud +modules/tag/views/tag_block.html.php 30 DIRTY $form modules/tag/views/tag_cloud.html.php 4 DIRTY_ATTR (int)(($tag->count/$max_count)*7) modules/tag/views/tag_cloud.html.php 5 DIRTY $tag->count modules/tag/views/tag_cloud.html.php 6 DIRTY_JS $tag->url() @@ -363,6 +364,7 @@ modules/user/views/admin_users_group.html.php 24 DIRTY_JS $group modules/watermark/views/admin_watermarks.html.php 20 DIRTY_ATTR $width modules/watermark/views/admin_watermarks.html.php 20 DIRTY_ATTR $height modules/watermark/views/admin_watermarks.html.php 20 DIRTY_ATTR $url +themes/admin_wind/views/admin.html.php 4 DIRTY $theme->html_attributes() themes/admin_wind/views/admin.html.php 31 DIRTY $theme->admin_head() themes/admin_wind/views/admin.html.php 40 DIRTY_JS $theme->url() themes/admin_wind/views/admin.html.php 45 DIRTY $theme->get_combined("script") @@ -408,6 +410,7 @@ themes/wind/views/dynamic.html.php 17 DIRTY_ATTR $chi themes/wind/views/dynamic.html.php 29 DIRTY $theme->paginator() themes/wind/views/movie.html.php 5 DIRTY $theme->paginator() themes/wind/views/movie.html.php 9 DIRTY $item->movie_img(array("class"=>"g-movie","id"=>"g-item-id-{$item->id}")) +themes/wind/views/page.html.php 4 DIRTY $theme->html_attributes() themes/wind/views/page.html.php 10 DIRTY $page_title themes/wind/views/page.html.php 13 DIRTY $theme->item()->title themes/wind/views/page.html.php 17 DIRTY item::root()->title -- cgit v1.2.3 From d2c77fd0590501f7b6b51d9f4cc033ed9485b082 Mon Sep 17 00:00:00 2001 From: Automatic Build Number Updater Date: Sat, 22 Jan 2011 00:10:20 -0700 Subject: Automated update of .build_number to 64 for branch master Last update: 52aef6c8fd4b41688417bb0197df85dba3d27325 (4 commits ago) --- .build_number | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.build_number b/.build_number index 6c18ff99..ba31e80f 100644 --- a/.build_number +++ b/.build_number @@ -3,4 +3,4 @@ ; process. You don't need to edit it. In fact.. ; ; DO NOT EDIT THIS FILE BY HAND! -build_number=63 +build_number=64 -- cgit v1.2.3