Fix for ticket #1176. Have the gallery.dialog code add a g-in-dialog parameter to the url to let the controller know its in a dialog. The reauthenticate controller will format the password prompt as a page or a form content. If authentication is successful, then the original controller is called instead of being redirected to.

This commit is contained in:
Tim Almdal
2010-07-07 08:58:38 -07:00
parent cb4e18f9dd
commit 9538b3888d
3 changed files with 50 additions and 6 deletions

View File

@@ -82,10 +82,14 @@ class Admin_Controller extends Controller {
}
private static function _prompt_for_reauth($controller_name, $args) {
if (request::method() == "get" && !request::is_ajax()) {
if (request::method() == "get") {
// Avoid anti-phishing protection by passing the url as session variable.
Session::instance()->set("continue_url", url::abs_current(true));
$reauthenticate = array("continue_url" => url::abs_current(true),
"in_dialog" => strpos(Router::$query_string, "g-in-dialog") !== false,
"controller" => $controller_name, "args" => $args);
Session::instance()->set("reauthenticate", $reauthenticate);
}
url::redirect("reauthenticate");
}
}