Replace $this->stop() with proper exceptions

This commit is contained in:
Kijin Sung 2018-09-06 00:19:47 +09:00
parent 5b7ce90a3d
commit d8a0773b97
26 changed files with 109 additions and 69 deletions

View file

@ -18,11 +18,9 @@ class adminAdminController extends admin
function init()
{
// forbit access if the user is not an administrator
$oMemberModel = getModel('member');
$logged_info = $oMemberModel->getLoggedInfo();
if($logged_info->is_admin != 'Y')
if (!$this->user->isAdmin())
{
return $this->stop("admin.msg_is_not_administrator");
throw new Rhymix\Framework\Exceptions\NotPermitted('admin.msg_is_not_administrator');
}
}