Skip to content

Commit

Permalink
Resend the entire dialog content (including the wrapping view) instea…
Browse files Browse the repository at this point in the history
…d of just the form.
  • Loading branch information
Tim Almdal authored and bharat committed Jul 31, 2010
1 parent a6ceb92 commit a628064
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 3 additions & 1 deletion modules/gallery/controllers/login.php
Expand Up @@ -32,7 +32,9 @@ public function auth_ajax() {
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));
}
}

Expand Down
9 changes: 6 additions & 3 deletions modules/gallery/controllers/reauthenticate.php
Expand Up @@ -54,10 +54,13 @@ public function auth() {
$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);
}
}
}
Expand Down

0 comments on commit a628064

Please sign in to comment.