@@ -91,9 +91,9 @@ |
||
91 | 91 | define('Cf_KEY_MD5', 'P0L1'); |
92 | 92 | |
93 | 93 | /* en el controlador concatena la constante con el llamado a la funcion generarCadenaAleatoria() de Cf_PHPSeguridad */ |
94 | -define('Cf_CSRF_SECRET','Cfbeta'); |
|
94 | +define('Cf_CSRF_SECRET', 'Cfbeta'); |
|
95 | 95 | |
96 | -define('Cf_SESION_PARAMETRO_SEGURO','false'); |
|
96 | +define('Cf_SESION_PARAMETRO_SEGURO', 'false'); |
|
97 | 97 | |
98 | 98 | /* #base de datos */ |
99 | 99 |
@@ -10,12 +10,12 @@ discard block |
||
10 | 10 | parent::__construct(); |
11 | 11 | |
12 | 12 | // cargamos la clase ayudantes para usar sus metodos de ayuda |
13 | - $this->_ayuda= new Sistema\Ayudantes\CFPHPAyuda; |
|
14 | - $this->_seg= new Sistema\Ayudantes\CFPHPSeguridad; |
|
15 | - $this->_sesion=new Sistema\Nucleo\CFSesion(); |
|
13 | + $this->_ayuda = new Sistema\Ayudantes\CFPHPAyuda; |
|
14 | + $this->_seg = new Sistema\Ayudantes\CFPHPSeguridad; |
|
15 | + $this->_sesion = new Sistema\Nucleo\CFSesion(); |
|
16 | 16 | } |
17 | 17 | |
18 | - public function index(){ |
|
18 | + public function index() { |
|
19 | 19 | $this->_sesion->iniciarSesion('_s', Cf_SESION_PARAMETRO_SEGURO); |
20 | 20 | session_destroy(); |
21 | 21 | $this->_vista->titulo = 'CalimaFramework Login'; |
@@ -23,19 +23,19 @@ discard block |
||
23 | 23 | $this->_vista->imprimirVista('index', 'usuario'); |
24 | 24 | } |
25 | 25 | |
26 | - public function registro(){ |
|
26 | + public function registro() { |
|
27 | 27 | $this->_vista->titulo = 'CalimaFramework registro'; |
28 | 28 | $this->_vista->imprimirVista('registro', 'usuario'); |
29 | 29 | |
30 | 30 | } |
31 | 31 | |
32 | - public function crearRegistro(){ |
|
32 | + public function crearRegistro() { |
|
33 | 33 | $datas = $this->cargaModelo('usuario'); |
34 | - if(isset($_POST['nombre'])){ |
|
35 | - $nombre=$_POST['nombre']; |
|
36 | - $email=$_POST['email']; |
|
37 | - $usuario=$_POST['nombre']; |
|
38 | - $clave=$this->_seg->cifrado($this->_seg->filtrarTexto($_POST['clave'])); |
|
34 | + if (isset($_POST['nombre'])) { |
|
35 | + $nombre = $_POST['nombre']; |
|
36 | + $email = $_POST['email']; |
|
37 | + $usuario = $_POST['nombre']; |
|
38 | + $clave = $this->_seg->cifrado($this->_seg->filtrarTexto($_POST['clave'])); |
|
39 | 39 | |
40 | 40 | $datas->insertarRegistro( |
41 | 41 | $this->_seg->filtrarTexto($_POST['nombre']), |
@@ -45,24 +45,24 @@ discard block |
||
45 | 45 | ); |
46 | 46 | $this->_ayuda->redireccionUrl('usuario'); |
47 | 47 | } |
48 | - else{ |
|
48 | + else { |
|
49 | 49 | $this->_ayuda->redireccionUrl('usuario/registro'); |
50 | 50 | } |
51 | 51 | } |
52 | 52 | |
53 | - public function valida(){ |
|
54 | - if(isset($_POST['usuario'])){ |
|
55 | - $usuario=$_POST['usuario']; |
|
56 | - echo $clave=$this->_seg->cifrado($this->_seg->filtrarTexto($_POST['clave'])); |
|
53 | + public function valida() { |
|
54 | + if (isset($_POST['usuario'])) { |
|
55 | + $usuario = $_POST['usuario']; |
|
56 | + echo $clave = $this->_seg->cifrado($this->_seg->filtrarTexto($_POST['clave'])); |
|
57 | 57 | |
58 | 58 | $datosUser = $this->cargaModelo('usuario'); |
59 | - $valida=$datosUser->seleccionUsuario($usuario, $clave); |
|
59 | + $valida = $datosUser->seleccionUsuario($usuario, $clave); |
|
60 | 60 | |
61 | - if(isset($valida)){ |
|
61 | + if (isset($valida)) { |
|
62 | 62 | $this->_sesion->iniciarSesion('_s', Cf_SESION_PARAMETRO_SEGURO); |
63 | - $_SESSION['usuario']=$usuario; |
|
64 | - $_SESSION['id_usuario']=$valida['id_usuario']; |
|
65 | - $_SESSION['nivel']=$valida['nivel']; |
|
63 | + $_SESSION['usuario'] = $usuario; |
|
64 | + $_SESSION['id_usuario'] = $valida['id_usuario']; |
|
65 | + $_SESSION['nivel'] = $valida['nivel']; |
|
66 | 66 | $this->_ayuda->redireccionUrl('data/index'); |
67 | 67 | } |
68 | 68 | $this->_ayuda->redireccionUrl('usuario'); |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | } |
71 | 71 | } |
72 | 72 | |
73 | - public function cerrarSesion(){ |
|
73 | + public function cerrarSesion() { |
|
74 | 74 | $this->_sesion->iniciarSesion('_s', false); |
75 | 75 | session_destroy(); |
76 | 76 | $this->_sesion->destruir('usuario'); |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | //verificamos la version de php en tu servidor web o local |
28 | 28 | if (version_compare(PHP_VERSION, '5.3.20', '<')) |
29 | 29 | { |
30 | - die('Su Hosting tiene una version < a PHP 5.3.20 debes actualizar para esta version de Calima. su version actual de PHP es: '.PHP_VERSION); |
|
30 | + die('Su Hosting tiene una version < a PHP 5.3.20 debes actualizar para esta version de Calima. su version actual de PHP es: '.PHP_VERSION); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | //Cargamos los Espacios de nombres para el nucleo y los ayudantes |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | |
49 | 49 | $this->_ayuda= new Sisayu\CFPHPAyuda; |
50 | 50 | //$this->cargaAyudante('CfPHPAyuda'); |
51 | - //$this->cargaAyudante('CfPHPSeguridad'); |
|
51 | + //$this->cargaAyudante('CfPHPSeguridad'); |
|
52 | 52 | $this->_seg= new Sisayu\CfPHPSeguridad; |
53 | 53 | |
54 | 54 | $this->_sesion=new Sisnuc\CFSesion(); |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | //verificamos la version de php en tu servidor web o local |
28 | 28 | if (version_compare(PHP_VERSION, '5.3.20', '<')) |
29 | 29 | { |
30 | - die('Su Hosting tiene una version < a PHP 5.3.20 debes actualizar para esta version de Calima. su version actual de PHP es: '.PHP_VERSION); |
|
30 | + die('Su Hosting tiene una version < a PHP 5.3.20 debes actualizar para esta version de Calima. su version actual de PHP es: ' . PHP_VERSION); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | //Cargamos los Espacios de nombres para el nucleo y los ayudantes |
@@ -46,12 +46,12 @@ discard block |
||
46 | 46 | public function __construct() { |
47 | 47 | parent::__construct(); |
48 | 48 | |
49 | - $this->_ayuda= new Sisayu\CFPHPAyuda; |
|
49 | + $this->_ayuda = new Sisayu\CFPHPAyuda; |
|
50 | 50 | //$this->cargaAyudante('CfPHPAyuda'); |
51 | 51 | //$this->cargaAyudante('CfPHPSeguridad'); |
52 | - $this->_seg= new Sisayu\CfPHPSeguridad; |
|
52 | + $this->_seg = new Sisayu\CfPHPSeguridad; |
|
53 | 53 | |
54 | - $this->_sesion=new Sisnuc\CFSesion(); |
|
54 | + $this->_sesion = new Sisnuc\CFSesion(); |
|
55 | 55 | |
56 | 56 | } |
57 | 57 | |
@@ -59,16 +59,16 @@ discard block |
||
59 | 59 | { |
60 | 60 | // Se verifica que en el archivo de configuracion.php la constante Cf_CONFIG_INICIO==true |
61 | 61 | //Si esta en True se lanza el instalador de Cf |
62 | - if(Cf_CONFIG_INICIO==true){ |
|
62 | + if (Cf_CONFIG_INICIO == true) { |
|
63 | 63 | $this->_sesion->iniciarSesion('_s', false); |
64 | - if($_SESSION['nivel']==1){ |
|
64 | + if ($_SESSION['nivel'] == 1) { |
|
65 | 65 | $this->_vista->titulo = 'CalimaFramework'; |
66 | 66 | $this->_vista->imprimirVista('index', 'data'); |
67 | - }else{ |
|
67 | + } else { |
|
68 | 68 | $this->_ayuda->redireccionUrl('usuario'); |
69 | 69 | } |
70 | 70 | |
71 | - }elseif (Cf_CONFIG_INICIO=='false') { |
|
71 | + }elseif (Cf_CONFIG_INICIO == 'false') { |
|
72 | 72 | |
73 | 73 | $this->_vista->titulo = 'CalimaFramework'; |
74 | 74 | $this->_vista->imprimirVista('index', 'data'); |
@@ -64,11 +64,11 @@ |
||
64 | 64 | if($_SESSION['nivel']==1){ |
65 | 65 | $this->_vista->titulo = 'CalimaFramework'; |
66 | 66 | $this->_vista->imprimirVista('index', 'data'); |
67 | - }else{ |
|
67 | + } else{ |
|
68 | 68 | $this->_ayuda->redireccionUrl('usuario'); |
69 | 69 | } |
70 | 70 | |
71 | - }elseif (Cf_CONFIG_INICIO=='false') { |
|
71 | + } elseif (Cf_CONFIG_INICIO=='false') { |
|
72 | 72 | |
73 | 73 | $this->_vista->titulo = 'CalimaFramework'; |
74 | 74 | $this->_vista->imprimirVista('index', 'data'); |