@@ -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 | } |
@@ -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 | } |
@@ -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 | } |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | private $_argumentos; |
| 33 | 33 | |
| 34 | 34 | public function __construct() { |
| 35 | - if(isset($_GET['url'])){ |
|
| 35 | + if (isset($_GET['url'])) { |
|
| 36 | 36 | $url = filter_input(INPUT_GET, 'url', FILTER_SANITIZE_URL); |
| 37 | 37 | $url = explode('/', $url); |
| 38 | 38 | $url = array_filter($url); |
@@ -46,15 +46,15 @@ discard block |
||
| 46 | 46 | $this->setArgumentos($url); |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | - if(!$this->getControlador()){ |
|
| 49 | + if (!$this->getControlador()) { |
|
| 50 | 50 | $this->setControlador(CONTROLADOR_INICIAL); |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | - if(!$this->getMetodo()){ |
|
| 53 | + if (!$this->getMetodo()) { |
|
| 54 | 54 | $this->setMetodo('index'); |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | - if(null!==($this->getArgumentos())){ |
|
| 57 | + if (null !== ($this->getArgumentos())) { |
|
| 58 | 58 | $this->setArgumentos(array()); |
| 59 | 59 | } |
| 60 | 60 | } |
@@ -76,16 +76,16 @@ discard block |
||
| 76 | 76 | |
| 77 | 77 | public function setControlador($controlador) |
| 78 | 78 | { |
| 79 | - return $this->_controlador=$controlador; |
|
| 79 | + return $this->_controlador = $controlador; |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | public function setMetodo($metodo) |
| 83 | 83 | { |
| 84 | - return $this->_metodo=$metodo; |
|
| 84 | + return $this->_metodo = $metodo; |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | public function setArgumentos($argumento) |
| 88 | 88 | { |
| 89 | - return $this->_argumentos=$argumento; |
|
| 89 | + return $this->_argumentos = $argumento; |
|
| 90 | 90 | } |
| 91 | 91 | } |
@@ -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 | - $clave=$this->_seg->cifrado($this->_seg->filtrarTexto($_POST['clave'])); |
|
| 53 | + public function valida() { |
|
| 54 | + if (isset($_POST['usuario'])) { |
|
| 55 | + $usuario = $_POST['usuario']; |
|
| 56 | + $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'); |
@@ -2,6 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | // autoload.php @generated by Composer |
| 4 | 4 | |
| 5 | -require_once __DIR__ . '/composer' . '/autoload_real.php'; |
|
| 5 | +require_once __DIR__.'/composer'.'/autoload_real.php'; |
|
| 6 | 6 | |
| 7 | 7 | return ComposerAutoloaderInit37b7553aa02ca13cf02c966b49fecf89::getLoader(); |
@@ -6,6 +6,6 @@ |
||
| 6 | 6 | $baseDir = dirname($vendorDir); |
| 7 | 7 | |
| 8 | 8 | return array( |
| 9 | - 'Symfony\\Component\\Console\\' => array($vendorDir . '/symfony/console'), |
|
| 10 | - 'Symfony\\Bridge\\Swiftmailer\\' => array($vendorDir . '/symfony/swiftmailer-bridge'), |
|
| 9 | + 'Symfony\\Component\\Console\\' => array($vendorDir.'/symfony/console'), |
|
| 10 | + 'Symfony\\Bridge\\Swiftmailer\\' => array($vendorDir.'/symfony/swiftmailer-bridge'), |
|
| 11 | 11 | ); |
@@ -344,14 +344,14 @@ discard block |
||
| 344 | 344 | private function findFileWithExtension($class, $ext) |
| 345 | 345 | { |
| 346 | 346 | // PSR-4 lookup |
| 347 | - $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; |
|
| 347 | + $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR).$ext; |
|
| 348 | 348 | |
| 349 | 349 | $first = $class[0]; |
| 350 | 350 | if (isset($this->prefixLengthsPsr4[$first])) { |
| 351 | 351 | foreach ($this->prefixLengthsPsr4[$first] as $prefix => $length) { |
| 352 | 352 | if (0 === strpos($class, $prefix)) { |
| 353 | 353 | foreach ($this->prefixDirsPsr4[$prefix] as $dir) { |
| 354 | - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $length))) { |
|
| 354 | + if (file_exists($file = $dir.DIRECTORY_SEPARATOR.substr($logicalPathPsr4, $length))) { |
|
| 355 | 355 | return $file; |
| 356 | 356 | } |
| 357 | 357 | } |
@@ -361,7 +361,7 @@ discard block |
||
| 361 | 361 | |
| 362 | 362 | // PSR-4 fallback dirs |
| 363 | 363 | foreach ($this->fallbackDirsPsr4 as $dir) { |
| 364 | - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { |
|
| 364 | + if (file_exists($file = $dir.DIRECTORY_SEPARATOR.$logicalPathPsr4)) { |
|
| 365 | 365 | return $file; |
| 366 | 366 | } |
| 367 | 367 | } |
@@ -373,14 +373,14 @@ discard block |
||
| 373 | 373 | . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); |
| 374 | 374 | } else { |
| 375 | 375 | // PEAR-like class name |
| 376 | - $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; |
|
| 376 | + $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR).$ext; |
|
| 377 | 377 | } |
| 378 | 378 | |
| 379 | 379 | if (isset($this->prefixesPsr0[$first])) { |
| 380 | 380 | foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { |
| 381 | 381 | if (0 === strpos($class, $prefix)) { |
| 382 | 382 | foreach ($dirs as $dir) { |
| 383 | - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { |
|
| 383 | + if (file_exists($file = $dir.DIRECTORY_SEPARATOR.$logicalPathPsr0)) { |
|
| 384 | 384 | return $file; |
| 385 | 385 | } |
| 386 | 386 | } |
@@ -390,7 +390,7 @@ discard block |
||
| 390 | 390 | |
| 391 | 391 | // PSR-0 fallback dirs |
| 392 | 392 | foreach ($this->fallbackDirsPsr0 as $dir) { |
| 393 | - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { |
|
| 393 | + if (file_exists($file = $dir.DIRECTORY_SEPARATOR.$logicalPathPsr0)) { |
|
| 394 | 394 | return $file; |
| 395 | 395 | } |
| 396 | 396 | } |
@@ -6,6 +6,6 @@ |
||
| 6 | 6 | $baseDir = dirname($vendorDir); |
| 7 | 7 | |
| 8 | 8 | return array( |
| 9 | - $vendorDir . '/swiftmailer/swiftmailer/lib/swift_required.php', |
|
| 10 | - $vendorDir . '/vrana/notorm/NotORM.php', |
|
| 9 | + $vendorDir.'/swiftmailer/swiftmailer/lib/swift_required.php', |
|
| 10 | + $vendorDir.'/vrana/notorm/NotORM.php', |
|
| 11 | 11 | ); |