diff --git a/controllers/Login.php b/controllers/Login.php index 2272d959..b75c0b95 100644 --- a/controllers/Login.php +++ b/controllers/Login.php @@ -13,10 +13,7 @@ class Login extends HTMLController // No need to log in twice, dear heart! if (Registry::get('user')->isLoggedIn()) { - if (Registry::get('user')->isAdmin()) - header('Location: ' . BASEURL . '/admin/'); - else - header('Location: ' . BASEURL . '/'); + header('Location: ' . BASEURL . '/'); exit; } @@ -41,7 +38,7 @@ class Login extends HTMLController $login_error = true; } - parent::__construct('Log in'); + parent::__construct('Log in - ' . SITE_TITLE); $this->page->appendStylesheet(BASEURL . '/css/admin.css'); $form = new LogInForm('Log in'); if ($login_error) diff --git a/controllers/ProvideAutoSuggest.php b/controllers/ProvideAutoSuggest.php index eb2a97e0..4424d003 100644 --- a/controllers/ProvideAutoSuggest.php +++ b/controllers/ProvideAutoSuggest.php @@ -10,8 +10,8 @@ class ProvideAutoSuggest extends JSONController { public function __construct() { - // Ensure it's just admins at this point. - if (!Registry::get('user')->isAdmin()) + // Ensure we're logged in at this point. + if (!Registry::get('user')->isLoggedIn()) throw new NotAllowedException(); if (!isset($_GET['type'])) diff --git a/controllers/ViewPeople.php b/controllers/ViewPeople.php index 5d554a73..bf7d8ba4 100644 --- a/controllers/ViewPeople.php +++ b/controllers/ViewPeople.php @@ -12,6 +12,10 @@ class ViewPeople extends HTMLController public function __construct() { + // Ensure we're logged in at this point. + if (!Registry::get('user')->isLoggedIn()) + throw new NotAllowedException(); + $page = isset($_GET['page']) ? (int) $_GET['page'] : 1; $start = ($page - 1) * self::PER_PAGE; $total_count = Tag::getCount(1, 'Person'); diff --git a/controllers/ViewPhotoAlbum.php b/controllers/ViewPhotoAlbum.php index afbb7ff7..a58ff4e7 100644 --- a/controllers/ViewPhotoAlbum.php +++ b/controllers/ViewPhotoAlbum.php @@ -16,6 +16,10 @@ class ViewPhotoAlbum extends HTMLController public function __construct($title = 'Photos - ' . SITE_TITLE) { + // Ensure we're logged in at this point. + if (!Registry::get('user')->isLoggedIn()) + throw new NotAllowedException(); + // Viewing an album? if (isset($_GET['tag'])) { diff --git a/controllers/ViewTimeline.php b/controllers/ViewTimeline.php index 1a5c8f18..3aa29b9d 100644 --- a/controllers/ViewTimeline.php +++ b/controllers/ViewTimeline.php @@ -16,6 +16,10 @@ class ViewTimeline extends HTMLController public function __construct($title = 'Photos - ' . SITE_TITLE) { + // Ensure we're logged in at this point. + if (!Registry::get('user')->isLoggedIn()) + throw new NotAllowedException(); + // What page are we at? $page = isset($_GET['page']) ? (int) $_GET['page'] : 1; diff --git a/public/css/admin.css b/public/css/admin.css index 852a9f58..4e58d3ea 100644 --- a/public/css/admin.css +++ b/public/css/admin.css @@ -56,44 +56,6 @@ body { text-decoration: underline; } -/* Login box styles ----------------------*/ - -#login { - background: #fff; - border: 1px solid #aaa; - border-radius: 10px; - box-shadow: 2px 2px 4px rgba(0,0,0,0.1); - margin: 0 auto; - padding: 15px; - width: 275px; -} -#login * { - font-size: 15px; - line-height: 35px; -} -#login h3 { - font: 700 24px/36px "Open Sans", sans-serif; - margin: 0; -} -#login dd { - width: 96%; - margin: 0 0 10px; -} -#login input { - background: #eee; - border: 1px solid #aaa; - border-radius: 3px; - padding: 4px 5px; - width: 100%; -} -#login div { - text-align: right; -} -#login button { - line-height: 20px; -} - /* (Tag) autosuggest ----------------------*/ diff --git a/public/css/default.css b/public/css/default.css index 5f38a876..40d5fc99 100644 --- a/public/css/default.css +++ b/public/css/default.css @@ -352,6 +352,49 @@ textarea { } +/* Login box styles +---------------------*/ +#login { + background: #fff; + border: 1px solid #aaa; + border-radius: 10px; + box-shadow: 2px 2px 4px rgba(0,0,0,0.1); + margin: 0 auto; + overflow: auto; + padding: 15px; + width: 300px; +} +#login dl *, #login button { + font-size: 15px; + line-height: 35px; +} +#login h3 { + font: 700 24px/36px "Open Sans", sans-serif; + margin: 0; +} +#login dd { + width: 96%; + margin: 0 0 10px; +} +#login input { + background: #eee; + border: 1px solid #aaa; + border-radius: 3px; + padding: 4px 5px; + width: 100%; +} +#login div.alert { + margin: 15px 0; +} +#login div.buttonstrip { + float: right; + padding: 0 0 5px; +} +#login button { + line-height: 20px; +} + + /* Responsive: smartphone in portrait ---------------------------------------*/ @media only screen and (max-width: 895px) { @@ -388,17 +431,6 @@ textarea { padding: 15px 4px; } - .grid li { - margin: 0 0 5%; - width: 47.5%; - } - .grid li:nth-child(2n) { - margin-right: 0 !important; - } - .grid li:nth-child(2n+1) { - margin-right: 5% !important; - } - .tiled_header { font-size: 14px; margin: 0 0 3.5% 0; diff --git a/templates/MainTemplate.php b/templates/MainTemplate.php index 9ade1e4e..83843e3e 100644 --- a/templates/MainTemplate.php +++ b/templates/MainTemplate.php @@ -66,7 +66,7 @@ class MainTemplate extends Template } else echo ' - Powered by Kabuki CMS | Admin'; + Powered by Kabuki CMS'; echo '