@@ -43,15 +43,13 @@ |
||
| 43 | 43 | |
| 44 | 44 | if(is_callable(array($controlador, $metodo))){ |
| 45 | 45 | $metodo = $peticion->getMetodo(); |
| 46 | - } |
|
| 47 | - else{ |
|
| 46 | + } else{ |
|
| 48 | 47 | $metodo = 'index'; |
| 49 | 48 | } |
| 50 | 49 | |
| 51 | 50 | if(isset($args)){ |
| 52 | 51 | call_user_func_array(array($controlador, $metodo), $args); |
| 53 | - } |
|
| 54 | - else{ |
|
| 52 | + } else{ |
|
| 55 | 53 | call_user_func(array($controlador, $metodo)); |
| 56 | 54 | } |
| 57 | 55 | |
@@ -30,33 +30,33 @@ |
||
| 30 | 30 | |
| 31 | 31 | public static function actuar(CFSolicitud $peticion) |
| 32 | 32 | { |
| 33 | - $controlador = $peticion->getControlador() . 'Controlador'; |
|
| 33 | + $controlador = $peticion->getControlador().'Controlador'; |
|
| 34 | 34 | //definimos la ruta al controlador |
| 35 | - $rutaControlador = SITE_ROOT . 'mvc' . DS .'controladores' . DS . $controlador . '.php'; |
|
| 35 | + $rutaControlador = SITE_ROOT.'mvc'.DS.'controladores'.DS.$controlador.'.php'; |
|
| 36 | 36 | $metodo = $peticion->getMetodo(); |
| 37 | 37 | $args = $peticion->getArgumentos(); |
| 38 | 38 | |
| 39 | 39 | //verifcamos que el archivo existe con la funcion de PHP is_readable |
| 40 | - if(is_readable($rutaControlador)){ |
|
| 40 | + if (is_readable($rutaControlador)) { |
|
| 41 | 41 | require_once $rutaControlador; |
| 42 | 42 | $controlador = new $controlador; |
| 43 | 43 | |
| 44 | - if(is_callable(array($controlador, $metodo))){ |
|
| 44 | + if (is_callable(array($controlador, $metodo))) { |
|
| 45 | 45 | $metodo = $peticion->getMetodo(); |
| 46 | 46 | } |
| 47 | - else{ |
|
| 47 | + else { |
|
| 48 | 48 | $metodo = 'index'; |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | - if(isset($args)){ |
|
| 51 | + if (isset($args)) { |
|
| 52 | 52 | call_user_func_array(array($controlador, $metodo), $args); |
| 53 | 53 | } |
| 54 | - else{ |
|
| 54 | + else { |
|
| 55 | 55 | call_user_func(array($controlador, $metodo)); |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | } else { |
| 59 | - header('Location: '. Cf_BASE_URL.'error/'); |
|
| 59 | + header('Location: '.Cf_BASE_URL.'error/'); |
|
| 60 | 60 | } |
| 61 | 61 | } |
| 62 | 62 | } |
| 63 | 63 | \ No newline at end of file |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | $rutaLib = RUTA_LIBS . $libreria . '.php'; |
| 39 | 39 | if(is_readable($rutaLib)){ |
| 40 | 40 | require_once $rutaLib; |
| 41 | - //echo 'libreria cargada'; |
|
| 41 | + //echo 'libreria cargada'; |
|
| 42 | 42 | } |
| 43 | 43 | else { |
| 44 | 44 | throw new Exception("houston tenemos un problema! al cargar libreria"); |
@@ -47,12 +47,12 @@ discard block |
||
| 47 | 47 | |
| 48 | 48 | protected function cargaModelo($modelo){ |
| 49 | 49 | $modelo=$modelo.'Modelo'; |
| 50 | - $rutaMod = RUTA_MOD . $modelo . '.php'; |
|
| 50 | + $rutaMod = RUTA_MOD . $modelo . '.php'; |
|
| 51 | 51 | if(is_readable($rutaMod)){ |
| 52 | 52 | require_once $rutaMod; |
| 53 | 53 | $modelo = new $modelo; |
| 54 | 54 | return $modelo; |
| 55 | - //echo 'modelo cargado'; |
|
| 55 | + //echo 'modelo cargado'; |
|
| 56 | 56 | } |
| 57 | 57 | else { |
| 58 | 58 | //echo $rutaMod; |
@@ -64,10 +64,10 @@ discard block |
||
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | protected function cargaAyudante($ayudante){ |
| 67 | - $rutaAyudante = RUTA_AYUDANTES . $ayudante . '.php'; |
|
| 67 | + $rutaAyudante = RUTA_AYUDANTES . $ayudante . '.php'; |
|
| 68 | 68 | if(is_readable($rutaAyudante)){ |
| 69 | 69 | require_once $rutaAyudante; |
| 70 | - //echo 'libreria cargada'; |
|
| 70 | + //echo 'libreria cargada'; |
|
| 71 | 71 | } |
| 72 | 72 | else { |
| 73 | 73 | throw new Exception("houston tenemos un problema! al cargar ayudante"); |
@@ -39,8 +39,7 @@ discard block |
||
| 39 | 39 | if(is_readable($rutaLib)){ |
| 40 | 40 | require_once $rutaLib; |
| 41 | 41 | //echo 'libreria cargada'; |
| 42 | - } |
|
| 43 | - else { |
|
| 42 | + } else { |
|
| 44 | 43 | throw new Exception("houston tenemos un problema! al cargar libreria"); |
| 45 | 44 | } |
| 46 | 45 | } |
@@ -53,8 +52,7 @@ discard block |
||
| 53 | 52 | $modelo = new $modelo; |
| 54 | 53 | return $modelo; |
| 55 | 54 | //echo 'modelo cargado'; |
| 56 | - } |
|
| 57 | - else { |
|
| 55 | + } else { |
|
| 58 | 56 | //echo $rutaMod; |
| 59 | 57 | |
| 60 | 58 | |
@@ -68,8 +66,7 @@ discard block |
||
| 68 | 66 | if(is_readable($rutaAyudante)){ |
| 69 | 67 | require_once $rutaAyudante; |
| 70 | 68 | //echo 'libreria cargada'; |
| 71 | - } |
|
| 72 | - else { |
|
| 69 | + } else { |
|
| 73 | 70 | throw new Exception("houston tenemos un problema! al cargar ayudante"); |
| 74 | 71 | } |
| 75 | 72 | } |
@@ -34,9 +34,9 @@ discard block |
||
| 34 | 34 | $this->_vista = new CFVista(new CFSolicitud); |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | - protected function cargaLib($libreria){ |
|
| 38 | - $rutaLib = RUTA_LIBS . $libreria . '.php'; |
|
| 39 | - if(is_readable($rutaLib)){ |
|
| 37 | + protected function cargaLib($libreria) { |
|
| 38 | + $rutaLib = RUTA_LIBS.$libreria.'.php'; |
|
| 39 | + if (is_readable($rutaLib)) { |
|
| 40 | 40 | require_once $rutaLib; |
| 41 | 41 | //echo 'libreria cargada'; |
| 42 | 42 | } |
@@ -45,10 +45,10 @@ discard block |
||
| 45 | 45 | } |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | - protected function cargaModelo($modelo){ |
|
| 49 | - $modelo=$modelo.'Modelo'; |
|
| 50 | - $rutaMod = RUTA_MOD . $modelo . '.php'; |
|
| 51 | - if(is_readable($rutaMod)){ |
|
| 48 | + protected function cargaModelo($modelo) { |
|
| 49 | + $modelo = $modelo.'Modelo'; |
|
| 50 | + $rutaMod = RUTA_MOD.$modelo.'.php'; |
|
| 51 | + if (is_readable($rutaMod)) { |
|
| 52 | 52 | require_once $rutaMod; |
| 53 | 53 | $modelo = new $modelo; |
| 54 | 54 | return $modelo; |
@@ -63,9 +63,9 @@ discard block |
||
| 63 | 63 | } |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | - protected function cargaAyudante($ayudante){ |
|
| 67 | - $rutaAyudante = RUTA_AYUDANTES . $ayudante . '.php'; |
|
| 68 | - if(is_readable($rutaAyudante)){ |
|
| 66 | + protected function cargaAyudante($ayudante) { |
|
| 67 | + $rutaAyudante = RUTA_AYUDANTES.$ayudante.'.php'; |
|
| 68 | + if (is_readable($rutaAyudante)) { |
|
| 69 | 69 | require_once $rutaAyudante; |
| 70 | 70 | //echo 'libreria cargada'; |
| 71 | 71 | } |
@@ -42,8 +42,7 @@ |
||
| 42 | 42 | include_once SITE_ROOT . 'mvc/vistas' . DS . ADICIONALES_VISTA . DS . 'encabezado.php'; |
| 43 | 43 | include_once $ver_ruta; |
| 44 | 44 | include_once SITE_ROOT . 'mvc/vistas' . DS . ADICIONALES_VISTA . DS . 'pie_de_pagina.php'; |
| 45 | - } |
|
| 46 | - else { |
|
| 45 | + } else { |
|
| 47 | 46 | |
| 48 | 47 | header('Location: '. Cf_BASE_URL.'error/index'.'?error='.'vista' ); |
| 49 | 48 | |
@@ -36,16 +36,16 @@ |
||
| 36 | 36 | public function imprimirVista($vista, $item = false) |
| 37 | 37 | { |
| 38 | 38 | |
| 39 | - $ver_ruta = VIEW_PATH . $this->_controlador . DS . $vista . '.phtml'; |
|
| 39 | + $ver_ruta = VIEW_PATH.$this->_controlador.DS.$vista.'.phtml'; |
|
| 40 | 40 | |
| 41 | - if(is_readable($ver_ruta)){ |
|
| 42 | - include_once SITE_ROOT . 'mvc/vistas' . DS . ADICIONALES_VISTA . DS . 'encabezado.php'; |
|
| 41 | + if (is_readable($ver_ruta)) { |
|
| 42 | + include_once SITE_ROOT.'mvc/vistas'.DS.ADICIONALES_VISTA.DS.'encabezado.php'; |
|
| 43 | 43 | include_once $ver_ruta; |
| 44 | - include_once SITE_ROOT . 'mvc/vistas' . DS . ADICIONALES_VISTA . DS . 'pie_de_pagina.php'; |
|
| 44 | + include_once SITE_ROOT.'mvc/vistas'.DS.ADICIONALES_VISTA.DS.'pie_de_pagina.php'; |
|
| 45 | 45 | } |
| 46 | 46 | else { |
| 47 | 47 | |
| 48 | - header('Location: '. Cf_BASE_URL.'error/index'.'?error='.'vista' ); |
|
| 48 | + header('Location: '.Cf_BASE_URL.'error/index'.'?error='.'vista'); |
|
| 49 | 49 | |
| 50 | 50 | } |
| 51 | 51 | } |
@@ -61,10 +61,10 @@ discard block |
||
| 61 | 61 | if (isset($_POST['enviar'])&& isset($_POST['option1']) ) { |
| 62 | 62 | |
| 63 | 63 | $datas->insertarDatos( |
| 64 | - $this->_ayuda->filtrarEntero($_POST['id']), |
|
| 65 | - $this->_ayuda->filtrarTexto($_POST['nombre']), |
|
| 66 | - $this->_ayuda->filtrarTexto($_POST['email']), |
|
| 67 | - $this->_ayuda->filtrarTexto($_POST['comentario']) |
|
| 64 | + $this->_ayuda->filtrarEntero($_POST['id']), |
|
| 65 | + $this->_ayuda->filtrarTexto($_POST['nombre']), |
|
| 66 | + $this->_ayuda->filtrarTexto($_POST['email']), |
|
| 67 | + $this->_ayuda->filtrarTexto($_POST['comentario']) |
|
| 68 | 68 | ); |
| 69 | 69 | echo $this->_ayuda->filtrarEntero('id'); |
| 70 | 70 | $_POST['option1']=false; |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | |
| 76 | 76 | public function insertarComentario(){ |
| 77 | 77 | |
| 78 | - /*$this->_vista->titulo = 'Registro CalimaFramework'; |
|
| 78 | + /*$this->_vista->titulo = 'Registro CalimaFramework'; |
|
| 79 | 79 | if(isset($_GET['titulo'])){ |
| 80 | 80 | $this->_vista->salida_campo = $_GET['titulo']; |
| 81 | 81 | } |
@@ -19,46 +19,46 @@ discard block |
||
| 19 | 19 | $this->_ayuda = new Sistema\Ayudantes\CFPHPAyuda(); |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | - public function index(){ |
|
| 22 | + public function index() { |
|
| 23 | 23 | $datas = $this->cargaModelo('blog'); |
| 24 | 24 | |
| 25 | - $this->_vista->postear= $datas->llamarDatosBlog(); |
|
| 26 | - $this->_vista->categorias= $datas->llamarDatosCategoria(); |
|
| 27 | - $this->_vista->tags= $datas->llamarDatosTags(); |
|
| 25 | + $this->_vista->postear = $datas->llamarDatosBlog(); |
|
| 26 | + $this->_vista->categorias = $datas->llamarDatosCategoria(); |
|
| 27 | + $this->_vista->tags = $datas->llamarDatosTags(); |
|
| 28 | 28 | $this->_vista->titulo = 'Blog Calima Framework'; |
| 29 | 29 | $this->_vista->imprimirVista('index', 'blog'); |
| 30 | 30 | |
| 31 | 31 | } |
| 32 | - public function crearpost(){ |
|
| 32 | + public function crearpost() { |
|
| 33 | 33 | $datas = $this->cargaModelo('blog'); |
| 34 | 34 | |
| 35 | - $this->_vista->postear= $datas->llamarDatosBlog(); |
|
| 35 | + $this->_vista->postear = $datas->llamarDatosBlog(); |
|
| 36 | 36 | $this->_vista->titulo = 'Blog Calima Framework crear post'; |
| 37 | 37 | $this->_vista->imprimirVista('crearpost', 'blog'); |
| 38 | 38 | |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | - public function wikipost(){ |
|
| 41 | + public function wikipost() { |
|
| 42 | 42 | $datas = $this->cargaModelo('blog'); |
| 43 | 43 | |
| 44 | - $this->_vista->postear= $datas->llamarDatosBlog(); |
|
| 45 | - $this->_vista->tags= $datas->llamarDatosTags(); |
|
| 46 | - $this->_vista->comentarios= $datas->llamarComentarios(); |
|
| 47 | - $this->_vista->categorias= $datas->llamarDatosCategoria(); |
|
| 48 | - $this->_vista->contar= $datas->contarComentarios($_GET['id']); |
|
| 49 | - $this->_vista->video= $datas->llamarDatosBlogId($_GET['id']); |
|
| 44 | + $this->_vista->postear = $datas->llamarDatosBlog(); |
|
| 45 | + $this->_vista->tags = $datas->llamarDatosTags(); |
|
| 46 | + $this->_vista->comentarios = $datas->llamarComentarios(); |
|
| 47 | + $this->_vista->categorias = $datas->llamarDatosCategoria(); |
|
| 48 | + $this->_vista->contar = $datas->contarComentarios($_GET['id']); |
|
| 49 | + $this->_vista->video = $datas->llamarDatosBlogId($_GET['id']); |
|
| 50 | 50 | $this->_vista->titulo = 'Blog 1 Calima Framework'; |
| 51 | 51 | $this->_vista->imprimirVista('wikipost', 'blog'); |
| 52 | 52 | |
| 53 | 53 | |
| 54 | 54 | $this->_vista->titulo = 'Registro CalimaFramework'; |
| 55 | - if(isset($_GET['titulo'])){ |
|
| 55 | + if (isset($_GET['titulo'])) { |
|
| 56 | 56 | $this->_vista->salida_campo = $_GET['titulo']; |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | $this->_vista->imprimirVista('wikipost', 'blog'); |
| 60 | 60 | //$datas = $this->cargaModelo('blog'); |
| 61 | - if (isset($_POST['enviar'])&& isset($_POST['option1']) ) { |
|
| 61 | + if (isset($_POST['enviar']) && isset($_POST['option1'])) { |
|
| 62 | 62 | |
| 63 | 63 | $datas->insertarDatos( |
| 64 | 64 | $this->_ayuda->filtrarEntero($_POST['id']), |
@@ -67,13 +67,13 @@ discard block |
||
| 67 | 67 | $this->_ayuda->filtrarTexto($_POST['comentario']) |
| 68 | 68 | ); |
| 69 | 69 | echo $this->_ayuda->filtrarEntero('id'); |
| 70 | - $_POST['option1']=false; |
|
| 70 | + $_POST['option1'] = false; |
|
| 71 | 71 | |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | - public function insertarComentario(){ |
|
| 76 | + public function insertarComentario() { |
|
| 77 | 77 | |
| 78 | 78 | /*$this->_vista->titulo = 'Registro CalimaFramework'; |
| 79 | 79 | if(isset($_GET['titulo'])){ |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | |
| 38 | 38 | |
| 39 | 39 | |
| 40 | - if (isset($_POST['email'])) { |
|
| 40 | + if (isset($_POST['email'])) { |
|
| 41 | 41 | $para="[email protected]"; |
| 42 | 42 | $this->_ayuda->enviarCorreo( |
| 43 | 43 | $_POST['email'], |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | |
| 11 | 11 | // cargamos la clase ayudantes para usar sus metodos de ayuda |
| 12 | 12 | |
| 13 | - $this->_ayuda= new Sistema\Ayudantes\CFPHPAyuda(); |
|
| 13 | + $this->_ayuda = new Sistema\Ayudantes\CFPHPAyuda(); |
|
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | public function index() |
@@ -19,8 +19,8 @@ discard block |
||
| 19 | 19 | $this->_vista->imprimirVista('index', 'inicio'); |
| 20 | 20 | |
| 21 | 21 | if (isset($_POST['email'])) { |
| 22 | - $this->_vista->validar=1; |
|
| 23 | - $para="[email protected]"; |
|
| 22 | + $this->_vista->validar = 1; |
|
| 23 | + $para = "[email protected]"; |
|
| 24 | 24 | $this->_ayuda->enviarCorreo( |
| 25 | 25 | $_POST['email'], |
| 26 | 26 | $this->_ayuda->filtrarTexto($_POST['asunto']), |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | |
| 39 | 39 | |
| 40 | 40 | if (isset($_POST['email'])) { |
| 41 | - $para="[email protected]"; |
|
| 41 | + $para = "[email protected]"; |
|
| 42 | 42 | $this->_ayuda->enviarCorreo( |
| 43 | 43 | $_POST['email'], |
| 44 | 44 | $this->_ayuda->filtrarTexto($_POST['asunto']), |
@@ -6,16 +6,16 @@ |
||
| 6 | 6 | * and open the template in the editor. |
| 7 | 7 | */ |
| 8 | 8 | |
| 9 | -class errorControlador extends \Sistema\Nucleo\CFControlador{ |
|
| 9 | +class errorControlador extends \Sistema\Nucleo\CFControlador { |
|
| 10 | 10 | |
| 11 | 11 | public function __construct() { |
| 12 | 12 | parent::__construct(); |
| 13 | 13 | } |
| 14 | 14 | |
| 15 | - public function index(){ |
|
| 15 | + public function index() { |
|
| 16 | 16 | |
| 17 | - $this->_vista->titulo="Error detectado"; |
|
| 18 | - $this->_vista->imprimirVista('index','error'); |
|
| 17 | + $this->_vista->titulo = "Error detectado"; |
|
| 18 | + $this->_vista->imprimirVista('index', 'error'); |
|
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | } |
| 22 | 22 | \ No newline at end of file |
@@ -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(); |
@@ -65,7 +65,7 @@ |
||
| 65 | 65 | $this->_vista->imprimirVista('index', 'instalador'); |
| 66 | 66 | $this->_sesion->iniciarSesion('_s', false); |
| 67 | 67 | |
| 68 | - }elseif (Cf_CONFIG_INICIO=='false') { |
|
| 68 | + } elseif (Cf_CONFIG_INICIO=='false') { |
|
| 69 | 69 | |
| 70 | 70 | $this->_vista->titulo = 'CalimaFramework'; |
| 71 | 71 | $this->_vista->imprimirVista('index', 'instalador'); |
@@ -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,13 +59,13 @@ 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 | |
| 64 | 64 | $this->_vista->titulo = 'CalimaFramework'; |
| 65 | 65 | $this->_vista->imprimirVista('index', 'instalador'); |
| 66 | 66 | $this->_sesion->iniciarSesion('_s', false); |
| 67 | 67 | |
| 68 | - }elseif (Cf_CONFIG_INICIO=='false') { |
|
| 68 | + }elseif (Cf_CONFIG_INICIO == 'false') { |
|
| 69 | 69 | |
| 70 | 70 | $this->_vista->titulo = 'CalimaFramework'; |
| 71 | 71 | $this->_vista->imprimirVista('index', 'instalador'); |
@@ -38,13 +38,13 @@ discard block |
||
| 38 | 38 | $nombre=$_POST['nombre']; |
| 39 | 39 | $email=$_POST['email']; |
| 40 | 40 | $usuario=$_POST['nombre']; |
| 41 | - $clave=$this->_seg->cifrado($this->_seg->filtrarTexto($_POST['clave'])); |
|
| 41 | + $clave=$this->_seg->cifrado($this->_seg->filtrarTexto($_POST['clave'])); |
|
| 42 | 42 | |
| 43 | - $datas->insertarRegistro( |
|
| 44 | - $this->_seg->filtrarTexto($_POST['nombre']), |
|
| 45 | - $this->_seg->filtrarTexto($_POST['email']), |
|
| 46 | - '1', |
|
| 47 | - $clave |
|
| 43 | + $datas->insertarRegistro( |
|
| 44 | + $this->_seg->filtrarTexto($_POST['nombre']), |
|
| 45 | + $this->_seg->filtrarTexto($_POST['email']), |
|
| 46 | + '1', |
|
| 47 | + $clave |
|
| 48 | 48 | ); |
| 49 | 49 | $this->_ayuda->redireccionUrl('usuario'); |
| 50 | 50 | //$_POST['option1']=false; |
@@ -67,12 +67,12 @@ discard block |
||
| 67 | 67 | $_SESSION['usuario']=$usuario; |
| 68 | 68 | $this->_ayuda->redireccionUrl('index'); |
| 69 | 69 | } |
| 70 | - $this->_ayuda->redireccionUrl('usuario'); |
|
| 70 | + $this->_ayuda->redireccionUrl('usuario'); |
|
| 71 | 71 | |
| 72 | 72 | } |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | - public function cerrarSesion(){ |
|
| 75 | + public function cerrarSesion(){ |
|
| 76 | 76 | $this->_sesion->iniciarSesion('_s', false); |
| 77 | 77 | session_destroy(); |
| 78 | 78 | $this->_sesion->destruir('usuario'); |
@@ -48,8 +48,7 @@ |
||
| 48 | 48 | ); |
| 49 | 49 | $this->_ayuda->redireccionUrl('usuario'); |
| 50 | 50 | //$_POST['option1']=false; |
| 51 | - } |
|
| 52 | - else{ |
|
| 51 | + } else{ |
|
| 53 | 52 | $this->_ayuda->redireccionUrl('usuario/registro'); |
| 54 | 53 | } |
| 55 | 54 | } |
@@ -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'); |
@@ -13,67 +13,67 @@ |
||
| 13 | 13 | parent::__construct(); |
| 14 | 14 | } |
| 15 | 15 | |
| 16 | - public function insertarDatos($id_blog, $nombre, $email, $comentario){ |
|
| 16 | + public function insertarDatos($id_blog, $nombre, $email, $comentario) { |
|
| 17 | 17 | |
| 18 | - $post=$this->_bd->consulta('INSERT INTO comentarios (id_blog, nombre, email, comentario) VALUES (:id_blog, :nombre, :email, :comentario)'); |
|
| 19 | - $post=$this->_bd->enlace(':id_blog', $id_blog); |
|
| 20 | - $post=$this->_bd->enlace(':nombre',$nombre); |
|
| 21 | - $post=$this->_bd->enlace(':email', $email); |
|
| 22 | - $post=$this->_bd->enlace(':comentario', $comentario); |
|
| 23 | - $post=$this->_bd->ejecucion(); |
|
| 24 | - return $post=$this->_bd->resultset(); |
|
| 18 | + $post = $this->_bd->consulta('INSERT INTO comentarios (id_blog, nombre, email, comentario) VALUES (:id_blog, :nombre, :email, :comentario)'); |
|
| 19 | + $post = $this->_bd->enlace(':id_blog', $id_blog); |
|
| 20 | + $post = $this->_bd->enlace(':nombre', $nombre); |
|
| 21 | + $post = $this->_bd->enlace(':email', $email); |
|
| 22 | + $post = $this->_bd->enlace(':comentario', $comentario); |
|
| 23 | + $post = $this->_bd->ejecucion(); |
|
| 24 | + return $post = $this->_bd->resultset(); |
|
| 25 | 25 | |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | - public function llamarDatosCategoria(){ |
|
| 28 | + public function llamarDatosCategoria() { |
|
| 29 | 29 | //echo DB_HOST; |
| 30 | - $cate=$this->_bd->consulta('select * from categoria '); |
|
| 31 | - return $cate=$this->_bd->resultset();//=$this->_bd->resultset();$post->fetchall(); |
|
| 30 | + $cate = $this->_bd->consulta('select * from categoria '); |
|
| 31 | + return $cate = $this->_bd->resultset(); //=$this->_bd->resultset();$post->fetchall(); |
|
| 32 | 32 | |
| 33 | 33 | |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - public function llamarDatosTags(){ |
|
| 36 | + public function llamarDatosTags() { |
|
| 37 | 37 | //echo DB_HOST; |
| 38 | - $post=$this->_bd->consulta('select * from tags '); |
|
| 39 | - return $post=$this->_bd->resultset();//=$this->_bd->resultset();$post->fetchall(); |
|
| 38 | + $post = $this->_bd->consulta('select * from tags '); |
|
| 39 | + return $post = $this->_bd->resultset(); //=$this->_bd->resultset();$post->fetchall(); |
|
| 40 | 40 | |
| 41 | 41 | |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | |
| 45 | - public function llamarDatosBlog(){ |
|
| 45 | + public function llamarDatosBlog() { |
|
| 46 | 46 | //echo DB_HOST; |
| 47 | - $post=$this->_bd->consulta('select * from blog '); |
|
| 48 | - return $post=$this->_bd->resultset();//=$this->_bd->resultset();$post->fetchall(); |
|
| 47 | + $post = $this->_bd->consulta('select * from blog '); |
|
| 48 | + return $post = $this->_bd->resultset(); //=$this->_bd->resultset();$post->fetchall(); |
|
| 49 | 49 | |
| 50 | 50 | |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | - public function llamarDatosBlogId($id){ |
|
| 53 | + public function llamarDatosBlogId($id) { |
|
| 54 | 54 | //echo DB_HOST; |
| 55 | - $idvideo=$id; |
|
| 56 | - $datosQuery="select idvideo from blog where id = :idvideo"; |
|
| 57 | - $gsent=$this->_bd->consulta('SELECT idvideo FROM blog WHERE id = :idvideo'); |
|
| 58 | - $gsent=$this->_bd->enlace(':idvideo', $idvideo); |
|
| 55 | + $idvideo = $id; |
|
| 56 | + $datosQuery = "select idvideo from blog where id = :idvideo"; |
|
| 57 | + $gsent = $this->_bd->consulta('SELECT idvideo FROM blog WHERE id = :idvideo'); |
|
| 58 | + $gsent = $this->_bd->enlace(':idvideo', $idvideo); |
|
| 59 | 59 | //$gsent=$this->_bd->ejecucion(); |
| 60 | - $row = $gsent=$this->_bd->single(); |
|
| 60 | + $row = $gsent = $this->_bd->single(); |
|
| 61 | 61 | return $row; |
| 62 | 62 | |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | - public function llamarComentarios(){ |
|
| 65 | + public function llamarComentarios() { |
|
| 66 | 66 | //echo DB_HOST; |
| 67 | - $post=$this->_bd->consulta('select * from comentarios '); |
|
| 68 | - return $post=$this->_bd->resultset();//=$this->_bd->resultset();$post->fetchall(); |
|
| 67 | + $post = $this->_bd->consulta('select * from comentarios '); |
|
| 68 | + return $post = $this->_bd->resultset(); //=$this->_bd->resultset();$post->fetchall(); |
|
| 69 | 69 | |
| 70 | 70 | |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | - public function contarComentarios($id){ |
|
| 73 | + public function contarComentarios($id) { |
|
| 74 | 74 | //echo DB_HOST; |
| 75 | - $post=$this->_bd->consulta('SELECT COUNT(*) FROM comentarios'); |
|
| 76 | - return $post=$this->_bd->resultset();//=$this->_bd->resultset();$post->fetchall(); |
|
| 75 | + $post = $this->_bd->consulta('SELECT COUNT(*) FROM comentarios'); |
|
| 76 | + return $post = $this->_bd->resultset(); //=$this->_bd->resultset();$post->fetchall(); |
|
| 77 | 77 | |
| 78 | 78 | |
| 79 | 79 | } |