From a6280641f53391dd57b3760ac882c3219e0cee6e Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Thu, 29 Jul 2010 09:22:32 -0700 Subject: Resend the entire dialog content (including the wrapping view) instead of just the form. --- modules/gallery/controllers/login.php | 4 +++- modules/gallery/controllers/reauthenticate.php | 9 ++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'modules') diff --git a/modules/gallery/controllers/login.php b/modules/gallery/controllers/login.php index 3454a245..d7ab399f 100644 --- a/modules/gallery/controllers/login.php +++ b/modules/gallery/controllers/login.php @@ -32,7 +32,9 @@ class Login_Controller extends Controller { if ($valid) { json::reply(array("result" => "success")); } else { - json::reply(array("result" => "error", "form" => (string) $form)); + $view = new View("login_ajax.html"); + $view->form = $form; + json::reply(array("result" => "error", "form" => (string) $view)); } } diff --git a/modules/gallery/controllers/reauthenticate.php b/modules/gallery/controllers/reauthenticate.php index 393f97cb..7f9e5edc 100644 --- a/modules/gallery/controllers/reauthenticate.php +++ b/modules/gallery/controllers/reauthenticate.php @@ -54,10 +54,13 @@ class Reauthenticate_Controller extends Controller { $name = $user->name; log::warning("user", t("Failed re-authentication for %name", array("name" => $name))); module::event("user_auth_failed", $name); - if (empty($reauthenticate["in_dialog"])) { - self::_show_form($form); + if (request::is_ajax()) { + $v = new View("reauthenticate.html"); + $v->form = $form; + $v->user_name = identity::active_user()->name; + json::reply(array("form" => (string) $v)); } else { - json::reply(array("form" => (string) $form)); + self::_show_form($form); } } } -- cgit v1.2.3