summaryrefslogtreecommitdiff
path: root/modules/gallery/controllers/reauthenticate.php
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gallery/controllers/reauthenticate.php')
-rw-r--r--modules/gallery/controllers/reauthenticate.php11
1 files changed, 8 insertions, 3 deletions
diff --git a/modules/gallery/controllers/reauthenticate.php b/modules/gallery/controllers/reauthenticate.php
index 3cff2b6a..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()) {
- print json_encode(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());
}
@@ -51,7 +56,7 @@ class Reauthenticate_Controller extends Controller {
if (empty($reauthenticate["in_dialog"])) {
self::_show_form($form);
} else {
- print json_encode(array("form" => (string) $form));
+ json::reply(array("form" => (string) $form));
}
}
}