@@ -21,7 +21,7 @@ |
||
21 | 21 | |
22 | 22 | } |
23 | 23 | |
24 | - public function seleccionUsuario($email, $clave){ |
|
24 | + public function seleccionUsuario($email, $clave){ |
|
25 | 25 | //echo DB_HOST; |
26 | 26 | |
27 | 27 | //$datosQuery="select usuario, email, nivel from usuarios where usuario = :usuario"; |
@@ -2,47 +2,47 @@ |
||
2 | 2 | class usuarioModelo extends Sistema\Nucleo\CFModelo |
3 | 3 | { |
4 | 4 | |
5 | - function ValidarUsuario($email,$password){ // Consulta Mysql para buscar en la tabla Usuario aquellos usuarios que coincidan con el mail y password ingresados en pantalla de login |
|
6 | - $query = $this->db->where('Usuario',$email); // La consulta se efectúa mediante Active Record. Una manera alternativa, y en lenguaje más sencillo, de generar las consultas Sql. |
|
7 | - $query = $this->db->where('Password',$password); |
|
5 | + function ValidarUsuario($email, $password) { // Consulta Mysql para buscar en la tabla Usuario aquellos usuarios que coincidan con el mail y password ingresados en pantalla de login |
|
6 | + $query = $this->db->where('Usuario', $email); // La consulta se efectúa mediante Active Record. Una manera alternativa, y en lenguaje más sencillo, de generar las consultas Sql. |
|
7 | + $query = $this->db->where('Password', $password); |
|
8 | 8 | $query = $this->db->get('Usuarios'); |
9 | - return $query->row(); // Devolvemos al controlador la fila que coincide con la búsqueda. (FALSE en caso que no existir coincidencias) |
|
9 | + return $query->row(); // Devolvemos al controlador la fila que coincide con la búsqueda. (FALSE en caso que no existir coincidencias) |
|
10 | 10 | } |
11 | 11 | |
12 | - public function insertarUsuario($id_usuario, $nombre, $email, $clave){ |
|
12 | + public function insertarUsuario($id_usuario, $nombre, $email, $clave) { |
|
13 | 13 | |
14 | - $post=$this->_bd->consulta('INSERT INTO comentarios (id_usuario, nombre, email, clave) VALUES (:id_usuario, :nombre, :email, :clave)'); |
|
15 | - $post=$this->_bd->enlace(':id_usuario', $id_usuariio); |
|
16 | - $post=$this->_bd->enlace(':nombre',$nombre); |
|
17 | - $post=$this->_bd->enlace(':email', $email); |
|
18 | - $post=$this->_bd->enlace(':clave', $clave); |
|
19 | - $post=$this->_bd->ejecucion(); |
|
20 | - return $post=$this->_bd->resultset(); |
|
14 | + $post = $this->_bd->consulta('INSERT INTO comentarios (id_usuario, nombre, email, clave) VALUES (:id_usuario, :nombre, :email, :clave)'); |
|
15 | + $post = $this->_bd->enlace(':id_usuario', $id_usuariio); |
|
16 | + $post = $this->_bd->enlace(':nombre', $nombre); |
|
17 | + $post = $this->_bd->enlace(':email', $email); |
|
18 | + $post = $this->_bd->enlace(':clave', $clave); |
|
19 | + $post = $this->_bd->ejecucion(); |
|
20 | + return $post = $this->_bd->resultset(); |
|
21 | 21 | |
22 | 22 | } |
23 | 23 | |
24 | - public function seleccionUsuario($email, $clave){ |
|
24 | + public function seleccionUsuario($email, $clave) { |
|
25 | 25 | //echo DB_HOST; |
26 | 26 | |
27 | 27 | //$datosQuery="select usuario, email, nivel from usuarios where usuario = :usuario"; |
28 | - $gsent=$this->_bd->consulta('select nombre, email, nivel from usuarios where email = :email and clave = :clave'); |
|
29 | - $gsent=$this->_bd->enlace(':email', $email); |
|
30 | - $gsent=$this->_bd->enlace(':clave', $clave); |
|
28 | + $gsent = $this->_bd->consulta('select nombre, email, nivel from usuarios where email = :email and clave = :clave'); |
|
29 | + $gsent = $this->_bd->enlace(':email', $email); |
|
30 | + $gsent = $this->_bd->enlace(':clave', $clave); |
|
31 | 31 | //$gsent=$this->_bd->ejecucion(); |
32 | - $row = $gsent=$this->_bd->single(); |
|
32 | + $row = $gsent = $this->_bd->single(); |
|
33 | 33 | return $row; |
34 | 34 | |
35 | 35 | } |
36 | 36 | |
37 | - public function insertarRegistro($nombre, $email, $nivel, $clave){ |
|
37 | + public function insertarRegistro($nombre, $email, $nivel, $clave) { |
|
38 | 38 | |
39 | - $post=$this->_bd->consulta('INSERT INTO usuarios (nombre, email, nivel, clave) VALUES (:nombre, :email, :nivel, :clave)'); |
|
39 | + $post = $this->_bd->consulta('INSERT INTO usuarios (nombre, email, nivel, clave) VALUES (:nombre, :email, :nivel, :clave)'); |
|
40 | 40 | |
41 | - $post=$this->_bd->enlace(':nombre',$nombre); |
|
42 | - $post=$this->_bd->enlace(':email', $email); |
|
43 | - $post=$this->_bd->enlace(':nivel', $nivel); |
|
44 | - $post=$this->_bd->enlace(':clave', $clave); |
|
45 | - $post=$this->_bd->ejecucion(); |
|
41 | + $post = $this->_bd->enlace(':nombre', $nombre); |
|
42 | + $post = $this->_bd->enlace(':email', $email); |
|
43 | + $post = $this->_bd->enlace(':nivel', $nivel); |
|
44 | + $post = $this->_bd->enlace(':clave', $clave); |
|
45 | + $post = $this->_bd->ejecucion(); |
|
46 | 46 | //return $post=$this->_bd->contarFilas(); |
47 | 47 | |
48 | 48 | } |
@@ -20,7 +20,7 @@ |
||
20 | 20 | </script> |
21 | 21 | <!-- End Google Analytics --> |
22 | 22 | |
23 | - <title><?php if(isset($this->titulo)) echo $this->titulo; ?></title> |
|
23 | + <title><?php if (isset($this->titulo)) echo $this->titulo; ?></title> |
|
24 | 24 | |
25 | 25 | |
26 | 26 |
@@ -20,7 +20,10 @@ |
||
20 | 20 | </script> |
21 | 21 | <!-- End Google Analytics --> |
22 | 22 | |
23 | - <title><?php if(isset($this->titulo)) echo $this->titulo; ?></title> |
|
23 | + <title><?php if(isset($this->titulo)) { |
|
24 | + echo $this->titulo; |
|
25 | +} |
|
26 | +?></title> |
|
24 | 27 | |
25 | 28 | |
26 | 29 |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <!-- Site footer --> |
2 | 2 | |
3 | 3 | |
4 | - <div class="footer fixedCf"> <?php echo CF_AP_CREDITOS; ?> --- Theme Inspinia </div> |
|
4 | + <div class="footer fixedCf"> <?php echo CF_AP_CREDITOS; ?> --- Theme Inspinia </div> |
|
5 | 5 | |
6 | 6 | |
7 | 7 |
@@ -118,7 +118,7 @@ |
||
118 | 118 | $errorMessage = $this->errorMessage; |
119 | 119 | $multiselect = $this->multiselect; |
120 | 120 | |
121 | - return function ($selected) use ($choices, $errorMessage, $multiselect) { |
|
121 | + return function($selected) use ($choices, $errorMessage, $multiselect) { |
|
122 | 122 | // Collapse all spaces. |
123 | 123 | $selectedChoices = str_replace(' ', '', $selected); |
124 | 124 |
@@ -40,7 +40,7 @@ |
||
40 | 40 | { |
41 | 41 | $default = $this->getDefault(); |
42 | 42 | |
43 | - return function ($answer) use ($default) { |
|
43 | + return function($answer) use ($default) { |
|
44 | 44 | if (is_bool($answer)) { |
45 | 45 | return $answer; |
46 | 46 | } |
@@ -268,8 +268,8 @@ |
||
268 | 268 | |
269 | 269 | $command = $this->getMock('TestCommand', array('execute')); |
270 | 270 | $command->expects($this->once()) |
271 | - ->method('execute') |
|
272 | - ->will($this->returnValue('2.3')); |
|
271 | + ->method('execute') |
|
272 | + ->will($this->returnValue('2.3')); |
|
273 | 273 | $exitCode = $command->run(new StringInput(''), new NullOutput()); |
274 | 274 | $this->assertSame(2, $exitCode, '->run() returns integer exit code (casts numeric to int)'); |
275 | 275 | } |
@@ -284,7 +284,7 @@ |
||
284 | 284 | public function testSetCode() |
285 | 285 | { |
286 | 286 | $command = new \TestCommand(); |
287 | - $ret = $command->setCode(function (InputInterface $input, OutputInterface $output) { |
|
287 | + $ret = $command->setCode(function(InputInterface $input, OutputInterface $output) { |
|
288 | 288 | $output->writeln('from the code...'); |
289 | 289 | }); |
290 | 290 | $this->assertEquals($command, $ret, '->setCode() implements a fluent interface'); |
@@ -148,7 +148,7 @@ |
||
148 | 148 | { |
149 | 149 | $progress = $this->getMock('Symfony\Component\Console\Helper\ProgressHelper', array('display')); |
150 | 150 | $progress->expects($this->exactly(4)) |
151 | - ->method('display'); |
|
151 | + ->method('display'); |
|
152 | 152 | |
153 | 153 | $progress->setRedrawFrequency(2); |
154 | 154 |
@@ -589,6 +589,9 @@ |
||
589 | 589 | return new StreamOutput(fopen('php://memory', 'r+', false), $verbosity, $decorated); |
590 | 590 | } |
591 | 591 | |
592 | + /** |
|
593 | + * @param string $expected |
|
594 | + */ |
|
592 | 595 | protected function generateOutput($expected) |
593 | 596 | { |
594 | 597 | $count = substr_count($expected, "\n"); |
@@ -173,7 +173,7 @@ |
||
173 | 173 | $dialog->setHelperSet($helperSet); |
174 | 174 | |
175 | 175 | $error = 'This is not a color!'; |
176 | - $validator = function ($color) use ($error) { |
|
176 | + $validator = function($color) use ($error) { |
|
177 | 177 | if (!in_array($color, array('white', 'black'))) { |
178 | 178 | throw new \InvalidArgumentException($error); |
179 | 179 | } |
@@ -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(); |
@@ -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'); |
@@ -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'); |