public
Created

Backend controller access: localhost/kohana1/backend

  • Download Gist
backend.php
PHP
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
<?php defined('SYSPATH') or die('No direct script access.');
/**
* Controller_Backend
*
* Este es el backend de una aplicacion que esta usando A1 como metodo de autenticación
*
* @author Javier
* @package Backend
*
*/
class Controller_Backend extends Controller {
 
/**
*
* @var User $auth contains object a1 user
*/
public $auth;
public function before()
{
parent::before();
$this->auth = A1::instance();
if($this->auth->logged_in()=== FALSE)
{
$this->request->redirect(Route::url('default',array('controller' => 'account', 'action' => 'login')));
}
}
public function action_index()
{
$view = View::factory("backend/home")
->set("auth",$this->auth);
$this->response->body($view);
}
 
} // End Welcome

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.