From a521d9177f5e299d2ff25cc288e59e4bf1398a1b Mon Sep 17 00:00:00 2001 From: Tim Almdal Date: Wed, 11 Mar 2009 13:58:38 +0000 Subject: Force a login if everybody does not have access to the root item. ticket #118. --- core/controllers/albums.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'core') 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"); -- cgit v1.2.3