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)) { if (count($arrError) == 0 && isset($strImageName)) {
@ -283,10 +280,18 @@ 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); $boolInsert = $objUserModel->update($objUser);
if ($boolInsert === true) { if ($boolInsert === true) {
if (isset($strOldImg) && !empty($strOldImg) && isset($strImageName)) { if (isset($strOldImg) && !empty($strOldImg) && $strOldImg !== 'images.jpg' && isset($strImageName)) {
$strOldFile = $_ENV['IMG_USER_PATH'] . $strOldImg; $strOldFile = $_ENV['IMG_USER_PATH'] . $strOldImg;
if (file_exists($strOldFile)) unlink($strOldFile); if (file_exists($strOldFile)) unlink($strOldFile);
} }

View file

@ -11,8 +11,8 @@
try{ try{
$this->_db = new PDO( $this->_db = new PDO(
"mysql:host=localhost;dbname=projet_folliow", "mysql:host=localhost;dbname=projet_folliow",
"projet_user", "root",
"F0lliowRules!", "",
array(PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC) array(PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC)
); );
$this->_db->exec("SET CHARACTER SET utf8"); $this->_db->exec("SET CHARACTER SET utf8");

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3 KiB

BIN
uploads/profiles/images.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB