General tidying up
This commit is contained in:
@@ -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() {
|
||||
|
15
application/classes/controller/templatedefault/admin.php
Normal file
15
application/classes/controller/templatedefault/admin.php
Normal 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 {
|
||||
}
|
||||
?>
|
30
application/classes/controller/templatedefault/user.php
Normal file
30
application/classes/controller/templatedefault/user.php
Normal 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));
|
||||
}
|
||||
}
|
||||
?>
|
Reference in New Issue
Block a user