Backend controller access: localhost/kohana1/backend
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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