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.'); | |
/** | |
* | |
* Model_Users | |
* | |
* Modelo/entidad de la tabla users | |
* | |
* @author Javier | |
* @package 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<title></title> | |
</head> | |
<body> | |
<div> | |
<h2>Registrarse</h2> | |
<?php if(isset($errors['register'])):?> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<title></title> | |
</head> | |
<body> | |
<div> | |
<h2>Iniciar sesión</h2> | |
<?php if(isset($errors['login'])):?> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<title></title> | |
</head> | |
<body> | |
<div> | |
<p>Bienvenido al sistema <strong><?php echo $auth->get_user()->email; ?></strong></p> | |
<p style="float:right;"> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<title></title> | |
</head> | |
<body> | |
<div> | |
<h3>Ejemplo de uso de A1</h3> | |
<p> |
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.'); | |
class Controller_Example extends Controller { | |
public function action_index() | |
{ | |
$view = View::factory("index") | |
->set("loginurl",Route::url('default',array('controller' => 'backend', 'action' => FALSE))); | |
$this->response->body($view); | |
} |
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_Account | |
* | |
* Aqui estaran las funcionalidades de login y registro | |
* | |
* @author Javier | |
* @package 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 | |
* | |
*/ |
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 | |
//more code | |
/** | |
* Enable modules. Modules are referenced by a relative or absolute path. | |
*/ | |
Kohana::modules(array( | |
// 'auth' => MODPATH.'auth', // Basic authentication | |
// 'cache' => MODPATH.'cache', // Caching with multiple backends | |
// 'codebench' => MODPATH.'codebench', // Benchmarking tool | |
'A1' => MODPATH.'A1', //A1 authentication |
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 | |
return array( | |
'driver' => 'ORM', // orm/jelly/mango/sprig | |
'user_model' => 'user', | |
'cost' => 12, // Bcrypt Cost - any number between 4 and 31 -> higher = stronger hash | |
'cookie' => array( | |
'key' => 'a1_{name}_autologin', |