Make logging in mandatory.
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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']))
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -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']))
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user