From b6ea25caa106ee7edd89b22d1ec00c10b83e712f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20M=C3=A9ndez?= <45081533+FerMdez@users.noreply.github.com> Date: Tue, 11 May 2021 23:07:30 +0200 Subject: [PATCH] Add files via upload --- assets/css/highContrast.css | 6 +- assets/js/cambiarCSS.js | 11 +- assets/php/common/user_dao.php | 12 ++ assets/php/template.php | 14 +- login/includes/formLogin.php | 124 ++++++++++-------- login/index.php | 43 +++++- login/login_register_view.php | 87 ------------ login/validate.php | 4 +- panel_manager/index.php | 4 - panel_user/includes/formDeleteAccount.php | 2 +- register/includes/formRegister.php | 153 +++++++++++++--------- register/register.php | 6 +- 12 files changed, 220 insertions(+), 246 deletions(-) diff --git a/assets/css/highContrast.css b/assets/css/highContrast.css index ec692ed..d1a8290 100644 --- a/assets/css/highContrast.css +++ b/assets/css/highContrast.css @@ -313,7 +313,7 @@ text-transform: uppercase; font-weight: bold; font-size: 90%; - color: #00020f; + color: #d3ebff; } .code label{ color: #d3ebff; @@ -553,8 +553,8 @@ width: 100%; height: 30px; border: 1px solid #dadada; - background-color: #dadada; - color: #00020f; + background-color: #00020f; + color: #dadada; padding: 5px; margin-top: 5px; font-size: 12px; diff --git a/assets/js/cambiarCSS.js b/assets/js/cambiarCSS.js index af20494..404ca62 100644 --- a/assets/js/cambiarCSS.js +++ b/assets/js/cambiarCSS.js @@ -1,12 +1,3 @@ function cambiarCSS(nuevo){ - let highContrast; - - if(highContrast === true){ - highContrast = false; - } else { - highContrast = true; - } - - //window.location.href += "?highContrast=" + highContrast; - document.getElementById('estilo').setAttribute('href', nuevo); + document.getElementById('estilo').setAttribute('href', nuevo); } \ No newline at end of file diff --git a/assets/php/common/user_dao.php b/assets/php/common/user_dao.php index 483a76a..1fe199d 100644 --- a/assets/php/common/user_dao.php +++ b/assets/php/common/user_dao.php @@ -81,12 +81,24 @@ //Returns a query to get the user's data. public function userData($id){ + $id = $this->mysqli->real_escape_string($id); + $sql = sprintf( "SELECT * FROM users WHERE id = '%d'", $id ); $resul = mysqli_query($this->mysqli, $sql) or die ('Error into query database'); return $resul; } + //Search a user by name. + public function selectUserName($username){ + $username = $this->mysqli->real_escape_string($username); + + $sql = sprintf( "SELECT * FROM users WHERE name = '%s'", $username ); + $resul = mysqli_query($this->mysqli, $sql); + + return $resul; + } + //Change username by id. public function changeUserName($id, $username){ $id = $this->mysqli->real_escape_string($id); diff --git a/assets/php/template.php b/assets/php/template.php index 6e2d009..2cbbd67 100644 --- a/assets/php/template.php +++ b/assets/php/template.php @@ -458,14 +458,12 @@ function print_footer(){ $prefix = $this->prefix; - if (isset($_GET["highContrast"]) && $_GET["highContrast"] === true) { - $css = "{$prefix}assets/css/main.css"; - $nameCSS = "Contraste Normal"; - } else { - $css = "{$prefix}assets/css/highContrast.css"; - $nameCSS = "Alto Contraste"; - } - + /* TODO */ + $css = "{$prefix}assets/css/highContrast.css"; + $nameCSS = "Alto Contraste"; + //$css = "{$prefix}assets/css/main.css"; + //$nameCSS = "Contraste Normal"; + echo"