Updates from lnApp

This commit is contained in:
Deon George
2014-02-23 14:54:35 +11:00
parent e2b84fc063
commit 8301c0f6af
10 changed files with 13 additions and 317 deletions

View File

@@ -12,33 +12,6 @@
abstract class Controller_TemplateDefault extends lnApp_Controller_TemplateDefault {
protected $auth_required = TRUE;
// Our acccount object
protected $ao;
public function __construct(Request $request, Response $response) {
$this->template = Config::theme().'/page';
return parent::__construct($request,$response);
}
public function before() {
// If our action doesnt exist, no point processing any further.
if (! method_exists($this,'action_'.Request::current()->action()))
return;
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) OR ! $this->ao->loaded()))
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));
}
parent::before();
}
// @todo To rework
public function after() {
$dc = URL::link('user','welcome/index');