Skip to content
Snippets Groups Projects
Commit d2b79c33 authored by Nick Barry's avatar Nick Barry
Browse files

Added admin check and admin phpinfo view

parent 30ad64f4
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,15 @@
class Bulletin_AdminController extends Creq_Controller_Action
{
public function preDispatch()
{
$user = Auth_UserModel::findCurrentUser();
$roles = Auth_GroupModel::findByUser($user);
if (!in_array(1, $roles->getId())) {
throw new Exception('You must be logged in to view this page.');
}
}
public function changeMajorNameAction()
{
$this->view->messages = $this->_helper->getHelper('FlashMessenger')->getMessages();
......@@ -483,6 +492,18 @@ class Bulletin_AdminController extends Creq_Controller_Action
$this->redirect('/bulletin/admin/remove-major');
}
public function appPhpInfoAction()
{
$user = Auth_UserModel::findCurrentUser();
$roles = Auth_GroupModel::findByUser($user);
if (!in_array(1, $roles->getId())) {
throw new Exception('You must be logged in to view this page.');
}
$this->_helper->layout->disableLayout();
$this->view->message = "";
}
protected function getCurrentEditingYear()
{
$currentYear = Zend_Date::now()->get(Zend_Date::YEAR);
......
<?php echo phpinfo(); ?>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment