Debugge partage projet, crée pages mentions et about.php
This commit is contained in:
parent
009191494e
commit
5efc3c5778
1 changed files with 42 additions and 19 deletions
|
|
@ -193,52 +193,60 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function shareProject()
|
public function shareProject(){
|
||||||
{
|
|
||||||
if (count($_POST) > 0)
|
if (count($_POST) > 0)
|
||||||
{
|
{
|
||||||
$projectId = (int)($_POST['project_id'] ?? 0);
|
$projectId = (int)($_POST['project_id'] ?? 0);
|
||||||
$toEmail = trim($_POST['to_email'] ?? '');
|
$toEmail = trim($_POST['to_email'] ?? '');
|
||||||
|
|
||||||
$objProjectModel = new ProjectModel();
|
$objProjectModel = new ProjectModel();
|
||||||
$arrProject = $objProjectModel->findOne($projectId);
|
$arrProject = $objProjectModel->findOne($projectId);
|
||||||
|
|
||||||
if (!$arrProject) {
|
if (!$arrProject) {
|
||||||
header("Location: index.php?ctrl=project&action=home");
|
header("Location: index.php?ctrl=project&action=home");
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
$objProject = new Project();
|
$objProject = new Project();
|
||||||
$objProject->hydrate($arrProject);
|
$objProject->hydrate($arrProject);
|
||||||
|
|
||||||
$objMail = new PHPMailer();
|
$objMail = new PHPMailer();
|
||||||
$objMail->IsSMTP();
|
$objMail->IsSMTP();
|
||||||
$objMail->Mailer = "smtp";
|
$objMail->Mailer = "smtp";
|
||||||
$objMail->CharSet = PHPMailer::CHARSET_UTF8;
|
$objMail->CharSet = PHPMailer::CHARSET_UTF8;
|
||||||
$objMail->SMTPDebug = 0;
|
$objMail->SMTPDebug = 0;
|
||||||
|
|
||||||
$objMail->SMTPAuth = true;
|
$objMail->SMTPAuth = true;
|
||||||
$objMail->SMTPSecure = "tls";
|
$objMail->SMTPSecure = "tls";
|
||||||
$objMail->Port = 587;
|
$objMail->Port = 587;
|
||||||
$objMail->Host = 'smtp-relay.brevo.com';
|
$objMail->Host = 'smtp-relay.brevo.com';
|
||||||
$objMail->Username = 'a2a67e001@smtp-brevo.com';
|
$objMail->Username = 'a2a67e001@smtp-brevo.com';
|
||||||
$objMail->Password = 'xsmtpsib-f2af87e12d3db6f1b99802a92c1acda32d45fc32a8446eeed7e49ec91c4ec7ef-AX8Y7YkRWYSmKHwS';
|
$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->IsHTML(true);
|
||||||
|
|
||||||
$objMail->setFrom('projet.folliow@hotmail.com', 'Folliow');
|
$objMail->setFrom('projet.folliow@hotmail.com', 'Folliow');
|
||||||
$objMail->addAddress($toEmail);
|
$objMail->addAddress($toEmail);
|
||||||
|
|
||||||
$objMail->Subject = "Projet : " . $objProject->getTitle();
|
$objMail->Subject = "Projet : " . $objProject->getTitle();
|
||||||
|
|
||||||
$url = "https://php.boulayoune.com/index.php?ctrl=project&action=display&id=" . $projectId;
|
$url = "https://php.boulayoune.com/index.php?ctrl=project&action=display&id=" . $projectId;
|
||||||
|
|
||||||
$this->_arrData['projectTitle'] = $objProject->getTitle();
|
$this->_arrData['projectTitle'] = $objProject->getTitle();
|
||||||
$this->_arrData['projectDescription'] = $objProject->getDescription();
|
$this->_arrData['projectDescription'] = $objProject->getDescription();
|
||||||
$this->_arrData['projectUrl'] = $url;
|
$this->_arrData['projectUrl'] = $url;
|
||||||
|
|
||||||
$objMail->Body = $this->_display("mail_message", false);
|
$objMail->Body = $this->_display("mail_message", false);
|
||||||
|
|
||||||
if ($objMail->Send()) {
|
if ($objMail->Send()) {
|
||||||
header("Location: index.php?ctrl=project&action=display&id=".$projectId."&mail=ok");
|
header("Location: index.php?ctrl=project&action=display&id=".$projectId."&mail=ok");
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -246,14 +254,11 @@
|
||||||
}
|
}
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
header("Location: index.php?ctrl=project&action=home");
|
header("Location: index.php?ctrl=project&action=home");
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public function accept(){
|
public function accept(){
|
||||||
|
|
||||||
|
|
@ -296,4 +301,22 @@
|
||||||
header("Location: index.php");
|
header("Location: index.php");
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Page mentions légales
|
||||||
|
*/
|
||||||
|
public function mentions(){
|
||||||
|
// Afficher
|
||||||
|
$this->_display("mentions");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Page à propos
|
||||||
|
*/
|
||||||
|
public function about(){
|
||||||
|
// Afficher
|
||||||
|
$this->_display("about");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue