From 7e767978041b149a9e0fb31ebe00e5ec980518f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20M=C3=A9ndez?= <45081533+FerMdez@users.noreply.github.com> Date: Sun, 9 May 2021 21:59:52 +0200 Subject: [PATCH] Add files via upload --- assets/css/main.css | 8 +++++ assets/php/config.php | 5 +++ panel_user/includes/formChangeEmail.php | 16 +++++++-- panel_user/includes/formChangeName.php | 48 +++++++++++++++---------- panel_user/includes/formChangePass.php | 20 ++++++++--- 5 files changed, 73 insertions(+), 24 deletions(-) diff --git a/assets/css/main.css b/assets/css/main.css index 080b88e..69cd243 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -563,6 +563,14 @@ textarea { height: 110%; } +/* Preformatted Text */ +pre { + font-weight: bold; +} + +fieldset pre { + color: red; +} /* Footer */ footer { diff --git a/assets/php/config.php b/assets/php/config.php index 2d8ef8e..894cc59 100644 --- a/assets/php/config.php +++ b/assets/php/config.php @@ -44,4 +44,9 @@ * @see http://php.net/manual/en/language.types.callable.php */ register_shutdown_function(array($app, 'shutdown')); + + //Depuración (BORRAR): + ini_set('display_errors', 1); + ini_set('display_startup_errors', 1); + error_reporting(E_ALL); ?> diff --git a/panel_user/includes/formChangeEmail.php b/panel_user/includes/formChangeEmail.php index d2bb3f6..5a0d523 100644 --- a/panel_user/includes/formChangeEmail.php +++ b/panel_user/includes/formChangeEmail.php @@ -52,8 +52,8 @@ class FormChangeEmail extends Form { } $password = $datos['pass'] ?? null; - if ( empty($password) || mb_strlen($password) < 5 ) { - $result['pass'] = "El password tiene que tener una longitud de al menos 5 caracteres."; + if ( empty($password) || mb_strlen($password) < 4 ) { + $result['pass'] = "El password tiene que tener una longitud de al menos 4 caracteres."; } $password2 = $datos['repass'] ?? null; if ( empty($password2) || strcmp($password, $password2) !== 0 ) { @@ -65,6 +65,18 @@ class FormChangeEmail extends Form { $user = $bd->selectUser(unserialize($_SESSION['user'])->getName(), $password); if (!$user) { $result[] = "El usuario no existe."; + $_SESSION['message'] = "
+ "; } else { //$bd->changeUserName(unserialize($_SESSION['user'])->getId(), $username); $user = $bd->selectUser($username, $password); diff --git a/panel_user/includes/formChangeName.php b/panel_user/includes/formChangeName.php index e41c33f..7df48f5 100644 --- a/panel_user/includes/formChangeName.php +++ b/panel_user/includes/formChangeName.php @@ -15,28 +15,28 @@ class FormChangeName extends Form { // Se generan los mensajes de error si existen. $htmlErroresGlobales = self::generaListaErroresGlobales($errores); - $errorNombre = self::createMensajeError($errores, 'nombre', 'span', array('class' => 'error')); + $errorNombre = self::createMensajeError($errores, 'new_name', 'span', array('class' => 'error')); $errorPassword = self::createMensajeError($errores, 'pass', 'span', array('class' => 'error')); $errorPassword2 = self::createMensajeError($errores, 'repass', 'span', array('class' => 'error')); - $html = '