Throw 501 if AUTH not defined

This commit is contained in:
Deon George 2015-10-16 20:06:38 +11:00
parent 01a370dcf2
commit 87e5de64fe
1 changed files with 3 additions and 0 deletions

View File

@ -72,6 +72,9 @@ abstract class lnApp_Controller_TemplateDefault extends Kohana_Controller_Templa
if (! count($this->secure_actions) OR (! isset($this->secure_actions[Request::current()->action()])))
throw HTTP_Exception::factory(403,'Class has no security defined :class, or no security configured for :method',array(':class'=>get_class($this),':method'=>Request::current()->action()));
if (! array_key_exists('auth',Kohana::modules()))
throw HTTP_Exception::factory(501,'No AUTH Class defined');
$this->ao = Auth::instance()->get_user();
if (! is_null($this->ao) AND (is_string($this->ao)))