Skip to content

Commit

Permalink
Remove the code to call the controller directly and just use redirect…
Browse files Browse the repository at this point in the history
…. Now that all the form calls actually return the form as a json object, calling the form creation controller method i no longer required.
  • Loading branch information
Tim Almdal committed Jul 15, 2010
1 parent 155d2b8 commit 993e041
Showing 1 changed file with 1 addition and 24 deletions.
25 changes: 1 addition & 24 deletions modules/gallery/controllers/reauthenticate.php
Expand Up @@ -46,10 +46,8 @@ public function auth() {
Session::instance()->delete("reauthenticate");
if (empty($reauthenticate["in_dialog"])) {
message::success(t("Successfully re-authenticated!"));
url::redirect($reauthenticate["continue_url"]);
} else {
self::_call_admin_function($reauthenticate);
}
url::redirect($reauthenticate["continue_url"]);
} else {
$name = $user->name;
log::warning("user", t("Failed re-authentication for %name", array("name" => $name)));
Expand Down Expand Up @@ -88,27 +86,6 @@ private static function _form() {
return $form;
}

private static function _call_admin_function($reauthenticate) {
$controller_name = $reauthenticate["controller"];
$args = $reauthenticate["args"];
if ($controller_name == "index") {
$controller_name = "dashboard";
}

$controller_name = "Admin_{$controller_name}_Controller";
if ($args) {
$method = array_shift($args);
} else {
$method = "index";
}

if (!method_exists($controller_name, $method)) {
throw new Kohana_404_Exception();
}

call_user_func_array(array(new $controller_name, $method), $args);
}

static function valid_password($password_input) {
if (!identity::is_correct_password(identity::active_user(), $password_input->value)) {
$password_input->add_error("invalid_password", 1);
Expand Down

0 comments on commit 993e041

Please sign in to comment.