summaryrefslogtreecommitdiff
path: root/modules/gallery/controllers/reauthenticate.php
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2010-07-28 07:57:27 -0700
committerBharat Mediratta <bharat@menalto.com>2010-07-31 15:44:56 -0700
commit29f29d2261c96c30eb3e63a8066e80ade5497081 (patch)
tree9bbd6962eadc1fdc839c4cec9d51203377448176 /modules/gallery/controllers/reauthenticate.php
parent0cca2fdf9bc0e77e1015975efdb9fe7c07a75b5f (diff)
When the admin controller redirects to the reauthenticate controller, the value of request::is_ajax() from the original request is lost. This patch stores its value in the session so the reauthenticate controller knows whether its in a dialog/panel or not.
Diffstat (limited to 'modules/gallery/controllers/reauthenticate.php')
-rw-r--r--modules/gallery/controllers/reauthenticate.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/modules/gallery/controllers/reauthenticate.php b/modules/gallery/controllers/reauthenticate.php
index 2b1f6d14..5ea2f229 100644
--- a/modules/gallery/controllers/reauthenticate.php
+++ b/modules/gallery/controllers/reauthenticate.php
@@ -22,8 +22,13 @@ class Reauthenticate_Controller extends Controller {
if (!identity::active_user()->admin) {
access::forbidden();
}
- if (request::is_ajax()) {
- json::reply(array("form" => (string) self::_form()));
+ // On redirects from the admin controller, the ajax request indicator is lost,
+ // so we store it in the session.
+ $is_ajax = Session::instance()->get_once("is_ajax_request", request::is_ajax());
+ if ($is_ajax) {
+ $v = new View("reauthenticate.html");
+ $v->form = self::_form();
+ json::reply(array("form" => (string) $v));
} else {
self::_show_form(self::_form());
}