summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorTim Almdal <tnalmdal@shaw.ca>2009-03-11 13:58:38 +0000
committerTim Almdal <tnalmdal@shaw.ca>2009-03-11 13:58:38 +0000
commita521d9177f5e299d2ff25cc288e59e4bf1398a1b (patch)
tree1a0664cb4aa01d698d1dcd1b6fba9cfd3ee1e9b8 /core
parent30239ed302c571efb0cd9c86625be30fce5b4bd9 (diff)
Force a login if everybody does not have access to the root
item. ticket #118.
Diffstat (limited to 'core')
-rw-r--r--core/controllers/albums.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/core/controllers/albums.php b/core/controllers/albums.php
index 270b2184..9811ba13 100644
--- a/core/controllers/albums.php
+++ b/core/controllers/albums.php
@@ -23,7 +23,15 @@ class Albums_Controller extends Items_Controller {
* @see REST_Controller::_show($resource)
*/
public function _show($album) {
- access::required("view", $album);
+ try {
+ access::required("view", $album);
+ } catch (Exception $e) {
+ if ($album->id != 1) {
+ throw $e;
+ } else {
+ url::redirect("login/page");
+ }
+ }
$page_size = module::get_var("core", "page_size", 9);
$show = $this->input->get("show");