Create a new method in MY_url.php "get_item_from_uri" which loads the item

based on the uri.  Then use this helper method in logout.php to insure that
the guest user has access to the "continue" uri.  If they don't redirect to
the root album and let it deal with access issues.

Signed-off-by: Tim Almdal <tnalmdal@shaw.ca>
This commit is contained in:
Tim Almdal
2009-06-09 21:35:35 +08:00
parent a42c101c0b
commit f0ea6d532c
2 changed files with 20 additions and 8 deletions

View File

@@ -26,7 +26,12 @@ class Logout_Controller extends Controller {
log::info("user", t("User %name logged out", array("name" => $user->name)),
html::anchor("user/$user->id", $user->name));
if ($this->input->get("continue")) {
url::redirect($this->input->get("continue"));
$item = url::get_item_from_uri($this->input->get("continue"));
if (access::can("view", $item)) {
url::redirect($this->input->get("continue"));
} else {
url::redirect("");
}
}
}
}