un peu de debuggage

This commit is contained in:
Yasder5 2026-03-02 21:41:34 +01:00
parent 334dd55dee
commit 31b2c00956
4 changed files with 13 additions and 8 deletions

View file

@ -243,9 +243,6 @@ class UserCtrl extends MotherCtrl {
}
}
}
if ($_POST['delete_image'] === '1') {
$objUser->setImage('images.jpg');
}
if (count($arrError) == 0 && isset($strImageName)) {
@ -283,12 +280,20 @@ class UserCtrl extends MotherCtrl {
}
if ($_POST['delete_image'] === '1') {
$strOldImg = $objUser->getImage();
if (!empty($strOldImg) && $strOldImg !== 'images.jpg') {
$strOldFile = $_ENV['IMG_USER_PATH'] . $strOldImg;
if (file_exists($strOldFile)) unlink($strOldFile);
}
$objUser->setImage('images.jpg');
}
$boolInsert = $objUserModel->update($objUser);
if ($boolInsert === true) {
if (isset($strOldImg) && !empty($strOldImg) && isset($strImageName)) {
$strOldFile = $_ENV['IMG_USER_PATH'] . $strOldImg;
if (file_exists($strOldFile)) unlink($strOldFile);
if (isset($strOldImg) && !empty($strOldImg) && $strOldImg !== 'images.jpg' && isset($strImageName)) {
$strOldFile = $_ENV['IMG_USER_PATH'] . $strOldImg;
if (file_exists($strOldFile)) unlink($strOldFile);
}
$arrNewInfo = $objUserModel->findUserByPseudo($objUser->getPseudo());
$_SESSION['user'] = $arrNewInfo;