un peu de debuggage
This commit is contained in:
parent
334dd55dee
commit
31b2c00956
4 changed files with 13 additions and 8 deletions
|
|
@ -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,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);
|
$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);
|
||||||
}
|
}
|
||||||
$arrNewInfo = $objUserModel->findUserByPseudo($objUser->getPseudo());
|
$arrNewInfo = $objUserModel->findUserByPseudo($objUser->getPseudo());
|
||||||
$_SESSION['user'] = $arrNewInfo;
|
$_SESSION['user'] = $arrNewInfo;
|
||||||
|
|
|
||||||
|
|
@ -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
BIN
uploads/profiles/images.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
Loading…
Add table
Add a link
Reference in a new issue