@@ -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 |
@@ -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'); |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | //verificamos la version de php en tu servidor web o local |
27 | 27 | if (version_compare(PHP_VERSION, '5.3.20', '<')) |
28 | 28 | { |
29 | - 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); |
|
29 | + 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 | 30 | } |
31 | 31 | |
32 | 32 | |
@@ -45,19 +45,19 @@ discard block |
||
45 | 45 | private $_analytics; |
46 | 46 | public function __construct() { |
47 | 47 | parent::__construct(); |
48 | - $this->_basedatos=$this->cargaModelo('instalador'); |
|
48 | + $this->_basedatos = $this->cargaModelo('instalador'); |
|
49 | 49 | |
50 | - $this->_ayuda= new Sisayu\CFPHPAyuda; |
|
50 | + $this->_ayuda = new Sisayu\CFPHPAyuda; |
|
51 | 51 | } |
52 | 52 | |
53 | - public function index(){ |
|
54 | - $this->_vista->titulo="Instalador de Inicio App"; |
|
55 | - $this->_vista->imprimirVista('index','instalador'); |
|
53 | + public function index() { |
|
54 | + $this->_vista->titulo = "Instalador de Inicio App"; |
|
55 | + $this->_vista->imprimirVista('index', 'instalador'); |
|
56 | 56 | |
57 | 57 | } |
58 | 58 | |
59 | 59 | //metodo para crear la base de datos de inicio de proyecto |
60 | - public function crearBaseDatos(){ |
|
60 | + public function crearBaseDatos() { |
|
61 | 61 | |
62 | 62 | |
63 | 63 | $this->_basedatos->crearTablas(); |
@@ -65,118 +65,118 @@ discard block |
||
65 | 65 | |
66 | 66 | } |
67 | 67 | |
68 | - public function verificarBd(){ |
|
68 | + public function verificarBd() { |
|
69 | 69 | |
70 | - $proyecto=$_POST['proyecto']; |
|
71 | - if(isset($_POST['analytics'])!=''){ |
|
72 | - $this->_analytics="'".$_POST['analytics']."'"; |
|
70 | + $proyecto = $_POST['proyecto']; |
|
71 | + if (isset($_POST['analytics']) != '') { |
|
72 | + $this->_analytics = "'" . $_POST['analytics'] . "'"; |
|
73 | 73 | } |
74 | - $this->_analytics="'"."UA-xxxxxx"."'"; |
|
74 | + $this->_analytics = "'" . "UA-xxxxxx" . "'"; |
|
75 | 75 | |
76 | 76 | |
77 | - $analytics=$this->_analytics; |
|
78 | - $hostbd="'".$_POST['hostbd']."'"; |
|
79 | - $nombrebd="'".$_POST['nombrebd']."'"; |
|
80 | - $usuariobd="'".$_POST['usuariobd']."'"; |
|
81 | - $clavebd="'".$_POST['clavebd']."'"; |
|
82 | - $config="'".$_POST['config']."'"; |
|
77 | + $analytics = $this->_analytics; |
|
78 | + $hostbd = "'" . $_POST['hostbd'] . "'"; |
|
79 | + $nombrebd = "'" . $_POST['nombrebd'] . "'"; |
|
80 | + $usuariobd = "'" . $_POST['usuariobd'] . "'"; |
|
81 | + $clavebd = "'" . $_POST['clavebd'] . "'"; |
|
82 | + $config = "'" . $_POST['config'] . "'"; |
|
83 | 83 | |
84 | - $a= $this->_basedatos->verificarBdM($_POST['nombrebd'],$_POST['usuariobd'],$_POST['clavebd']); |
|
84 | + $a = $this->_basedatos->verificarBdM($_POST['nombrebd'], $_POST['usuariobd'], $_POST['clavebd']); |
|
85 | 85 | |
86 | - if($a){ |
|
86 | + if ($a) { |
|
87 | 87 | |
88 | - $this->paso1($proyecto,$analytics,$hostbd,$nombrebd,$usuariobd,$usuariobd,$clavebd,$config); |
|
89 | - }else{ |
|
88 | + $this->paso1($proyecto, $analytics, $hostbd, $nombrebd, $usuariobd, $usuariobd, $clavebd, $config); |
|
89 | + } else { |
|
90 | 90 | $this->_ayuda->redireccionUrl('instalador?error="Los datos que estas ingresando no coniciden con los de la BD"'); |
91 | 91 | } |
92 | 92 | |
93 | 93 | } |
94 | 94 | |
95 | 95 | |
96 | - public function paso1($proyecto,$analytics,$hostbd,$nombrebd,$usuariobd,$usuariobd,$clavebd,$config){ |
|
96 | + public function paso1($proyecto, $analytics, $hostbd, $nombrebd, $usuariobd, $usuariobd, $clavebd, $config) { |
|
97 | 97 | |
98 | 98 | |
99 | 99 | |
100 | 100 | |
101 | 101 | //$this->crearBaseDatos($_POST['hostbd'],$_POST['nombrebd'],$_POST['usuariobd'],$_POST['clavebd']); |
102 | 102 | //Cf_Configuracion.php |
103 | - $file = fopen(RUTA_NUCLEO."CFConfiguracion.php", "w"); |
|
103 | + $file = fopen(RUTA_NUCLEO . "CFConfiguracion.php", "w"); |
|
104 | 104 | |
105 | - fwrite($file, "<?php " . PHP_EOL.PHP_EOL); |
|
105 | + fwrite($file, "<?php " . PHP_EOL . PHP_EOL); |
|
106 | 106 | |
107 | 107 | fwrite($file, "/* inicio la configuracion*/" . PHP_EOL); |
108 | - fwrite($file, "define('Cf_CONFIG_INICIO', $config);" . PHP_EOL.PHP_EOL); |
|
108 | + fwrite($file, "define('Cf_CONFIG_INICIO', $config);" . PHP_EOL . PHP_EOL); |
|
109 | 109 | |
110 | 110 | fwrite($file, "/* Defino zona horaria*/" . PHP_EOL); |
111 | - fwrite($file, "date_default_timezone_set('America/Bogota');" . PHP_EOL.PHP_EOL); |
|
111 | + fwrite($file, "date_default_timezone_set('America/Bogota');" . PHP_EOL . PHP_EOL); |
|
112 | 112 | |
113 | 113 | |
114 | 114 | fwrite($file, "/* Define una cuenta de correo para uso del app */" . PHP_EOL); |
115 | - fwrite($file, "define('DESTINO_EMAIL', '[email protected]');" . PHP_EOL.PHP_EOL); |
|
115 | + fwrite($file, "define('DESTINO_EMAIL', '[email protected]');" . PHP_EOL . PHP_EOL); |
|
116 | 116 | |
117 | 117 | fwrite($file, "/* Defino el formato de fecha */" . PHP_EOL); |
118 | - fwrite($file, "define('Cf_FORMATO_FECHA', 'l, d F Y');" . PHP_EOL.PHP_EOL); |
|
118 | + fwrite($file, "define('Cf_FORMATO_FECHA', 'l, d F Y');" . PHP_EOL . PHP_EOL); |
|
119 | 119 | |
120 | 120 | fwrite($file, "/* CalimaFramework clave de licencia */" . PHP_EOL); |
121 | - fwrite($file, "define('Cf_LICENSE', 'Cf-O17N-JHK8-TDJL-B5AO-8WKA');" . PHP_EOL.PHP_EOL); |
|
121 | + fwrite($file, "define('Cf_LICENSE', 'Cf-O17N-JHK8-TDJL-B5AO-8WKA');" . PHP_EOL . PHP_EOL); |
|
122 | 122 | |
123 | 123 | fwrite($file, "/* mensajes de warnin */" . PHP_EOL); |
124 | - fwrite($file, "define('CF_DEBUG', TRUE);" . PHP_EOL.PHP_EOL); |
|
124 | + fwrite($file, "define('CF_DEBUG', TRUE);" . PHP_EOL . PHP_EOL); |
|
125 | 125 | |
126 | 126 | fwrite($file, "/* Idioma local */" . PHP_EOL); |
127 | - fwrite($file, "define('CF_LOCALE', 'es_ES');" . PHP_EOL.PHP_EOL); |
|
127 | + fwrite($file, "define('CF_LOCALE', 'es_ES');" . PHP_EOL . PHP_EOL); |
|
128 | 128 | |
129 | 129 | |
130 | 130 | fwrite($file, "/* Create una cuenta con google analytics y agrega el UA en la constante */" . PHP_EOL); |
131 | - fwrite($file, "define('CF_ANALYTICS', $analytics);" . PHP_EOL.PHP_EOL); |
|
131 | + fwrite($file, "define('CF_ANALYTICS', $analytics);" . PHP_EOL . PHP_EOL); |
|
132 | 132 | |
133 | 133 | fwrite($file, "/* con la siguiente constante podras crear una ip fija de tu empresa para hacer " . PHP_EOL); |
134 | 134 | fwrite($file, "* pruebas en tu entorno de red basado en tu ip que te ofrece tu proveedor de servicio" . PHP_EOL); |
135 | 135 | fwrite($file, "*/" . PHP_EOL); |
136 | - fwrite($file, "define('Cf_IPPRUEBAS', 'x.x.x.x');" . PHP_EOL.PHP_EOL); |
|
136 | + fwrite($file, "define('Cf_IPPRUEBAS', 'x.x.x.x');" . PHP_EOL . PHP_EOL); |
|
137 | 137 | |
138 | 138 | |
139 | 139 | fwrite($file, "/* Transladamos a formato local */" . PHP_EOL); |
140 | - fwrite($file, "define('CF_FECHA_FORMATO_LOCAL', '%A, %d %B %G');" . PHP_EOL.PHP_EOL); |
|
140 | + fwrite($file, "define('CF_FECHA_FORMATO_LOCAL', '%A, %d %B %G');" . PHP_EOL . PHP_EOL); |
|
141 | 141 | |
142 | 142 | fwrite($file, "/* Translatable time format */" . PHP_EOL); |
143 | - fwrite($file, "define('CF_LOCALE_TIME_FORMAT', ' %T');" . PHP_EOL.PHP_EOL); |
|
143 | + fwrite($file, "define('CF_LOCALE_TIME_FORMAT', ' %T');" . PHP_EOL . PHP_EOL); |
|
144 | 144 | |
145 | 145 | fwrite($file, "/* Por defecto almacenamos los datos de la aplicacion. */" . PHP_EOL); |
146 | - fwrite($file, "define('CF_PATH_DATA', dirname(__FILE__) . '/Cf-data');" . PHP_EOL.PHP_EOL); |
|
146 | + fwrite($file, "define('CF_PATH_DATA', dirname(__FILE__) . '/Cf-data');" . PHP_EOL . PHP_EOL); |
|
147 | 147 | |
148 | - fwrite($file, "#Configuracion Basica" . PHP_EOL.PHP_EOL); |
|
148 | + fwrite($file, "#Configuracion Basica" . PHP_EOL . PHP_EOL); |
|
149 | 149 | |
150 | 150 | fwrite($file, "/* La siguiente CONSTANTE permite el apuntapiento para archivos js, css, imagenes desde la vista hacia el directorio _public */" . PHP_EOL); |
151 | - fwrite($file, "define('Cf_BASE_URL', 'http://localhost$proyecto');" . PHP_EOL.PHP_EOL); |
|
151 | + fwrite($file, "define('Cf_BASE_URL', 'http://localhost$proyecto');" . PHP_EOL . PHP_EOL); |
|
152 | 152 | |
153 | 153 | fwrite($file, "/* definimos un controlador inicial en nuestro proyecto */" . PHP_EOL); |
154 | - fwrite($file, "define('CONTROLADOR_INICIAL', 'index');" . PHP_EOL.PHP_EOL); |
|
154 | + fwrite($file, "define('CONTROLADOR_INICIAL', 'index');" . PHP_EOL . PHP_EOL); |
|
155 | 155 | |
156 | 156 | fwrite($file, "/* Sedefine una CONSTANTE al directorio adicionales en la vista */" . PHP_EOL); |
157 | - fwrite($file, "define('ADICIONALES_VISTA', 'adicionales');" . PHP_EOL.PHP_EOL); |
|
157 | + fwrite($file, "define('ADICIONALES_VISTA', 'adicionales');" . PHP_EOL . PHP_EOL); |
|
158 | 158 | |
159 | 159 | fwrite($file, "/* Definimos una CONSTANTE como nombre de aplicacion */" . PHP_EOL); |
160 | - fwrite($file, "define('CF_AP_NOMBRE', 'CalimaFramework');" . PHP_EOL.PHP_EOL); |
|
160 | + fwrite($file, "define('CF_AP_NOMBRE', 'CalimaFramework');" . PHP_EOL . PHP_EOL); |
|
161 | 161 | |
162 | 162 | fwrite($file, "/* Definimos un Slogan para la aplicacion web */" . PHP_EOL); |
163 | - fwrite($file, "define('CF_AP_SLOGAN', 'Tu Framework php MVC hispano ');" . PHP_EOL.PHP_EOL); |
|
163 | + fwrite($file, "define('CF_AP_SLOGAN', 'Tu Framework php MVC hispano ');" . PHP_EOL . PHP_EOL); |
|
164 | 164 | |
165 | 165 | fwrite($file, "/* Empresa de la aplicacion */" . PHP_EOL); |
166 | - fwrite($file, "define('CF_AP_EMPRESA', 'www.webcol.net');" . PHP_EOL.PHP_EOL); |
|
166 | + fwrite($file, "define('CF_AP_EMPRESA', 'www.webcol.net');" . PHP_EOL . PHP_EOL); |
|
167 | 167 | |
168 | 168 | fwrite($file, "/* Creditos de la aplicacion */" . PHP_EOL); |
169 | - fwrite($file, "define('CF_AP_CREDITOS', 'CopyLeft 2015 Debeloped by www.webcol.net');" . PHP_EOL.PHP_EOL); |
|
169 | + fwrite($file, "define('CF_AP_CREDITOS', 'CopyLeft 2015 Debeloped by www.webcol.net');" . PHP_EOL . PHP_EOL); |
|
170 | 170 | |
171 | - fwrite($file, "#webcol seguridad" . PHP_EOL. PHP_EOL); |
|
171 | + fwrite($file, "#webcol seguridad" . PHP_EOL . PHP_EOL); |
|
172 | 172 | |
173 | 173 | fwrite($file, "/* Definimos un indice de clave para concatenar en encriptacion de datos */" . PHP_EOL); |
174 | - fwrite($file, "define('Cf_KEY_MD5', 'P0L1');" . PHP_EOL.PHP_EOL); |
|
174 | + fwrite($file, "define('Cf_KEY_MD5', 'P0L1');" . PHP_EOL . PHP_EOL); |
|
175 | 175 | |
176 | 176 | fwrite($file, "/* en el controlador concatena la constante con el llamado a la funcion generarCadenaAleatoria() de Cf_PHPSeguridad */" . PHP_EOL); |
177 | - fwrite($file, "define('Cf_CSRF_SECRET','Cfbeta');" . PHP_EOL.PHP_EOL); |
|
177 | + fwrite($file, "define('Cf_CSRF_SECRET','Cfbeta');" . PHP_EOL . PHP_EOL); |
|
178 | 178 | |
179 | - fwrite($file, "/* #base de datos */" . PHP_EOL. PHP_EOL); |
|
179 | + fwrite($file, "/* #base de datos */" . PHP_EOL . PHP_EOL); |
|
180 | 180 | |
181 | 181 | fwrite($file, "/* Configuracion de tu base de datos */" . PHP_EOL); |
182 | 182 | fwrite($file, "define('CF_BD_HOST', $hostbd);" . PHP_EOL); |
@@ -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->_vista->titulo = 'CalimaFramework Login'; |
20 | 20 | $this->_vista->error = 'CalimaFramework Login'; |
21 | 21 | $this->_vista->imprimirVista('index', 'usuario'); |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | |
24 | 24 | } |
25 | 25 | |
26 | - public function registro(){ |
|
26 | + public function registro() { |
|
27 | 27 | |
28 | 28 | $this->_vista->titulo = 'CalimaFramework registro'; |
29 | 29 | $this->_vista->imprimirVista('registro', 'usuario'); |
@@ -32,13 +32,13 @@ discard block |
||
32 | 32 | //echo$_SESSION['something']; |
33 | 33 | } |
34 | 34 | |
35 | - public function crearRegistro(){ |
|
35 | + public function crearRegistro() { |
|
36 | 36 | $datas = $this->cargaModelo('usuario'); |
37 | - if(isset($_POST['nombre'])){ |
|
38 | - $nombre=$_POST['nombre']; |
|
39 | - $email=$_POST['email']; |
|
40 | - $usuario=$_POST['nombre']; |
|
41 | - $clave=$this->_seg->cifrado($this->_seg->filtrarTexto($_POST['clave'])); |
|
37 | + if (isset($_POST['nombre'])) { |
|
38 | + $nombre = $_POST['nombre']; |
|
39 | + $email = $_POST['email']; |
|
40 | + $usuario = $_POST['nombre']; |
|
41 | + $clave = $this->_seg->cifrado($this->_seg->filtrarTexto($_POST['clave'])); |
|
42 | 42 | |
43 | 43 | $datas->insertarRegistro( |
44 | 44 | $this->_seg->filtrarTexto($_POST['nombre']), |
@@ -49,22 +49,22 @@ discard block |
||
49 | 49 | $this->_ayuda->redireccionUrl('usuario'); |
50 | 50 | //$_POST['option1']=false; |
51 | 51 | } |
52 | - else{ |
|
52 | + else { |
|
53 | 53 | $this->_ayuda->redireccionUrl('usuario/registro'); |
54 | 54 | } |
55 | 55 | } |
56 | 56 | |
57 | - public function valida(){ |
|
58 | - if(isset($_POST['usuario'])){ |
|
59 | - $usuario=$_POST['usuario']; |
|
60 | - echo $clave=$this->_seg->cifrado($this->_seg->filtrarTexto($_POST['clave'])); |
|
57 | + public function valida() { |
|
58 | + if (isset($_POST['usuario'])) { |
|
59 | + $usuario = $_POST['usuario']; |
|
60 | + echo $clave = $this->_seg->cifrado($this->_seg->filtrarTexto($_POST['clave'])); |
|
61 | 61 | |
62 | 62 | $datosUser = $this->cargaModelo('usuario'); |
63 | - $valida=$datosUser->seleccionUsuario($usuario, $clave); |
|
63 | + $valida = $datosUser->seleccionUsuario($usuario, $clave); |
|
64 | 64 | |
65 | - if(isset($valida)){ |
|
65 | + if (isset($valida)) { |
|
66 | 66 | $this->_sesion->iniciarSesion('_s', false); |
67 | - $_SESSION['usuario']=$usuario; |
|
67 | + $_SESSION['usuario'] = $usuario; |
|
68 | 68 | $this->_ayuda->redireccionUrl('index'); |
69 | 69 | } |
70 | 70 | $this->_ayuda->redireccionUrl('usuario'); |
@@ -72,7 +72,7 @@ discard block |
||
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'); |
@@ -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 | } |
@@ -14,9 +14,9 @@ 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 | - $gbd = new PDO("mysql:host=localhost;dbname=".$bd, $usuario, $contraseña); |
|
19 | + $gbd = new PDO("mysql:host=localhost;dbname=" . $bd, $usuario, $contraseña); |
|
20 | 20 | $gbd = null; |
21 | 21 | return true; |
22 | 22 | |
@@ -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, |
@@ -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 |