Example #1
0
 public function after()
 {
     if ($this->auto_render) {
         $this->template->styles = array('shindig/media/css/screen.css' => 'screen', 'shindig/media/css/style.css' => 'screen');
         $this->template->scripts = array('http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js');
         $this->template->menu = array_merge(array('' => __('Blog')), Shindig::page_menu());
         $this->template->menu_b = array(Route::get('shindig/admin')->uri() => __('Admin'));
     }
     parent::after();
 }
Example #2
0
 public function __construct(Request $request)
 {
     parent::__construct($request);
     if (!Kohana::config('shindig.use_authentication')) {
         // Redirect to the home page
         $this->request->redirect('');
     }
     if ($user = Cookie::get('authorized')) {
         $user = Sprig::factory('user', array('username' => $user))->load();
         if ($user->loaded()) {
             // User is logged in
             $this->user = $user;
             Shindig::$has_auth = TRUE;
         }
     }
     if (!$this->user) {
         // Force the user to login
         $this->request->action = 'login';
     }
 }