From f9a0a3c5baf8c6ad3d2668d1e240b6fb98037024 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20M=C3=A9ndez?= <45081533+FerMdez@users.noreply.github.com> Date: Fri, 4 Jun 2021 14:30:48 +0200 Subject: [PATCH] Add files via upload --- panel_user/includes/formChangeName.php | 6 ++++++ purchase/includes/formSelectCinemaSession.php | 2 +- purchase/resume.php | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/panel_user/includes/formChangeName.php b/panel_user/includes/formChangeName.php index 64102a5..8b6c433 100644 --- a/panel_user/includes/formChangeName.php +++ b/panel_user/includes/formChangeName.php @@ -80,6 +80,12 @@ class FormChangeName extends Form { } else { $bd->changeUserName(unserialize($_SESSION['user'])->getId(), $nombre); $user = $bd->selectUser($nombre, $password); + + $actual_img = "../img/users/".unserialize($_SESSION['user'])->getName().".jpg"; + $new_img = "../img/users/".$nombre.".jpg"; + copy($actual_img, $new_img); + unlink($actual_img); + $_SESSION['user'] = serialize($user); $_SESSION["nombre"] = $user->getName(); $_SESSION['message'] = "
'.$errorCode.'