correction bug suppression
Some checks are pending
Deploy production (servyass) / deploy (push) Waiting to run
Some checks are pending
Deploy production (servyass) / deploy (push) Waiting to run
This commit is contained in:
parent
d2549828d0
commit
4583eac7cf
4 changed files with 27 additions and 7 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue