admin) { access::forbidden(); } parent::__construct(); } public function __call($controller_name, $args) { if (auth::must_reauth_for_admin_area()) { return self::_prompt_for_reauth($controller_name, $args); } if (request::method() == "post") { access::verify_csrf(); } 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); } private static function _prompt_for_reauth($controller_name, $args) { if (request::method() == "get" && !request::is_ajax()) { // Avoid anti-phishing protection by passing the url as session variable. Session::instance()->set("continue_url", url::current(true)); } url::redirect("reauthenticate"); } }