Skip to content

Instantly share code, notes, and snippets.

@Javlopez
Created November 10, 2011 05:52
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save Javlopez/1354210 to your computer and use it in GitHub Desktop.
Backend controller access: localhost/kohana1/backend
<?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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment