General tidying up

This commit is contained in:
Deon George
2011-08-26 11:16:48 +10:00
parent 8598408a59
commit 1c66acd7e4
19 changed files with 173 additions and 115 deletions

View File

@@ -39,7 +39,7 @@ abstract class Controller_lnApp_TemplateDefault extends Controller_Template {
* @var array actions that require a valid user
*/
protected $secure_actions = array(
'menu' => TRUE,
'menu' => FALSE,
);
/**
@@ -203,7 +203,7 @@ abstract class Controller_lnApp_TemplateDefault extends Controller_Template {
* Default Method to call from the tree menu
*/
public function action_menu() {
$this->template->content = 'See menu on tree';
$this->template->content = _('Please choose from the menu.');
}
protected function _headimages() {

View File

@@ -0,0 +1,15 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* OSB User Main home page controller
*
* @package OSB
* @subpackage Page/Admin
* @category Controllers
* @author Deon George
* @copyright (c) 2010 Deon George
* @license http://dev.leenooks.net/license.html
*/
class Controller_TemplateDefault_Admin extends Controller_TemplateDefault_User {
}
?>

View File

@@ -0,0 +1,30 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* OSB User Main home page controller
*
* @package OSB
* @subpackage Page/User
* @category Controllers
* @author Deon George
* @copyright (c) 2010 Deon George
* @license http://dev.leenooks.net/license.html
*/
class Controller_TemplateDefault_User extends Controller_TemplateDefault {
protected $auth_required = TRUE;
// Our acccount object
protected $ao;
public function before() {
if (! count($this->secure_actions) OR (! isset($this->secure_actions[Request::current()->action()])))
throw new Kohana_Exception('Class has no security defined :class, or no security configured for :method',array(':class'=>get_class($this),':method'=>Request::current()->action()));
parent::before();
$this->ao = ORM::factory('account',Auth::instance()->get_user()->id);
if (! $this->ao->loaded())
throw new Kohana_Exception('Account doesnt exist :account ?',array(':account'=>Auth::instance()->get_user()->id));
}
}
?>