correction bug suppression
Some checks are pending
Deploy production (servyass) / deploy (push) Waiting to run

This commit is contained in:
Yasder5 2026-03-05 12:32:54 +01:00
parent d2549828d0
commit 4583eac7cf
4 changed files with 27 additions and 7 deletions

View file

@ -482,15 +482,21 @@
*/
public function delete(){
if (!isset($_SESSION['user']) || $_SESSION['user']['user_status'] != 2) {
header('Location: '.$_ENV['BASE_URL']);
exit;
$objProjectModel = new ProjectModel();
$intId = $_GET['id'] ?? null;
$project = $objProjectModel->findOne($intId);
if (
!isset($_SESSION['user']) ||
$_SESSION['user']['user_status'] != 2 ||
!$project ||
$project['project_creatorname'] == $_SESSION['user']['user_pseudo']
) {
header('Location: '.$_ENV['BASE_URL']);
exit;
}
$intId = $_GET['id'] ?? null;
if ($intId) {
$objProjectModel = new ProjectModel();
if ($objProjectModel->delete_soft_project((int) $intId)) {
$_SESSION['success'] = "Le projet a été archivé avec succès.";
} else {