Merge branch 'develop' into trunk
This commit is contained in:
commit
2ed952039e
24 changed files with 1214 additions and 13 deletions
|
|
@ -37,6 +37,7 @@ SMTP_SECURE=
|
|||
MAIL_FROM_NAME=
|
||||
MAIL_FROM_ADDRESS=
|
||||
MAIL_ADMIN=
|
||||
MAIL_CONTACT_RGPD=
|
||||
|
||||
# ADMIN SECURE
|
||||
LDCWEB_API_TOKEN=
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
"roots/wordpress": "6.7.2",
|
||||
"roots/wp-config": "1.0.0",
|
||||
"roots/wp-password-bcrypt": "1.2.0",
|
||||
"uwil/ldc-theme": "^1.1",
|
||||
"uwil/ldc-theme": "^1.2",
|
||||
"ldc/ldccrmv4client": "^4.0",
|
||||
"wpackagist-plugin/breadcrumb-navxt": "^7.4",
|
||||
"wpengine/advanced-custom-fields-pro": "^6.3",
|
||||
|
|
|
|||
10
composer.lock
generated
10
composer.lock
generated
|
|
@ -4,7 +4,7 @@
|
|||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "18e8af366c29fa60c54eb4cef3391e63",
|
||||
"content-hash": "0d4b8b767598683658bab741b95340e0",
|
||||
"packages": [
|
||||
{
|
||||
"name": "composer/installers",
|
||||
|
|
@ -1893,16 +1893,16 @@
|
|||
},
|
||||
{
|
||||
"name": "uwil/ldc-theme",
|
||||
"version": "1.1.4",
|
||||
"version": "1.2.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "git@lab.s-web.fr:ldc-web/projets/ldc-theme.git",
|
||||
"reference": "d35b22db38597e635f1c1717af902e7d0825d57f"
|
||||
"reference": "3fb2413b466101e5d2bce8716358be70b1ca870e"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://lab.s-web.fr/api/v4/projects/232/packages/composer/archives/uwil/ldc-theme.zip?sha=d35b22db38597e635f1c1717af902e7d0825d57f",
|
||||
"reference": "d35b22db38597e635f1c1717af902e7d0825d57f",
|
||||
"url": "https://lab.s-web.fr/api/v4/projects/232/packages/composer/archives/uwil/ldc-theme.zip?sha=3fb2413b466101e5d2bce8716358be70b1ca870e",
|
||||
"reference": "3fb2413b466101e5d2bce8716358be70b1ca870e",
|
||||
"shasum": ""
|
||||
},
|
||||
"type": "wordpress-theme",
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ Config::define('SMTP_SECURE', env('SMTP_SECURE'));
|
|||
Config::define('MAIL_FROM_NAME', env('MAIL_FROM_NAME'));
|
||||
Config::define('MAIL_FROM_ADDRESS', env('MAIL_FROM_ADDRESS'));
|
||||
Config::define('MAIL_ADMIN', env('MAIL_ADMIN'));
|
||||
Config::define('MAIL_CONTACT_RGPD', env('MAIL_CONTACT_RGPD'));
|
||||
|
||||
/**
|
||||
* MATOMO ANALYTICS
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
require_once(__DIR__ . '/../wp/wp-load.php');
|
||||
require_once(__DIR__ . '/../public/wp/wp-load.php');
|
||||
|
||||
publish();
|
||||
|
||||
|
|
@ -57,8 +57,10 @@ function publish()
|
|||
$result['type_activite'] = $clean[0];
|
||||
break;
|
||||
case 'filieres':
|
||||
$filiere = $wpdb->get_row("SELECT name FROM wp01_terms WHERE term_id = $data->meta_value");
|
||||
$result['filiere'] = $filiere->name;
|
||||
if ($data->meta_value) {
|
||||
$filiere = $wpdb->get_row("SELECT name FROM wp01_terms WHERE term_id = $data->meta_value");
|
||||
$result['filiere'] = $filiere->name;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
require_once(__DIR__ . '/../wp/wp-load.php');
|
||||
require_once(__DIR__ . '/../public/wp/wp-load.php');
|
||||
|
||||
|
||||
function deleteOldLdcMessages()
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
require_once(__DIR__ . '/../wp/wp-load.php');
|
||||
require_once(__DIR__ . '/../public/wp/wp-load.php');
|
||||
|
||||
DRPerformProcess();
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
* Du début au 2020-02-28 données Worldtrading Datas
|
||||
* Après 2020-02-28 données AlphaVantage (au 17/12/2020) datas moins sûres à priori
|
||||
*/
|
||||
require_once(__DIR__ . '/../wp/wp-load.php');
|
||||
require_once(__DIR__ . '/../public/wp/wp-load.php');
|
||||
|
||||
getFinancialHistoryData();
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
require_once(__DIR__ . '/../wp/wp-load.php');
|
||||
require_once(__DIR__ . '/../public/wp/wp-load.php');
|
||||
|
||||
getStockDatas();
|
||||
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ data:
|
|||
MAIL_FROM_NAME: "${APP_MAIL_FROM_NAME}"
|
||||
MAIL_FROM_ADDRESS: "${APP_MAIL_FROM_ADDRESS}"
|
||||
MAIL_ADMIN: "${APP_MAIL_ADMIN}"
|
||||
MAIL_CONTACT_RGPD: "${APP_MAIL_CONTACT_RGPD}"
|
||||
MATOMO_SITE_ID: "${APP_MATOMO_SITE_ID}"
|
||||
RECAPTCHA_V3_PUBLIC: "${APP_RECAPTCHA_V3_PUBLIC}"
|
||||
RECAPTCHA_V3_SECRET: "${APP_RECAPTCHA_V3_SECRET}"
|
||||
|
|
|
|||
0
public/export/.gitkeep
Normal file
0
public/export/.gitkeep
Normal file
BIN
public/news/24_01_15/img/header.jpg
Normal file
BIN
public/news/24_01_15/img/header.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 145 KiB |
BIN
public/news/24_06_24/img/header.jpg
Normal file
BIN
public/news/24_06_24/img/header.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 232 KiB |
BIN
public/news/24_12_26/img/header.jpg
Normal file
BIN
public/news/24_12_26/img/header.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 556 KiB |
176
public/rgpd/consommateurs/de/index.php
Normal file
176
public/rgpd/consommateurs/de/index.php
Normal file
|
|
@ -0,0 +1,176 @@
|
|||
<?php
|
||||
require_once(__DIR__ . '/../../rgpd-forms-global.php');
|
||||
|
||||
// Tableau de tous les sites pointant sur le formulaire RGPD Groupe LDC
|
||||
$tSitesweb = array('acb', 'agis-sa', 'boutique-vol', 'corico', 'espri', 'foods', 'idhalal', 'jx-argoat', 'jx-reghalal', 'ldc', 'ldc-rest', 'lmdb', 'lpt', 'lta', 'mairet', 'marie', 'mdn-loue', 'ner', 'pet', 'sbv', 'tda', 'regalette');
|
||||
$sDebug = "";
|
||||
$bSendOK = false;
|
||||
|
||||
// Si j'ai des POST
|
||||
if (!empty($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] === 'POST' && !empty($_POST)) {
|
||||
$errorMsg = [];
|
||||
|
||||
if (!reCaptchaV2IsValid($_POST['g-recaptcha-response'] ?? '')) {
|
||||
$errorMsg[] = "Une erreur de validation reCaptcha est survenue. Veuillez réessayer.";
|
||||
} elseif (empty($_POST['lastname']) or empty($_POST['firstname']) or empty($_POST['email'])) {
|
||||
$errorMsg[] = "La demande n'a pas été envoyée car un des champs n'a pas été correctement renseigné.";
|
||||
} else {
|
||||
$sSiteweb = "";
|
||||
$sSource = sanitize_text_field($_POST['source']);
|
||||
$sLastName = sanitize_text_field($_POST['lastname']);
|
||||
$sFirstName = sanitize_text_field($_POST['firstname']);
|
||||
$sMail = sanitize_text_field($_POST['email']);
|
||||
$sChoice = sanitize_text_field($_POST['droits']);
|
||||
$sMsg = sanitize_text_field($_POST['commentaires']);
|
||||
// Vérification mano de la structure de l'adresse mail
|
||||
if (!preg_match("#^[a-z0-9._-]+@[a-z0-9._-]{2,}\.[a-z]{2,4}$#", $sMail)) {
|
||||
$errorMsg[] = "La structure de l'email n'est pas correcte !";
|
||||
}
|
||||
// Dès qu'il y a un GET website, on ctrl selon le tab déclaré en début de code.
|
||||
if (isset($_GET['website'])) {
|
||||
$sSiteweb = htmlspecialchars($_GET['website']);
|
||||
$bSiteOK = false;
|
||||
foreach ($tSitesweb as $site) {
|
||||
if ($sSiteweb == $site) {
|
||||
$bSiteOK = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
// On construit le mail si pas de GET siteweb ou si le GET est OK.
|
||||
if ($sSiteweb == "" || $bSiteOK == true) {
|
||||
//Objet du mail
|
||||
$subject = 'Nouvelles dispositions RGPD - ' . $sSource;
|
||||
|
||||
$right = getChoicedRight($sChoice);
|
||||
|
||||
//Le contenu du mail.
|
||||
$sBody = "<html><head></head><body>";
|
||||
if ($sSiteweb != "") {
|
||||
$sBody .= "<b>Source : </b>" . $sSource . " (via le site web " . $sSiteweb . ")<br><br>";
|
||||
} else {
|
||||
$sBody .= "<b>Source : </b>" . $sSource . "<br><br>";
|
||||
}
|
||||
$sBody .= "<b>Nom : </b>" . $sLastName . "<br>";
|
||||
$sBody .= "<b>Prénom : </b>" . $sFirstName . "<br>";
|
||||
$sBody .= "<b>Email : </b>" . $sMail . "<br><br>";
|
||||
$sBody .= "<b>L'utilisateur souhaite exercer le droit suivant :</b> " . $right . "<br><br>";
|
||||
$sBody .= "<b>Message : </b>" . $sMsg;
|
||||
$sBody .= "</body></html>";
|
||||
|
||||
if (count($errorMsg) === 0) {
|
||||
if (wp_mail(
|
||||
MAIL_CONTACT_RGPD,
|
||||
$subject,
|
||||
$sBody,
|
||||
[
|
||||
"Reply-To: $sFirstName $sLastName <$sMail>"
|
||||
]
|
||||
)) {
|
||||
$bSendOK = true;
|
||||
} else {
|
||||
$errorMsg[] = "Une erreur est survenue, merci de reessayer.";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<link rel="stylesheet" href="../../css/style.css" />
|
||||
<script src="https://cdn.jsdelivr.net/npm/jquery@3.4.1/dist/jquery.min.js"></script>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css" />
|
||||
<script src="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.js"></script>
|
||||
<script src='https://www.google.com/recaptcha/api.js' async defer></script>
|
||||
<title>Formulaire RGPD</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container">
|
||||
<form method="POST">
|
||||
<fieldset>
|
||||
<legend>Zugriff auf meine persönliche Daten<?= $sDebug; ?></legend>
|
||||
<p>
|
||||
<label for="nom">Name*</label>
|
||||
<input type="text" name="lastname" id="nom" style="width:196px;" autofocus required>
|
||||
</p>
|
||||
<p>
|
||||
<label for="prenom">Vorname*</label>
|
||||
<input type="text" name="firstname" id="prenom" style="width:177px;" required>
|
||||
</p>
|
||||
<p>
|
||||
<label for="courriel">Email*</label>
|
||||
<input type="text" name="email" id="mail" style="width:191px;" required>
|
||||
</p>
|
||||
<p>
|
||||
<select name="droits" id="selDroits" style="width:250px;">
|
||||
<option value="ask" selected>Welches Recht möchten Sie geltend machen?</option>
|
||||
<option value="check">Meine Daten prüfen</option>
|
||||
<option value="modify">Meine Daten ändern</option>
|
||||
<option value="delete">Meine Daten löschen</option>
|
||||
<option value="freeze">Die Nutzung von meinen Daten sperren</option>
|
||||
<option value="import">Meine Daten mitnehmen</option>
|
||||
<option value="refuse">Die Nutzung von meinen Daten verweigern</option>
|
||||
</select>
|
||||
</p>
|
||||
<p>
|
||||
<textarea name="commentaires" id="comment" maxlength="1900" rows="10"
|
||||
placeholder="Weitere Informationen"></textarea>
|
||||
</p>
|
||||
<div class="g-recaptcha" data-sitekey="<?= RECAPTCHA_V2_PUBLIC; ?>"></div>
|
||||
<p class="button">
|
||||
<span>
|
||||
<input type="hidden" name="source" value="consommateurs">
|
||||
<input type="submit" value="Senden">
|
||||
</span>
|
||||
<span> </span>
|
||||
<span>*Pflichtfelder</span>
|
||||
</p>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<?php if ($bSendOK): ?>
|
||||
<div class="return">
|
||||
<p>Votre demande a été transmise à nos services. Vous recevrez une réponse à l'adresse mail renseignée dans le formulaire dans les plus brefs délais. Pour plus d'informations, merci de consulter notre <a data-fancybox data-src="#charte" href="javascript:;">charte de confidentialité</a>.<br>
|
||||
A bientôt <?= $sFirstName; ?> sur notre site !</p>
|
||||
</div>
|
||||
<?php
|
||||
try {
|
||||
/** @var \wpdb $wpdb */
|
||||
global $wpdb;
|
||||
$query = $wpdb->prepare(
|
||||
"SELECT post_content FROM $charte_TABLE WHERE ID = %d",
|
||||
$charte_POST_ID
|
||||
);
|
||||
$result = $wpdb->get_row($query, ARRAY_A);
|
||||
|
||||
if (empty($result)) {
|
||||
die('Une erreur est survenue.');
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
die('Une erreur est survenue.');
|
||||
}
|
||||
?>
|
||||
<div id="charte" style="display:none; width:80%; height:80%;">
|
||||
<?= $result['post_content']; ?>
|
||||
</div>
|
||||
<?php elseif (!empty($errorMsg)) : ?>
|
||||
<div class="return">
|
||||
<p>Envoi annulé :</p>
|
||||
<?php foreach ($errorMsg as $error) : ?>
|
||||
<p><?= $error; ?></p>
|
||||
<?php endforeach ?>
|
||||
</div>
|
||||
</br>
|
||||
<?php endif ?>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
177
public/rgpd/consommateurs/en/index.php
Normal file
177
public/rgpd/consommateurs/en/index.php
Normal file
|
|
@ -0,0 +1,177 @@
|
|||
<?php
|
||||
require_once(__DIR__ . '/../../rgpd-forms-global.php');
|
||||
|
||||
// Tableau de tous les sites pointant sur le formulaire RGPD Groupe LDC
|
||||
$tSitesweb = array('acb', 'agis-sa', 'boutique-vol', 'corico', 'espri', 'foods', 'idhalal', 'jx-argoat', 'jx-reghalal', 'ldc', 'ldc-rest', 'lmdb', 'lpt', 'lta', 'mairet', 'marie', 'mdn-loue', 'ner', 'pet', 'sbv', 'tda', 'regalette');
|
||||
$sDebug = "";
|
||||
|
||||
$bSendOK = false;
|
||||
|
||||
// Si j'ai des POST
|
||||
if (!empty($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] === 'POST' && !empty($_POST)) {
|
||||
$errorMsg = [];
|
||||
|
||||
if (!reCaptchaV2IsValid($_POST['g-recaptcha-response'] ?? '')) {
|
||||
$errorMsg[] = "Une erreur de validation reCaptcha est survenue. Veuillez réessayer.";
|
||||
} elseif (empty($_POST['lastname']) or empty($_POST['firstname']) or empty($_POST['email'])) {
|
||||
$errorMsg[] = "La demande n'a pas été envoyée car un des champs n'a pas été correctement renseigné.";
|
||||
} else {
|
||||
$sSiteweb = "";
|
||||
$sSource = sanitize_text_field($_POST['source']);
|
||||
$sLastName = sanitize_text_field($_POST['lastname']);
|
||||
$sFirstName = sanitize_text_field($_POST['firstname']);
|
||||
$sMail = sanitize_text_field($_POST['email']);
|
||||
$sChoice = sanitize_text_field($_POST['droits']);
|
||||
$sMsg = sanitize_text_field($_POST['commentaires']);
|
||||
// Vérification mano de la structure de l'adresse mail
|
||||
if (!preg_match("#^[a-z0-9._-]+@[a-z0-9._-]{2,}\.[a-z]{2,4}$#", $sMail)) {
|
||||
$errorMsg[] = "La structure de l'email n'est pas correcte !";
|
||||
}
|
||||
// Dès qu'il y a un GET website, on ctrl selon le tab déclaré en début de code.
|
||||
if (isset($_GET['website'])) {
|
||||
$sSiteweb = htmlspecialchars($_GET['website']);
|
||||
$bSiteOK = false;
|
||||
foreach ($tSitesweb as $site) {
|
||||
if ($sSiteweb == $site) {
|
||||
$bSiteOK = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
// On construit le mail si pas de GET siteweb ou si le GET est OK.
|
||||
if ($sSiteweb == "" || $bSiteOK == true) {
|
||||
//Objet du mail
|
||||
$subject = 'Nouvelles dispositions RGPD - ' . $sSource;
|
||||
|
||||
$right = getChoicedRight($sChoice);
|
||||
|
||||
//Le contenu du mail.
|
||||
$sBody = "<html><head></head><body>";
|
||||
if ($sSiteweb != "") {
|
||||
$sBody .= "<b>Source : </b>" . $sSource . " (via le site web " . $sSiteweb . ")<br><br>";
|
||||
} else {
|
||||
$sBody .= "<b>Source : </b>" . $sSource . "<br><br>";
|
||||
}
|
||||
$sBody .= "<b>Nom : </b>" . $sLastName . "<br>";
|
||||
$sBody .= "<b>Prénom : </b>" . $sFirstName . "<br>";
|
||||
$sBody .= "<b>Email : </b>" . $sMail . "<br><br>";
|
||||
$sBody .= "<b>L'utilisateur souhaite exercer le droit suivant :</b> " . $right . "<br><br>";
|
||||
$sBody .= "<b>Message : </b>" . $sMsg;
|
||||
$sBody .= "</body></html>";
|
||||
|
||||
if (count($errorMsg) === 0) {
|
||||
if (wp_mail(
|
||||
MAIL_CONTACT_RGPD,
|
||||
$subject,
|
||||
$sBody,
|
||||
[
|
||||
"Reply-To: $sFirstName $sLastName <$sMail>"
|
||||
]
|
||||
)) {
|
||||
$bSendOK = true;
|
||||
} else {
|
||||
$errorMsg[] = "Une erreur est survenue, merci de reessayer.";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<link rel="stylesheet" href="../../css/style.css" />
|
||||
<script src="https://cdn.jsdelivr.net/npm/jquery@3.4.1/dist/jquery.min.js"></script>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css" />
|
||||
<script src="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.js"></script>
|
||||
<script src='https://www.google.com/recaptcha/api.js' async defer></script>
|
||||
<title>RGPD Form</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container">
|
||||
<form method="POST">
|
||||
<fieldset>
|
||||
<legend>Controlling my personal data <?= $sDebug; ?></legend>
|
||||
<p>
|
||||
<label for="nom">Name*</label>
|
||||
<input type="text" name="lastname" id="nom" style="width:196px;" autofocus required>
|
||||
</p>
|
||||
<p>
|
||||
<label for="prenom">First Name*</label>
|
||||
<input type="text" name="firstname" id="prenom" style="width:177px;" required>
|
||||
</p>
|
||||
<p>
|
||||
<label for="courriel">Email*</label>
|
||||
<input type="text" name="email" id="mail" style="width:191px;" required>
|
||||
</p>
|
||||
<p>
|
||||
<select name="droits" id="selDroits" style="width:250px;">
|
||||
<option value="ask" selected>What kind of rights do you wish to exercise?</option>
|
||||
<option value="check">Checking my datas</option>
|
||||
<option value="modify">Changing my datas</option>
|
||||
<option value="delete">Erasing my datas</option>
|
||||
<option value="freeze">Blocking the use of my datas</option>
|
||||
<option value="import">Withdrawing my datas</option>
|
||||
<option value="refuse">Refusing the use of my data</option>
|
||||
</select>
|
||||
</p>
|
||||
<p>
|
||||
<textarea name="commentaires" id="comment" maxlength="1900" rows="10"
|
||||
placeholder="Additional information"></textarea>
|
||||
</p>
|
||||
<div class="g-recaptcha" data-sitekey="<?= RECAPTCHA_V2_PUBLIC; ?>"></div>
|
||||
<p class="button">
|
||||
<span>
|
||||
<input type="hidden" name="source" value="consommateurs">
|
||||
<input type="submit" value="Submit">
|
||||
</span>
|
||||
<span> </span>
|
||||
<span>*required</span>
|
||||
</p>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<?php if ($bSendOK): ?>
|
||||
<div class="return">
|
||||
<p>Votre demande a été transmise à nos services. Vous recevrez une réponse à l'adresse mail renseignée dans le formulaire dans les plus brefs délais. Pour plus d'informations, merci de consulter notre <a data-fancybox data-src="#charte" href="javascript:;">charte de confidentialité</a>.<br>
|
||||
A bientôt <?= $sFirstName; ?> sur notre site !</p>
|
||||
</div>
|
||||
<?php
|
||||
try {
|
||||
/** @var \wpdb $wpdb */
|
||||
global $wpdb;
|
||||
$query = $wpdb->prepare(
|
||||
"SELECT post_content FROM $charte_TABLE WHERE ID = %d",
|
||||
$charte_POST_ID
|
||||
);
|
||||
$result = $wpdb->get_row($query, ARRAY_A);
|
||||
|
||||
if (empty($result)) {
|
||||
die('Une erreur est survenue.');
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
die('Une erreur est survenue.');
|
||||
}
|
||||
?>
|
||||
<div id="charte" style="display:none; width:80%; height:80%;">
|
||||
<?= $result['post_content']; ?>
|
||||
</div>
|
||||
<?php elseif (!empty($errorMsg)) : ?>
|
||||
<div class="return">
|
||||
<p>Envoi annulé :</p>
|
||||
<?php foreach ($errorMsg as $error) : ?>
|
||||
<p><?= $error; ?></p>
|
||||
<?php endforeach ?>
|
||||
</div>
|
||||
</br>
|
||||
<?php endif ?>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
177
public/rgpd/consommateurs/index.php
Normal file
177
public/rgpd/consommateurs/index.php
Normal file
|
|
@ -0,0 +1,177 @@
|
|||
<?php
|
||||
require_once(__DIR__ . '/../rgpd-forms-global.php');
|
||||
|
||||
// Tableau de tous les sites pointant sur le formulaire RGPD Groupe LDC
|
||||
$tSitesweb = array('acb', 'agis-sa', 'boutique-vol', 'corico', 'espri', 'foods', 'idhalal', 'jx-argoat', 'jx-reghalal', 'ldc', 'ldc-rest', 'lmdb', 'lpt', 'lta', 'mairet', 'marie', 'mdn-loue', 'ner', 'pet', 'sbv', 'tda', 'regalette', 'legaulois');
|
||||
$sDebug = "";
|
||||
$bSendOK = false;
|
||||
|
||||
// Si j'ai des POST
|
||||
if (!empty($_SERVER['REQUEST_METHOD']) or $_SERVER['REQUEST_METHOD'] === 'POST' or !empty($_POST)) {
|
||||
$errorMsg = [];
|
||||
|
||||
if (!reCaptchaV2IsValid($_POST['g-recaptcha-response'] ?? '')) {
|
||||
$errorMsg[] = "Une erreur de validation reCaptcha est survenue. Veuillez réessayer.";
|
||||
} elseif (empty($_POST['lastname']) or empty($_POST['firstname']) or empty($_POST['email'])) {
|
||||
$errorMsg[] = "La demande n'a pas été envoyée car un des champs n'a pas été correctement renseigné.";
|
||||
} else {
|
||||
$bSendOK = false;
|
||||
$sSiteweb = "";
|
||||
$sSource = sanitize_text_field($_POST['source']);
|
||||
$sLastName = sanitize_text_field($_POST['lastname']);
|
||||
$sFirstName = sanitize_text_field($_POST['firstname']);
|
||||
$sMail = sanitize_text_field($_POST['email']);
|
||||
$sChoice = sanitize_text_field($_POST['droits']);
|
||||
$sMsg = sanitize_text_field($_POST['commentaires']);
|
||||
// Vérification mano de la structure de l'adresse mail (la gestion d'erreur n'est pas prise en compte)
|
||||
if (!preg_match("#^[a-z0-9._-]+@[a-z0-9._-]{2,}\.[a-z]{2,4}$#", $sMail)) {
|
||||
$errorMsg[] = "La structure de l'email n'est pas correcte !";
|
||||
}
|
||||
// Dès qu'il y a un GET website, on ctrl selon le tab déclaré en début de code.
|
||||
if (isset($_GET['website'])) {
|
||||
$sSiteweb = htmlspecialchars($_GET['website']);
|
||||
$bSiteOK = false;
|
||||
foreach ($tSitesweb as $site) {
|
||||
if ($sSiteweb == $site) {
|
||||
$bSiteOK = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
// On construit le mail si pas de GET siteweb ou si le GET est OK.
|
||||
if ($sSiteweb == "" || $bSiteOK == true) {
|
||||
//Objet du mail
|
||||
$subject = 'Nouvelles dispositions RGPD - ' . $sSource;
|
||||
|
||||
$right = getChoicedRight($sChoice);
|
||||
|
||||
//Le contenu du mail.
|
||||
$sBody = "<html><head></head><body>";
|
||||
if ($sSiteweb != "") {
|
||||
$sBody .= "<b>Source : </b>" . $sSource . " (via le site web " . $sSiteweb . ")<br><br>";
|
||||
} else {
|
||||
$sBody .= "<b>Source : </b>" . $sSource . "<br><br>";
|
||||
}
|
||||
$sBody .= "<b>Nom : </b>" . $sLastName . "<br>";
|
||||
$sBody .= "<b>Prénom : </b>" . $sFirstName . "<br>";
|
||||
$sBody .= "<b>Email : </b>" . $sMail . "<br><br>";
|
||||
$sBody .= "<b>L'utilisateur souhaite exercer le droit suivant :</b> " . $right . "<br><br>";
|
||||
$sBody .= "<b>Message : </b>" . $sMsg;
|
||||
$sBody .= "</body></html>";
|
||||
|
||||
if (count($errorMsg) === 0) {
|
||||
if (wp_mail(
|
||||
MAIL_CONTACT_RGPD,
|
||||
$subject,
|
||||
$sBody,
|
||||
[
|
||||
"Reply-To: $sFirstName $sLastName <$sMail>"
|
||||
]
|
||||
)) {
|
||||
$bSendOK = true;
|
||||
} else {
|
||||
$errorMsg[] = "Une erreur est survenue, merci de reessayer.";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<link rel="stylesheet" href="../css/style.css" />
|
||||
<script src="https://cdn.jsdelivr.net/npm/jquery@3.4.1/dist/jquery.min.js"></script>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css" />
|
||||
<script src="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.js"></script>
|
||||
<script src='https://www.google.com/recaptcha/api.js' async defer></script>
|
||||
<title>Formulaire RGPD</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container">
|
||||
<form method="POST">
|
||||
<fieldset>
|
||||
<legend>Maîtriser mes données personnelles<?= $sDebug; ?></legend>
|
||||
<p>
|
||||
<label for="nom">Nom*</label>
|
||||
<input type="text" name="lastname" id="nom" style="width:196px;" autofocus required>
|
||||
</p>
|
||||
<p>
|
||||
<label for="prenom">Prénom*</label>
|
||||
<input type="text" name="firstname" id="prenom" style="width:177px;" required>
|
||||
</p>
|
||||
<p>
|
||||
<label for="courriel">Email*</label>
|
||||
<input type="text" name="email" id="mail" style="width:191px;" required>
|
||||
</p>
|
||||
<p>
|
||||
<select name="droits" id="selDroits" style="width:250px;">
|
||||
<option value="ask" selected>Quel droit souhaitez-vous exercer ?</option>
|
||||
<option value="check">Vérifier mes données</option>
|
||||
<option value="modify">Rectifier mes données</option>
|
||||
<option value="delete">Effacer mes données</option>
|
||||
<option value="freeze">Geler l'utilisation de mes données</option>
|
||||
<option value="import">Emporter mes données</option>
|
||||
<option value="refuse">M'opposer à l'utilisation de mes données</option>
|
||||
</select>
|
||||
</p>
|
||||
<p>
|
||||
<textarea name="commentaires" id="comment" maxlength="1900" rows="10"
|
||||
placeholder="Informations complémentaires notamment si vous souhaitez nous expliquer les raisons de votre demande (et nous permettre d'améliorer nos services)"></textarea>
|
||||
</p>
|
||||
<div class="g-recaptcha" data-sitekey="<?= RECAPTCHA_V2_PUBLIC; ?>"></div>
|
||||
<p class="button">
|
||||
<span>
|
||||
<input type="hidden" name="source" value="consommateurs">
|
||||
<input type="submit" value="Envoyer">
|
||||
</span>
|
||||
<span> </span>
|
||||
<span>*champs obligatoires</span>
|
||||
</p>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<?php if ($bSendOK): ?>
|
||||
<div class="return">
|
||||
<p>Votre demande a été transmise à nos services. Vous recevrez une réponse à l'adresse mail renseignée dans le formulaire dans les plus brefs délais. Pour plus d'informations, merci de consulter notre <a data-fancybox data-src="#charte" href="javascript:;">charte de confidentialité</a>.<br>
|
||||
A bientôt <?= $sFirstName; ?> sur notre site !</p>
|
||||
</div>
|
||||
<?php
|
||||
try {
|
||||
/** @var \wpdb $wpdb */
|
||||
global $wpdb;
|
||||
$query = $wpdb->prepare(
|
||||
"SELECT post_content FROM $charte_TABLE WHERE ID = %d",
|
||||
$charte_POST_ID
|
||||
);
|
||||
$result = $wpdb->get_row($query, ARRAY_A);
|
||||
|
||||
if (empty($result)) {
|
||||
die('Une erreur est survenue.');
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
die('Une erreur est survenue.');
|
||||
}
|
||||
?>
|
||||
<div id="charte" style="display:none; width:80%; height:80%;">
|
||||
<?= $result['post_content']; ?>
|
||||
</div>
|
||||
<?php elseif (!empty($errorMsg)) : ?>
|
||||
<div class="return">
|
||||
<p>Envoi annulé :</p>
|
||||
<?php foreach ($errorMsg as $error) : ?>
|
||||
<p><?= $error; ?></p>
|
||||
<?php endforeach ?>
|
||||
</div>
|
||||
</br>
|
||||
<?php endif ?>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
103
public/rgpd/css/style.css
Normal file
103
public/rgpd/css/style.css
Normal file
|
|
@ -0,0 +1,103 @@
|
|||
html, body {
|
||||
width: 100%;
|
||||
height:100%;
|
||||
overflow:hidden;
|
||||
margin: 0;
|
||||
}
|
||||
body {
|
||||
background-color: #fff;
|
||||
background-image: url(../img/bg-page-big.jpg);
|
||||
background-size: auto 100%;
|
||||
background-repeat: no-repeat;
|
||||
background-position: left top;
|
||||
font-family: "helvetica_neue_lt_std75_bold", Helvetica, Arial, sans-serif;
|
||||
font-size: .8em;
|
||||
font-weight: bold;
|
||||
color: #7d7c7c;
|
||||
}
|
||||
|
||||
.container, .return {
|
||||
background-color: #f0f0f0;
|
||||
width: 40%;
|
||||
min-width: 300px;
|
||||
}
|
||||
.container {
|
||||
margin: 25px 25px 0;
|
||||
padding: 10px 5px 0;
|
||||
}
|
||||
fieldset span {
|
||||
font-size: .8em;
|
||||
font-weight: normal;
|
||||
font-style: italic;
|
||||
}
|
||||
fieldset p {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
input, select, textarea {
|
||||
padding: 10px 5px;
|
||||
font-family: "helvetica_neue_lt_std75_bold", Helvetica, Arial, sans-serif;
|
||||
font-size: .9em;
|
||||
font-weight: normal;
|
||||
color: #a7a7a7;
|
||||
font-style: italic;
|
||||
border: none;
|
||||
}
|
||||
/* select {
|
||||
min-width: 215px;
|
||||
} */
|
||||
textarea {
|
||||
width: 80%;
|
||||
resize: none;
|
||||
}
|
||||
fieldset {
|
||||
border: none;
|
||||
}
|
||||
fieldset legend {
|
||||
font-size: 1.5em;
|
||||
}
|
||||
input[type=text] {
|
||||
margin-left: 10px;
|
||||
}
|
||||
input[type=submit] {
|
||||
background-color: #e00d23;
|
||||
color: white;
|
||||
width: 200px;
|
||||
font-weight: bold;
|
||||
font-style: normal;
|
||||
font-size: 1.5em;
|
||||
}
|
||||
.return {
|
||||
margin: 0 25px 0;
|
||||
padding: 1px 5px 1px;
|
||||
}
|
||||
.return a {
|
||||
text-decoration: none;
|
||||
font-weight: bolder;
|
||||
color: #7d7c7c;
|
||||
}
|
||||
/* .return p, #charte p {
|
||||
display: inline-block;
|
||||
} */
|
||||
|
||||
#charte h2 {
|
||||
color: red;
|
||||
}
|
||||
|
||||
input:focus, select:focus, textarea:focus {
|
||||
outline: none;
|
||||
}
|
||||
select:active, select:hover {
|
||||
outline-color: red
|
||||
}
|
||||
input[type=submit]:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.return a:hover, #charte a:hover {
|
||||
color: red;
|
||||
}
|
||||
.return a:visited, #charte a:visited {
|
||||
color: #7d7c7c;
|
||||
}
|
||||
BIN
public/rgpd/img/bg-page-big.jpg
Normal file
BIN
public/rgpd/img/bg-page-big.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 685 KiB |
178
public/rgpd/professionnels/index.php
Normal file
178
public/rgpd/professionnels/index.php
Normal file
|
|
@ -0,0 +1,178 @@
|
|||
<?php
|
||||
require_once(__DIR__ . '/../rgpd-forms-global.php');
|
||||
|
||||
// Tableau de tous les sites pointant sur le formulaire RGPD Groupe LDC
|
||||
$tSitesweb = array('idhalal', 'tda', 'ldc', 'agis-sa', 'sbv');
|
||||
$sDebug = "";
|
||||
$bSendOK = false;
|
||||
|
||||
// Si j'ai des POST
|
||||
if (!empty($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] === 'POST' && !empty($_POST)) {
|
||||
$errorMsg = [];
|
||||
|
||||
if (!reCaptchaV2IsValid($_POST['g-recaptcha-response'] ?? '')) {
|
||||
$errorMsg[] = "Une erreur de validation reCaptcha est survenue. Veuillez réessayer.";
|
||||
} elseif (empty($_POST['lastname']) or empty($_POST['firstname']) or empty($_POST['email'])) {
|
||||
$errorMsg[] = "La demande n'a pas été envoyée car un des champs n'a pas été correctement renseigné.";
|
||||
} else {
|
||||
$sSiteweb = "";
|
||||
|
||||
// Vérification que toutes les informations demandées ont été renseignées
|
||||
$sSource = sanitize_text_field($_POST['source'] ?? '');
|
||||
$sLastName = sanitize_text_field($_POST['lastname'] ?? '');
|
||||
$sFirstName = sanitize_text_field($_POST['firstname'] ?? '');
|
||||
$sMail = sanitize_text_field($_POST['email'] ?? '');
|
||||
$sChoice = sanitize_text_field($_POST['droits'] ?? '');
|
||||
$sMsg = sanitize_text_field($_POST['commentaires'] ?? '');
|
||||
// Vérification mano de la structure de l'adresse mail
|
||||
if (!preg_match("#^[a-z0-9._-]+@[a-z0-9._-]{2,}\.[a-z]{2,4}$#", $sMail)) {
|
||||
$errorMsg[] = "La structure de l'email n'est pas correcte !";
|
||||
}
|
||||
// Dès qu'il y a un GET website, on ctrl selon le tab déclaré en début de code.
|
||||
if (isset($_GET['website'])) {
|
||||
$sSiteweb = htmlspecialchars($_GET['website']);
|
||||
$bSiteOK = false;
|
||||
foreach ($tSitesweb as $site) {
|
||||
if ($sSiteweb == $site) {
|
||||
$bSiteOK = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
// On construit le mail si pas de GET siteweb ou si le GET est OK.
|
||||
if ($sSiteweb == "" || $bSiteOK == true) {
|
||||
//Objet du mail
|
||||
$subject = 'Nouvelles dispositions RGPD - ' . $sSource;
|
||||
|
||||
$right = getChoicedRight($sChoice);
|
||||
|
||||
//Le contenu du mail.
|
||||
$sBody = "<html><head></head><body>";
|
||||
if ($sSiteweb != "") {
|
||||
$sBody .= "<b>Source : </b>" . $sSource . " (via le site web " . $sSiteweb . ")<br><br>";
|
||||
} else {
|
||||
$sBody .= "<b>Source : </b>" . $sSource . "<br><br>";
|
||||
}
|
||||
$sBody .= "<b>Nom : </b>" . $sLastName . "<br>";
|
||||
$sBody .= "<b>Prénom : </b>" . $sFirstName . "<br>";
|
||||
$sBody .= "<b>Email : </b>" . $sMail . "<br><br>";
|
||||
$sBody .= "<b>L'utilisateur souhaite exercer le droit suivant :</b> " . $right . "<br><br>";
|
||||
$sBody .= "<b>Message : </b>" . $sMsg;
|
||||
$sBody .= "</body></html>";
|
||||
|
||||
if (count($errorMsg) === 0) {
|
||||
if (wp_mail(
|
||||
MAIL_CONTACT_RGPD,
|
||||
$subject,
|
||||
$sBody,
|
||||
[
|
||||
"Reply-To: $sFirstName $sLastName <$sMail>"
|
||||
]
|
||||
)) {
|
||||
$bSendOK = true;
|
||||
} else {
|
||||
$errorMsg[] = "Une erreur est survenue, merci de reessayer.";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<link rel="stylesheet" href="../css/style.css" />
|
||||
<script src="https://cdn.jsdelivr.net/npm/jquery@3.4.1/dist/jquery.min.js"></script>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css" />
|
||||
<script src="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.js"></script>
|
||||
<script src='https://www.google.com/recaptcha/api.js' async defer></script>
|
||||
<title>Formulaire RGPD</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container">
|
||||
<form method="POST">
|
||||
<fieldset>
|
||||
<legend>Maîtriser mes données personnelles<?= $sDebug; ?></legend>
|
||||
<p>
|
||||
<label for="nom">Nom*</label>
|
||||
<input type="text" name="lastname" id="nom" style="width:196px;" autofocus required>
|
||||
|
||||
</p>
|
||||
<p>
|
||||
<label for="prenom">Prénom*</label>
|
||||
<input type="text" name="firstname" id="prenom" style="width:177px;" required>
|
||||
</p>
|
||||
<p>
|
||||
<label for="courriel">Email*</label>
|
||||
<input type="text" name="email" id="mail" style="width:191px;" required>
|
||||
</p>
|
||||
<p>
|
||||
<select name="droits" id="selDroits" style="width:250px;">
|
||||
<option value="ask" selected>Quel droit souhaitez-vous exercer ?</option>
|
||||
<option value="check">Vérifier mes données</option>
|
||||
<option value="modify">Rectifier mes données</option>
|
||||
<option value="delete">Effacer mes données</option>
|
||||
<option value="freeze">Geler l'utilisation de mes données</option>
|
||||
<option value="import">Emporter mes données</option>
|
||||
<option value="refuse">M'opposer à l'utilisation de mes données</option>
|
||||
</select>
|
||||
</p>
|
||||
<p>
|
||||
<textarea name="commentaires" id="comment" maxlength="1900" rows="10" placeholder="Informations complémentaires notamment si vous souhaitez nous expliquer les raisons de votre demande (et nous permettre d'améliorer nos services)"></textarea>
|
||||
</p>
|
||||
<div class="g-recaptcha" data-sitekey="<?= RECAPTCHA_V2_PUBLIC; ?>"></div>
|
||||
<p class="button">
|
||||
<span>
|
||||
<input type="hidden" name="source" value="professionnels">
|
||||
<input type="submit" value="Envoyer">
|
||||
</span>
|
||||
<span> </span>
|
||||
<span>*champs obligatoires</span>
|
||||
</p>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<?php if ($bSendOK): ?>
|
||||
<div class="return">
|
||||
<p>Votre demande a été transmise à nos services. Vous recevrez une réponse à l'adresse mail renseignée dans le formulaire dans les plus brefs délais. Pour plus d'informations, merci de consulter notre <a data-fancybox data-src="#charte" href="javascript:;">charte de confidentialité</a>.<br>
|
||||
A bientôt <?= $sFirstName; ?> sur notre site !</p>
|
||||
</div>
|
||||
<?php
|
||||
try {
|
||||
/** @var \wpdb $wpdb */
|
||||
global $wpdb;
|
||||
$query = $wpdb->prepare(
|
||||
"SELECT post_content FROM $charte_TABLE WHERE ID = %d",
|
||||
$charte_POST_ID
|
||||
);
|
||||
$result = $wpdb->get_row($query, ARRAY_A);
|
||||
|
||||
if (empty($result)) {
|
||||
die('Une erreur est survenue.');
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
die('Une erreur est survenue.');
|
||||
}
|
||||
?>
|
||||
<div id="charte" style="display:none; width:80%; height:80%;">
|
||||
<?= $result['post_content']; ?>
|
||||
</div>
|
||||
<?php elseif (!empty($errorMsg)) : ?>
|
||||
<div class="return">
|
||||
<p>Envoi annulé :</p>
|
||||
<?php foreach ($errorMsg as $error) : ?>
|
||||
<p><?= $error; ?></p>
|
||||
<?php endforeach ?>
|
||||
</div>
|
||||
</br>
|
||||
<?php endif ?>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
26
public/rgpd/rgpd-forms-global.php
Normal file
26
public/rgpd/rgpd-forms-global.php
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
<?php
|
||||
|
||||
require_once(__DIR__ . '/../wp/wp-load.php');
|
||||
|
||||
$charte_POST_ID = 1946;
|
||||
$charte_TABLE = "wp01_posts";
|
||||
|
||||
function getChoicedRight(string $input)
|
||||
{
|
||||
switch ($input) {
|
||||
case 'check':
|
||||
return 'Vérifier mes données';
|
||||
case 'modify':
|
||||
return 'Rectifier mes données';
|
||||
case 'delete':
|
||||
return 'Effacer mes données';
|
||||
case 'freeze':
|
||||
return 'Geler l\'utilisation de mes données';
|
||||
case 'import':
|
||||
return 'Emporter mes données';
|
||||
case 'refuse':
|
||||
return 'M\'opposer à l\'utilisation de mes données';
|
||||
default:
|
||||
return 'Aucun choix.';
|
||||
}
|
||||
}
|
||||
161
public/rgpd/salaries/index.php
Normal file
161
public/rgpd/salaries/index.php
Normal file
|
|
@ -0,0 +1,161 @@
|
|||
<?php
|
||||
require_once(__DIR__ . '/../rgpd-forms-global.php');
|
||||
|
||||
$bSendOK = false;
|
||||
|
||||
// Si j'ai des POST
|
||||
if (!empty($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] === 'POST' && !empty($_POST)) {
|
||||
$errorMsg = [];
|
||||
|
||||
if (!reCaptchaV2IsValid($_POST['g-recaptcha-response'] ?? '')) {
|
||||
$errorMsg[] = "Une erreur de validation reCaptcha est survenue. Veuillez réessayer.";
|
||||
} elseif (empty($_POST['site']) or empty($_POST['lastname']) or empty($_POST['firstname']) or empty($_POST['email'])) {
|
||||
$errorMsg[] = "La demande n'a pas été envoyée car un des champs n'a pas été correctement renseigné.";
|
||||
} else {
|
||||
$sSource = sanitize_text_field($_POST['source']);
|
||||
$sLastName = sanitize_text_field($_POST['lastname']);
|
||||
$sFirstName = sanitize_text_field($_POST['firstname']);
|
||||
$sSiteProd = sanitize_text_field($_POST['site']);
|
||||
$sMail = sanitize_text_field($_POST['email']);
|
||||
$sChoice = sanitize_text_field($_POST['droits']);
|
||||
$sMsg = sanitize_text_field($_POST['commentaires']);
|
||||
// Vérification mano de la structure de l'adresse mail
|
||||
if (!preg_match("#^[a-z0-9._-]+@[a-z0-9._-]{2,}\.[a-z]{2,4}$#", $sMail)) {
|
||||
$errorMsg[] = "La structure de l'email n'est pas correcte !";
|
||||
}
|
||||
//Objet du mail
|
||||
$subject = 'Nouvelles dispositions RGPD - ' . $sSource;
|
||||
|
||||
$right = getChoicedRight($sChoice);
|
||||
|
||||
//Le contenu du mail.
|
||||
$sBody = "<html><head></head><body>";
|
||||
$sBody .= "<b>Source : </b>" . $sSource . "<br><br>";
|
||||
$sBody .= "<b>Nom : </b>" . $sLastName . "<br>";
|
||||
$sBody .= "<b>Prénom : </b>" . $sFirstName . "<br>";
|
||||
$sBody .= "<b>Site : </b>" . $sSiteProd . "<br>";
|
||||
$sBody .= "<b>Email : </b>" . $sMail . "<br><br>";
|
||||
$sBody .= "<b>L'utilisateur souhaite exercer le droit suivant :</b> " . $right . "<br><br>";
|
||||
$sBody .= "<b>Message : </b>" . $sMsg;
|
||||
|
||||
if (count($errorMsg) === 0) {
|
||||
if (wp_mail(
|
||||
MAIL_CONTACT_RGPD,
|
||||
$subject,
|
||||
$sBody,
|
||||
[
|
||||
"Reply-To: $sFirstName $sLastName <$sMail>"
|
||||
]
|
||||
)) {
|
||||
$bSendOK = true;
|
||||
} else {
|
||||
$errorMsg[] = "Une erreur est survenue, merci de reessayer.";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
||||
<link rel="stylesheet" href="../css/style.css" />
|
||||
<script src="https://cdn.jsdelivr.net/npm/jquery@3.4.1/dist/jquery.min.js"></script>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css" />
|
||||
<script src="https://cdn.jsdelivr.net/gh/fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.js"></script>
|
||||
<script src='https://www.google.com/recaptcha/api.js' async defer></script>
|
||||
<title>Formulaire RGPD</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container">
|
||||
<form method="POST">
|
||||
<fieldset>
|
||||
<legend>Maîtriser mes données personnelles</legend>
|
||||
<p>
|
||||
<label for="nom">Nom*</label>
|
||||
<input type="text" name="lastname" id="nom" style="width:196px;" autofocus required>
|
||||
|
||||
</p>
|
||||
<p>
|
||||
<label for="prenom">Prénom*</label>
|
||||
<input type="text" name="firstname" id="prenom" style="width:177px;" required>
|
||||
</p>
|
||||
<p>
|
||||
<label for="site">De quelle société du Groupe LDC êtes-vous salarié ?*</label>
|
||||
</p>
|
||||
<p>
|
||||
<input type="text" name="site" id="siteprod" style="width:240px;" required>
|
||||
<p>
|
||||
<p>
|
||||
<label for="prenom">Email*</label>
|
||||
<input type="text" name="email" id="mail" style="width:191px;" required>
|
||||
</p>
|
||||
<p>
|
||||
<select name="droits" id="selDroits" style="width:250px;">
|
||||
<option value="ask" selected>Quel droit souhaitez-vous exercer ?</option>
|
||||
<option value="check">Vérifier mes données</option>
|
||||
<option value="modify">Rectifier mes données</option>
|
||||
<option value="delete">Effacer mes données</option>
|
||||
<option value="freeze">Geler l'utilisation de mes données</option>
|
||||
<option value="import">Emporter mes données</option>
|
||||
<option value="refuse">M'opposer à l'utilisation de mes données</option>
|
||||
</select>
|
||||
</p>
|
||||
<p>
|
||||
<textarea name="commentaires" id="comment" maxlength="1900" rows="10" placeholder="Informations complémentaires notamment si vous souhaitez nous expliquer les raisons de votre demande (et nous permettre d'améliorer nos services)"></textarea>
|
||||
</p>
|
||||
<div class="g-recaptcha" data-sitekey="<?= RECAPTCHA_V2_PUBLIC; ?>"></div>
|
||||
<p class="button">
|
||||
<span>
|
||||
<input type="hidden" name="source" value="salaries">
|
||||
<input type="submit" value="Envoyer">
|
||||
</span>
|
||||
<span> </span>
|
||||
<span>*champs obligatoires</span>
|
||||
</p>
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<?php if ($bSendOK): ?>
|
||||
<div class="return">
|
||||
<p>Votre demande a été transmise à nos services. Vous recevrez une réponse à l'adresse mail renseignée dans le formulaire dans les plus brefs délais. Pour plus d'informations, merci de consulter notre <a data-fancybox data-src="#charte" href="javascript:;">charte de confidentialité</a>.<br>
|
||||
A bientôt <?= $sFirstName; ?> sur notre site !</p>
|
||||
</div>
|
||||
<?php
|
||||
try {
|
||||
/** @var \wpdb $wpdb */
|
||||
global $wpdb;
|
||||
$query = $wpdb->prepare(
|
||||
"SELECT post_content FROM $charte_TABLE WHERE ID = %d",
|
||||
$charte_POST_ID
|
||||
);
|
||||
$result = $wpdb->get_row($query, ARRAY_A);
|
||||
|
||||
if (empty($result)) {
|
||||
die('Une erreur est survenue.');
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
die('Une erreur est survenue.');
|
||||
}
|
||||
?>
|
||||
<div id="charte" style="display:none; width:80%; height:80%;">
|
||||
<?= $result['post_content']; ?>
|
||||
</div>
|
||||
<?php elseif (!empty($errorMsg)) : ?>
|
||||
<div class="return">
|
||||
<p>Envoi annulé :</p>
|
||||
<?php foreach ($errorMsg as $error) : ?>
|
||||
<p><?= $error; ?></p>
|
||||
<?php endforeach ?>
|
||||
</div>
|
||||
</br>
|
||||
<?php endif ?>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
12
public/unsubdr.php
Normal file
12
public/unsubdr.php
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
require_once(__DIR__ . '/wp/wp-load.php');
|
||||
|
||||
global $wpdb;
|
||||
|
||||
if (isset($_GET['email'])) {
|
||||
$email = filter_var($_GET['email'], FILTER_SANITIZE_EMAIL);
|
||||
$wpdb->query("DELETE FROM wp_digitalrecruiter_jobalert WHERE email = '$email'");
|
||||
}
|
||||
|
||||
header('Location: https://www.ldc.fr');
|
||||
exit;
|
||||
186
public/unsubscribe.php
Normal file
186
public/unsubscribe.php
Normal file
|
|
@ -0,0 +1,186 @@
|
|||
<?php
|
||||
|
||||
require_once(__DIR__ . '/wp/wp-load.php');
|
||||
|
||||
use LDC\LDCCRM\Exceptions\ApiErrorException;
|
||||
use LDC\LDCCRM\Exceptions\CrmException;
|
||||
use LDC\LDCCRM\Exceptions\ValidationException;
|
||||
use LDC\LDCCRM\Models\SingleOptin;
|
||||
|
||||
$callOK = false;
|
||||
|
||||
// phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
||||
if (isset($_GET['hashcode']) and !empty($_GET['hashcode'])) {
|
||||
// * Initialise CRM API
|
||||
initApiCrm();
|
||||
|
||||
// phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
||||
$hashcode = sanitize_key($_GET['hashcode']);
|
||||
|
||||
// Seul single optin est géré
|
||||
try {
|
||||
SingleOptin::unsetStatusWithHashcode($hashcode);
|
||||
$callOK = true;
|
||||
} catch (ValidationException | CrmException | ApiErrorException $e) {
|
||||
// phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log,Squiz.PHP.DiscouragedFunctions.Found
|
||||
error_log(sprintf(
|
||||
'ERROR CRM API : %s - %s | hashcode : %s',
|
||||
get_class($e) === ApiErrorException::class ? $e->getApiError()->label : $e->getMessage(),
|
||||
$e->getMessage(),
|
||||
$hashcode
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Désinscription à la newsletter LDC</title>
|
||||
<style>
|
||||
html,
|
||||
body,
|
||||
::before,
|
||||
::after,
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
font-size: 30px;
|
||||
font-weight: normal;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
.post-title {
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
font-size: 1.33em;
|
||||
font-weight: 700;
|
||||
color: #e30613;
|
||||
}
|
||||
|
||||
a {
|
||||
color: #000000;
|
||||
transition: color .5s;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color: #e30613;
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 1em 0;
|
||||
font-size: .8em;
|
||||
}
|
||||
|
||||
span {
|
||||
font-size: .6em;
|
||||
}
|
||||
|
||||
.wrapper-unsub {
|
||||
display: grid;
|
||||
grid-template-rows: min-content min-content auto min-content;
|
||||
justify-items: center;
|
||||
min-height: 100vh;
|
||||
padding: 10vw 4vw;
|
||||
}
|
||||
|
||||
.unsub--logo {
|
||||
width: 60%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.unsub--logo img {
|
||||
width: 100%;
|
||||
max-width: 300px;
|
||||
}
|
||||
|
||||
.unsub--title {
|
||||
margin: 4vw 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.unsub--footer {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
@media only screen and (min-width:768px) {
|
||||
.post-title {
|
||||
font-size: 2em;
|
||||
}
|
||||
|
||||
p {
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
span {
|
||||
font-size: .8em;
|
||||
}
|
||||
|
||||
.wrapper-unsub {
|
||||
padding: 4vw 10vw;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width:1024px) {
|
||||
.post-title {
|
||||
font-size: 2.33em;
|
||||
}
|
||||
|
||||
p {
|
||||
font-size: 1.2em;
|
||||
}
|
||||
|
||||
span {
|
||||
font-size: 1em;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (min-width:1440px) {}
|
||||
|
||||
@media only screen and (min-width:1920px) {}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="wrapper-unsub">
|
||||
<div class="unsub--logo">
|
||||
<img src="/content/themes/ldc/img/logo.png" alt="Logo de la marque LDC">
|
||||
</div>
|
||||
<div class="unsub--title">
|
||||
<h1 class="post-title">Désinscription</h1>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* On ne communique pas sur model not found
|
||||
* pour ne pas créer une page où on peut determiner
|
||||
* qui est inscrit dans la crm
|
||||
*/
|
||||
if ($callOK) { ?>
|
||||
<div class="unsub--content">
|
||||
<p>Vous êtes désinscris de la newsletter LDC.</p>
|
||||
<p>En espérant vous revoir bientôt !</p>
|
||||
</div>
|
||||
<?php } else { ?>
|
||||
<div class="unsub--content">
|
||||
<p>Une erreur est survenue.</p>
|
||||
<p>Veuillez réessayer ultérieurement.</p>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<div class="unsub--footer">
|
||||
<span>Retrouvez-nous sur <a href="https://www.ldc.fr">ldc.fr</a> !</span>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Loading…
Add table
Reference in a new issue