public function __construct() { parent::__construct(); if (Simple_Auth::instance()->logged_in(NULL)) { $this->user = Simple_Auth::instance()->get_user(); } }
public function __construct() { parent::__construct(); if (Simple_Auth::instance()->logged_in(NULL)) { $this->user = Simple_Auth::instance()->get_user(); } $this->template->controller = 'rubros'; }
public function __construct() { parent::__construct(); if (Simple_Auth::instance()->logged_in(NULL)) { $this->user = Simple_Auth::instance()->get_user(); } else { $this->user = "******"; } // if (!isset($_SESSION['cat'])) $_SESSION['cat'] = 0; if (isset($_GET['cat'])) { $_SESSION['cat'] = $_GET['cat']; } if (!isset($_SESSION['localidad'])) { $_SESSION['localidad'] = 0; } if (isset($_GET['localidad'])) { $_SESSION['localidad'] = $_GET['localidad']; } if ($_SESSION['localidad'] != 0) { $this->ciudad = array('localidad_id' => $_SESSION['localidad']); } if (!isset($_SESSION['orden']) or $_SESSION['orden'] == '') { $_SESSION['orden'] = 'fechamodificado'; } if (isset($_GET['orden'])) { $_SESSION['orden'] = $_GET['orden']; } if ($_SESSION['orden'] == 'last') { $_SESSION['orden'] = 'fechamodificado'; } switch ($_SESSION['orden']) { case 'calle': $this->orden = array($_SESSION['orden'] => 'ASC', 'nro' => 'ASC'); break; case 'nombre': $this->orden = array($_SESSION['orden'] => 'ASC'); break; default: $this->orden = array($_SESSION['orden'] => 'DESC'); break; } /*if (isset($_SESSION['orden']) AND $_SESSION['orden']!='fechamodificado' ) { $this->orden = array($_SESSION['orden']=>'ASC'); } else { $_SESSION['orden'] = 'fechamodificado'; $this->orden = array($_SESSION['orden']=>'DESC'); }*/ $this->localidad = ORM::factory('localidad', $_SESSION['localidad']); $this->categoria = ORM::factory('categoria', $_SESSION['cat']); $this->template->controller = 'datos'; }
/** * Listados * Genera los primeros paráetros oara la cración de los listados y luego exportarlos */ public function __construct() { parent::__construct(); if (Simple_Auth::instance()->logged_in(NULL)) { $this->user = Simple_Auth::instance()->get_user(); } else { $this->user = "******"; } // if (!isset($_SESSION['cat'])) $_SESSION['cat'] = 0; if (isset($_GET['cat'])) { $_SESSION['cat'] = $_GET['cat']; } if (isset($_GET['localidad'])) { $_SESSION['localidad'] = $_GET['localidad']; } $this->localidad = ORM::factory('localidad', $_SESSION['localidad'])->select_list(); $this->categoria = ORM::factory('categoria', $_SESSION['cat'])->select_list(); }
public function __construct($id = NULL) { parent::__construct(); //if user id if ($id != NULL and (ctype_digit($id) or is_int($id))) { // try and get a row with this ID $this->load($id); } else { if ($id != NULL and is_string($id)) { // try and get a row with this username/email $this->load($id, Kohana::config('simple_auth.unique')); } else { if ($id != NULL and is_array($id)) { $data = array(Kohana::config('simple_auth.unique') => $id['username'], Kohana::config('simple_auth.password') => Simple_Auth::instance()->hash($id['password'])); $this->load($data); } } } }