Some minor internal fixes
This commit is contained in:
@@ -68,7 +68,15 @@ abstract class lnApp_Controller_TemplateDefault extends Kohana_Controller_Templa
|
||||
* @uses meta
|
||||
*/
|
||||
public function before() {
|
||||
$this->ao = Auth::instance()->get_user();
|
||||
if ($this->auth_required) {
|
||||
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()));
|
||||
|
||||
$this->ao = Auth::instance()->get_user();
|
||||
|
||||
if (! is_null($this->ao) AND (is_string($this->ao)))
|
||||
throw HTTP_Exception::factory(501,'Account doesnt exist :account ?',array(':account'=>(is_string($this->ao) OR is_null($this->ao)) ? $this->ao : Auth::instance()->get_user()->id));
|
||||
}
|
||||
|
||||
// Actions that start with ajax, should only be ajax
|
||||
if (! Kohana::$config->load('debug')->ajax AND preg_match('/^ajax/',Request::current()->action()) AND ! Request::current()->is_ajax())
|
||||
@@ -82,7 +90,7 @@ abstract class lnApp_Controller_TemplateDefault extends Kohana_Controller_Templa
|
||||
return;
|
||||
}
|
||||
|
||||
if ($this->ao AND $this->ao->loaded() AND ! $this->ao->activated() AND ($this->request->controller() != 'Account' OR $this->request->action() != 'activate'))
|
||||
if ($this->ao AND is_object($this->ao) AND $this->ao->loaded() AND ! $this->ao->activated() AND ($this->request->controller() != 'Account' OR $this->request->action() != 'activate'))
|
||||
HTTP::redirect('login/activate');
|
||||
|
||||
// Check user auth and role
|
||||
|
Reference in New Issue
Block a user