From 316b0583b374a5754ea112c00464d118917cdbc1 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Sun, 7 Feb 2010 21:38:51 -0800 Subject: Revert "Refactor the admin maintenance screen so that events are used to populate the action buttons and other content such as the list of scheduled tasks." Leaving this api out of RC1. This reverts commit 19fee6b5e4ceb8a5f90cafe4ad770856ece108ef. Conflicts: modules/gallery/views/admin_maintenance.html.php --- modules/gallery/controllers/admin_maintenance.php | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'modules/gallery/controllers') diff --git a/modules/gallery/controllers/admin_maintenance.php b/modules/gallery/controllers/admin_maintenance.php index 8e4845a9..487e77a6 100644 --- a/modules/gallery/controllers/admin_maintenance.php +++ b/modules/gallery/controllers/admin_maintenance.php @@ -44,17 +44,10 @@ class Admin_Maintenance_Controller extends Admin_Controller { $view->content->task_definitions = task::get_definitions(); $view->content->running_tasks = ORM::factory("task") ->where("done", "=", 0)->order_by("updated", "DESC")->find_all(); + $view->content->schedule_definitions = + module::is_active("scheduler") ? scheduler::get_definitions() : ""; $view->content->finished_tasks = ORM::factory("task") ->where("done", "=", 1)->order_by("updated", "DESC")->find_all(); - $task_buttons = - new ArrayObject(array((object)array("text" => t("run"), - "url" =>url::site("admin/maintenance/start")))); - module::event("admin_maintenance_task_buttons", $task_buttons); - $view->content->task_buttons = $task_buttons; - - $maintenance_content = new ArrayObject(); - module::event("admin_maintenance_content", $maintenance_content); - $view->content->task_maintenance_content = $maintenance_content; print $view; } -- cgit v1.2.3 From b8047db5393ddbe27d6ee391845802054b92bf79 Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Sun, 7 Feb 2010 21:40:34 -0800 Subject: Revert "Add the scheduler component to the admin maintenance screen." This reverts commit 48cb5021c6bd7e65a13a0ff50a9e76f72da7d3a1. --- modules/gallery/controllers/admin_maintenance.php | 2 -- modules/gallery/views/admin_maintenance.html.php | 8 -------- 2 files changed, 10 deletions(-) (limited to 'modules/gallery/controllers') diff --git a/modules/gallery/controllers/admin_maintenance.php b/modules/gallery/controllers/admin_maintenance.php index 487e77a6..d90fe0ea 100644 --- a/modules/gallery/controllers/admin_maintenance.php +++ b/modules/gallery/controllers/admin_maintenance.php @@ -44,8 +44,6 @@ class Admin_Maintenance_Controller extends Admin_Controller { $view->content->task_definitions = task::get_definitions(); $view->content->running_tasks = ORM::factory("task") ->where("done", "=", 0)->order_by("updated", "DESC")->find_all(); - $view->content->schedule_definitions = - module::is_active("scheduler") ? scheduler::get_definitions() : ""; $view->content->finished_tasks = ORM::factory("task") ->where("done", "=", 1)->order_by("updated", "DESC")->find_all(); print $view; diff --git a/modules/gallery/views/admin_maintenance.html.php b/modules/gallery/views/admin_maintenance.html.php index 15d04caa..ac597715 100644 --- a/modules/gallery/views/admin_maintenance.html.php +++ b/modules/gallery/views/admin_maintenance.html.php @@ -33,20 +33,12 @@ class="g-dialog-link g-button ui-icon-left ui-state-default ui-corner-all"> - - callback?csrf=$csrf") ?>" - class="g-dialog-link g-button ui-icon-left ui-state-default ui-corner-all"> - - - - - count()): ?>

-- cgit v1.2.3 From f9d00aa7429599f46e09b23e8313932ac5e186c3 Mon Sep 17 00:00:00 2001 From: Andy Staudacher Date: Mon, 8 Feb 2010 00:30:36 -0800 Subject: Fix for ticket 1008: Redirect to destination after re-auth. --- modules/gallery/controllers/admin.php | 12 +++++++++++- modules/gallery/controllers/reauthenticate.php | 3 ++- 2 files changed, 13 insertions(+), 2 deletions(-) (limited to 'modules/gallery/controllers') diff --git a/modules/gallery/controllers/admin.php b/modules/gallery/controllers/admin.php index b5f3db39..5467e88a 100644 --- a/modules/gallery/controllers/admin.php +++ b/modules/gallery/controllers/admin.php @@ -30,7 +30,7 @@ class Admin_Controller extends Controller { public function __call($controller_name, $args) { if (auth::must_reauth_for_admin_area()) { - return url::redirect("reauthenticate"); + return self::_prompt_for_reauth($controller_name, $args); } if (request::method() == "post") { @@ -53,5 +53,15 @@ class Admin_Controller extends Controller { call_user_func_array(array(new $controller_name, $method), $args); } + + private static function _prompt_for_reauth($controller_name, $args) { + if (request::method() == "get" && !request::is_ajax()) { + $url_args = array("admin", $controller_name) + $args; + $continue_url = join("/", $url_args); + // Avoid anti-phishing protection by passing the url as session variable. + Session::instance()->set("continue_url", $continue_url); + } + url::redirect("reauthenticate"); + } } diff --git a/modules/gallery/controllers/reauthenticate.php b/modules/gallery/controllers/reauthenticate.php index 4b88a9cc..dbd1cd21 100644 --- a/modules/gallery/controllers/reauthenticate.php +++ b/modules/gallery/controllers/reauthenticate.php @@ -37,7 +37,8 @@ class Reauthenticate_Controller extends Controller { if ($valid) { message::success(t("Successfully re-authenticated!")); module::event("user_auth", $user); - url::redirect("admin"); + $continue_url = Session::instance()->get_once("continue_url", "admin"); + url::redirect($continue_url); } else { $name = $user->name; log::warning("user", t("Failed re-authentication for %name", array("name" => $name))); -- cgit v1.2.3