Front-End Upgrade: New UI Based on Admin LTE.

Closes #673
This commit is contained in:
Dan Cryer 2014-12-02 16:26:55 +00:00
commit 9eeaabc6fe
364 changed files with 51722 additions and 987 deletions

View file

@ -72,10 +72,23 @@ class Controller extends \b8\Controller
return $this->response;
}
/**
* Require that the currently logged in user is an administrator.
* @throws ForbiddenException
*/
protected function requireAdmin()
{
if (!$_SESSION['phpci_user']->getIsAdmin()) {
if (!$this->currentUserIsAdmin()) {
throw new ForbiddenException('You do not have permission to do that.');
}
}
/**
* Check if the currently logged in user is an administrator.
* @return bool
*/
protected function currentUserIsAdmin()
{
return $_SESSION['phpci_user']->getIsAdmin();
}
}