2011-08-26 01:16:48 +00:00
< ? php defined ( 'SYSPATH' ) or die ( 'No direct access allowed.' );
/**
2011-10-13 06:53:43 +00:00
* lnApp User Main home page controller
2011-08-26 01:16:48 +00:00
*
2011-10-13 06:53:43 +00:00
* @ package lnApp
2011-08-26 01:16:48 +00:00
* @ 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 () {
2012-01-02 01:35:47 +00:00
// If our action doesnt exist, no point processing any further.
if ( ! method_exists ( $this , 'action_' . Request :: current () -> action ()))
return ;
2011-08-26 01:16:48 +00:00
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 ();
2011-12-09 04:10:53 +00:00
$this -> ao = Auth :: instance () -> get_user ();
2011-12-29 23:54:54 +00:00
if ( is_string ( $this -> ao ) OR ! $this -> ao -> loaded ())
throw new Kohana_Exception ( 'Account doesnt exist :account ?' , array ( ':account' => is_string ( $this -> ao ) ? $this -> ao : Auth :: instance () -> get_user () -> id ));
2011-08-26 01:16:48 +00:00
}
2011-12-09 04:10:53 +00:00
public function after () {
$dc = 'welcome/index' ;
$m = sprintf ( '%s/%s' , Request :: current () -> directory (), Request :: current () -> controller ());
Breadcrumb :: URL ( Request :: current () -> directory (), sprintf ( '%s/%s' , Request :: current () -> directory (), $dc ), FALSE );
Breadcrumb :: URL ( $m , method_exists ( $this , 'action_menu' ) ? $m . '/menu' : sprintf ( '%s/%s' , Request :: current () -> directory (), $dc ), FALSE );
parent :: after ();
}
2011-08-26 01:16:48 +00:00
}
?>