diff --git a/login/includes/formLogin.php b/login/includes/formLogin.php deleted file mode 100644 index 182c081..0000000 --- a/login/includes/formLogin.php +++ /dev/null @@ -1,100 +0,0 @@ - 'error')); - $errorPassword = self::createMensajeError($errores, 'pass', 'span', array('class' => 'error')); - - $html = "
-
".$htmlErroresGlobales."
- Datos Personales -
".$errorNombre."
-
".$errorPassword."
-
-
- - -
-
"; - - return $html; - } - - protected function procesaFormulario($datos){ - $result = array(); - - $nombre = $this->test_input($datos['name']) ?? null; - //$nombre = $datos['name'] ?? null; - $nombre = strtolower($nombre); - if ( empty($nombre) || mb_strlen($nombre) < 3 || mb_strlen($nombre) > 15 ) { - $result['name'] = "El nombre tiene que tener\n una longitud de al menos\n 3 caracteres\n y menos de 15 caracteres."; - } - - $password = $this->test_input($datos['pass']) ?? null; - //$password = $datos['pass'] ?? null; - if ( empty($password) || mb_strlen($password) < 4 ) { - $result['pass'] = "El password tiene que tener\n una longitud de al menos\n 4 caracteres."; - } - - if (count($result) === 0) { - $bd = new UserDAO('complucine'); - if($bd){ - $this->user = $bd->selectUser($nombre, $password); - if ($this->user) { - $this->user->setPass(null); - $_SESSION["user"] = serialize($this->user); - $_SESSION["nombre"] = $this->user->getName(); - $_SESSION["rol"] = $this->user->getRol(); - $_SESSION["login"] = true; - $result = 'validate.php'; - } else { - $result[] = "El usuario o el password\nno coinciden."; - } - } else { - $result[] = "Error al conectar con la BD."; - } - } - - return $result; - } - - //Returns validation response: - static public function getReply() { - - if(isset($_SESSION["login"])){ - $name = strtoupper($_SESSION['nombre']); - $reply = "

Bienvenido {$name}


-

{$name}, has iniciado sesión correctamente.

-

Usa los botones para navegar

- - \n"; - } - else if(!isset($_SESSION["login"])){ - $reply = "

ERROR


". - "

El usuario o contraseña no son válidos.

-

Vuelve a intetarlo o regístrate si no lo habías hecho previamente.

- -
\n"; - } - - return $reply; - } -} -?> \ No newline at end of file diff --git a/login/index.php b/login/index.php deleted file mode 100644 index 4dcc7b4..0000000 --- a/login/index.php +++ /dev/null @@ -1,74 +0,0 @@ - Usuario de pruebas 1. - * fernando | ferpass --> Usuario de pruebas 2. - * manager | managerpass --> Manager asociado al cine 1. - * manager2 | Manager2pass --> Manager asociado al cine 2. - * admin | adminpass --> Administrador de la aplicación. - */ - - //General Config File: - require_once('../assets/php/config.php'); - - //Change the view of the "Login page" to "Registration page": - require('login_register_view.php'); - $view = new LoginRegisterView(); - $isLogin = $view->getIsLogin(); - - //Forms: - require('includes/formLogin.php'); - require($prefix.'register/includes/formRegister.php'); - $formLogin = new FormLogin(); - $htmlFormLogin = $formLogin->gestiona(); - $formRegister = new FormRegister(); - $htmlFormRegister = $formRegister->gestiona(); - - if($isLogin){ - $form = " -
-
-

¿No tienes una cuenta?

-
-

Para crear una cuenta de usuario es necesario haber rellenado el formulario de registro previamente

-

Haz click en el botón para registrate.

-
- -
-
-
-
-

Iniciar Sesión

- ".$htmlFormLogin." -
"."\n"; - } else { - $form = " -
-

Registro

- ".$htmlFormRegister." -
-
-
-

¿Ya estás registrado?

-
-

Si dispones de una cuenta de usuario, no es necesario que rellenes este formulario nuevamente

-

Haz click en el botón para iniciar sesión.

-
- -
-
-
"."\n"; - } - - //Specific page content: - $section = ' -
-
- '.$form.' -
-
- '; - - //General page content: - require RAIZ_APP.'/HTMLtemplate.php'; -?> \ No newline at end of file diff --git a/login/login_register_view.php b/login/login_register_view.php deleted file mode 100644 index acaeda4..0000000 --- a/login/login_register_view.php +++ /dev/null @@ -1,38 +0,0 @@ -setIsLogin(true); - - if(array_key_exists('register', $_POST)){ - $this->setIsLogin(false); - } - else if(array_key_exists('login', $_POST)){ - $this->setIsLogin(true); - } - } - - //Methods: - private function setIsLogin($set){ - return $this->isLogin = $set; - } - - public function getIsLogin(){ - return $this->isLogin; - } - - public function getLogin(){ - return $this->login; - } - - public function getRegister(){ - return $this->register; - } - } -?> \ No newline at end of file diff --git a/login/validate.php b/login/validate.php deleted file mode 100644 index c027625..0000000 --- a/login/validate.php +++ /dev/null @@ -1,27 +0,0 @@ - -
-
-
-
-
- '.$reply.' -
-
-
-
-
- '; - - //General page content: - require RAIZ_APP.'/HTMLtemplate.php'; - -?> \ No newline at end of file