From 5efc3c577868f2d186552d124b10c05a8ff95074 Mon Sep 17 00:00:00 2001 From: Bess1k Date: Fri, 20 Feb 2026 15:22:10 +0100 Subject: [PATCH] =?UTF-8?q?Debugge=20partage=20projet,=20cr=C3=A9e=20pages?= =?UTF-8?q?=20mentions=20et=20about.php?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controllers/project_controller.php | 61 ++++++++++++++++++++---------- 1 file changed, 42 insertions(+), 19 deletions(-) diff --git a/controllers/project_controller.php b/controllers/project_controller.php index 104fecd..773aabb 100644 --- a/controllers/project_controller.php +++ b/controllers/project_controller.php @@ -193,52 +193,60 @@ } } - public function shareProject() - { + public function shareProject(){ if (count($_POST) > 0) { $projectId = (int)($_POST['project_id'] ?? 0); $toEmail = trim($_POST['to_email'] ?? ''); - + $objProjectModel = new ProjectModel(); $arrProject = $objProjectModel->findOne($projectId); - + if (!$arrProject) { header("Location: index.php?ctrl=project&action=home"); exit; } - + $objProject = new Project(); $objProject->hydrate($arrProject); - + $objMail = new PHPMailer(); $objMail->IsSMTP(); $objMail->Mailer = "smtp"; $objMail->CharSet = PHPMailer::CHARSET_UTF8; - $objMail->SMTPDebug = 0; - + $objMail->SMTPDebug = 0; + $objMail->SMTPAuth = true; $objMail->SMTPSecure = "tls"; $objMail->Port = 587; $objMail->Host = 'smtp-relay.brevo.com'; $objMail->Username = 'a2a67e001@smtp-brevo.com'; $objMail->Password = 'xsmtpsib-f2af87e12d3db6f1b99802a92c1acda32d45fc32a8446eeed7e49ec91c4ec7ef-AX8Y7YkRWYSmKHwS'; - + + // Désactive la vérification du certificat SSL + // Cela permet d'éviter les erreurs liées au certificat, mais réduit la sécurité de la connexion. + $objMail->SMTPOptions = [ + 'ssl' => [ + 'verify_peer' => false, + ], + ]; + + $objMail->IsHTML(true); - + $objMail->setFrom('projet.folliow@hotmail.com', 'Folliow'); $objMail->addAddress($toEmail); - + $objMail->Subject = "Projet : " . $objProject->getTitle(); - + $url = "https://php.boulayoune.com/index.php?ctrl=project&action=display&id=" . $projectId; - + $this->_arrData['projectTitle'] = $objProject->getTitle(); $this->_arrData['projectDescription'] = $objProject->getDescription(); $this->_arrData['projectUrl'] = $url; - + $objMail->Body = $this->_display("mail_message", false); - + if ($objMail->Send()) { header("Location: index.php?ctrl=project&action=display&id=".$projectId."&mail=ok"); } else { @@ -246,14 +254,11 @@ } exit; } - + header("Location: index.php?ctrl=project&action=home"); exit; } - - - public function accept(){ @@ -296,4 +301,22 @@ header("Location: index.php"); exit; } + + /** + * Page mentions légales + */ + public function mentions(){ + // Afficher + $this->_display("mentions"); + } + + + /** + * Page à propos + */ + public function about(){ + // Afficher + $this->_display("about"); + } + }