@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | public function verificarBdM($bd,$usuario,$contraseña){ |
| 18 | - try { |
|
| 18 | + try { |
|
| 19 | 19 | $gbd = new PDO("mysql:host=localhost;dbname=".$bd, $usuario, $contraseña); |
| 20 | 20 | $gbd = null; |
| 21 | 21 | return true; |
@@ -52,12 +52,12 @@ discard block |
||
| 52 | 52 | `clave` varchar(60) NOT NULL, |
| 53 | 53 | PRIMARY KEY (`id_usuario`) |
| 54 | 54 | ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;'); |
| 55 | - $this->_bd->ejecucion(); |
|
| 55 | + $this->_bd->ejecucion(); |
|
| 56 | 56 | |
| 57 | - $this->_bd->consulta('CREATE TABLE IF NOT EXISTS `sesion_usuario` ( |
|
| 57 | + $this->_bd->consulta('CREATE TABLE IF NOT EXISTS `sesion_usuario` ( |
|
| 58 | 58 | `id_usuario` int(10) NOT NULL, |
| 59 | 59 | `fecha_sesion` varchar(20) NOT NULL |
| 60 | 60 | ) ENGINE=InnoDB DEFAULT CHARSET=latin1;'); |
| 61 | - $this->_bd->ejecucion(); |
|
| 61 | + $this->_bd->ejecucion(); |
|
| 62 | 62 | } |
| 63 | 63 | } |
| 64 | 64 | \ No newline at end of file |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | parent::__construct(); |
| 15 | 15 | } |
| 16 | 16 | |
| 17 | - public function verificarBdM($bd,$usuario,$contraseña){ |
|
| 17 | + public function verificarBdM($bd, $usuario, $contraseña) { |
|
| 18 | 18 | try { |
| 19 | 19 | $gbd = new PDO("mysql:host=localhost;dbname=".$bd, $usuario, $contraseña); |
| 20 | 20 | $gbd = null; |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | } |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | - public function crearTablas(){ |
|
| 29 | + public function crearTablas() { |
|
| 30 | 30 | |
| 31 | 31 | $this->_bd->consulta('CREATE TABLE IF NOT EXISTS `menu` ( |
| 32 | 32 | `id` int(5) NOT NULL, |
@@ -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 | } |