diff options
| author | Debulois <quentin@debulois.fr> | 2022-05-09 20:03:42 +0200 |
|---|---|---|
| committer | Debulois <quentin@debulois.fr> | 2022-05-09 20:03:42 +0200 |
| commit | 105b825923ce03fc43eacb0575212fe52336ce34 (patch) | |
| tree | 109e0736a1b196f2d43f7ffcb8538e04bf20bcea | |
| parent | 588c4ceb78fae443ca8f9446d256f5474a3bf66a (diff) | |
Mis en place du RGPD
| -rw-r--r-- | Static/Css/footer.css | 4 | ||||
| -rw-r--r-- | Static/Css/main.css | 1 | ||||
| -rw-r--r-- | Static/Css/rgpd.css | 107 | ||||
| -rw-r--r-- | Static/Js/googleAnalitycs.js | 11 | ||||
| -rw-r--r-- | Static/Js/rgpd.js | 19 | ||||
| -rw-r--r-- | Template/Include/incl_global_footer.php | 1 | ||||
| -rw-r--r-- | Template/Include/incl_global_rgpd.php | 34 | ||||
| -rw-r--r-- | Template/Include/incl_index_rgpd.php | 33 | ||||
| -rw-r--r-- | Template/login.php | 6 | ||||
| -rw-r--r-- | Template/message.php | 6 | ||||
| -rw-r--r-- | Template/mission.php | 6 | ||||
| -rw-r--r-- | Template/myMission.php | 6 | ||||
| -rw-r--r-- | Template/register.php | 6 | ||||
| -rw-r--r-- | Template/rgpd.php | 39 | ||||
| -rw-r--r-- | Template/userInfo.php | 6 | ||||
| -rw-r--r-- | index.php | 18 |
16 files changed, 300 insertions, 3 deletions
diff --git a/Static/Css/footer.css b/Static/Css/footer.css index 1035cc0..e86c352 100644 --- a/Static/Css/footer.css +++ b/Static/Css/footer.css @@ -18,3 +18,7 @@ footer { color: var(--footerTextColor); background-color: var(--footerBgColor); } + +footer a { + color: #695454; +} diff --git a/Static/Css/main.css b/Static/Css/main.css index 4802d61..cbb7849 100644 --- a/Static/Css/main.css +++ b/Static/Css/main.css @@ -182,6 +182,7 @@ main table { Overflow-y: auto; padding: 1em; border-collapse: collapse; + width: -moz-fit-content; width: fit-content; max-width: 95%; margin-left: auto; diff --git a/Static/Css/rgpd.css b/Static/Css/rgpd.css new file mode 100644 index 0000000..023b5ad --- /dev/null +++ b/Static/Css/rgpd.css @@ -0,0 +1,107 @@ + +/* +############################################################################ +# # +# Description: CSS spécifique au bandeau RGPD # +# # +############################################################################ +*/ + +#rgpd { + position: fixed; + display: flex; + flex-direction: column; + justify-content: space-around; + z-index: 3; + width: 100%; + height: 100%; + background-color: #10101090; +} + +#rgpd section { + display: flex; + flex-direction: column; + position: relative; + width: -moz-fit-content; + width: fit-content; + max-width: 50%; + margin-left: auto; + margin-right: auto; + padding: 1em; + background-color: var(--bg); + border: 4px solid var(--mainSiteColor); + border-radius: 10px; + font-size: var(--fontSizeSmallLess); +} + +#rgpd h3 { + margin-left: auto; + margin-right: auto; + width: -moz-fit-content; + width: fit-content; + font-size: var(--fontSizeMedium); + border-bottom: var(--mainSiteColor) 2px solid; +} + +#mainRgpd { + display: flex; + padding: 1em; +} + +#mainRgpd p { + margin-left: auto; + margin-right: auto; + max-width: 80%; +} + +#rgpd span { + display: flex; + flex-direction: column; + justify-content: space-around; + padding: 0.2em; + font-size: 64px; +} + +#btnRgpd { + display: flex; + margin-left: auto; + margin-right: 1em; + padding: 1em; + gap: 1em; +} + +#rgpdAccept, #rgpdDecline { + background-color: var(--bg); + border-radius: 5px; + padding: 0.4em 0.6em; + transition: all 0.08s ease-in-out; +} + +#rgpdAccept:hover, #rgpdDecline:hover { + cursor: pointer; + color: var(--bg); +} + +#rgpdAccept { + color: #145814; + border: 2px solid #218a21; +} + +#rgpdDecline { + color: #5e5e5e; + border: 2px solid #a1a1a1; +} + +#rgpdAccept:hover { + background-color: #218a21; +} + +#rgpdDecline:hover { + background-color: #a1a1a1; +} + +@media screen and (max-width: 768px) { + #rgpd section { + max-width: 80%; + } +} diff --git a/Static/Js/googleAnalitycs.js b/Static/Js/googleAnalitycs.js new file mode 100644 index 0000000..c67770f --- /dev/null +++ b/Static/Js/googleAnalitycs.js @@ -0,0 +1,11 @@ + +// ############################################################################ +// # # +// # Description: Global site tag (gtag.js) - Google Analytics # +// # # +// ############################################################################ + +window.dataLayer = window.dataLayer || []; +function gtag(){dataLayer.push(arguments);} +gtag('js', new Date()); +gtag('config', 'G-'); // G-XXXXXXXXXX -> Clef API à récupérer chez google diff --git a/Static/Js/rgpd.js b/Static/Js/rgpd.js new file mode 100644 index 0000000..a134717 --- /dev/null +++ b/Static/Js/rgpd.js @@ -0,0 +1,19 @@ + +// ############################################################################ +// # # +// # Description: JS uniquement utile dans l'index # +// # # +// ############################################################################ + +// Bind du boutton Accepter et Supprimer pour les cookies de google analytics +// L'option secure oblige le cookie à être transmis uniquement en https +// Le max-age corrspond ici à un an, 60 sec x 60 min x 24H x 364 jours +document.getElementById("rgpdAccept").addEventListener("click", () => { + document.cookie = "RGPD_ACCEPT=1; max-age=" + 60*60*24*364 + "; path=/; Secure;"; + window.location.reload() +}); + +document.getElementById("rgpdDecline").addEventListener("click", () => { + document.cookie = "RGPD_ACCEPT=0; max-age=" + 60*60*24*364 + "; path=/; Secure;"; + window.location.reload() +});
\ No newline at end of file diff --git a/Template/Include/incl_global_footer.php b/Template/Include/incl_global_footer.php index d1ecc2e..6b23f0a 100644 --- a/Template/Include/incl_global_footer.php +++ b/Template/Include/incl_global_footer.php @@ -20,6 +20,7 @@ echo('<!-- Separateur --> // **************************************************************************** echo('<!-- Pied de page --> <footer> + <p><a href="/Template/rgpd.php">Politique de protection des données</a></p> <p>'.$text[basename(__FILE__, ".php")]["main"].'</p> </footer>'.PHP_EOL) diff --git a/Template/Include/incl_global_rgpd.php b/Template/Include/incl_global_rgpd.php new file mode 100644 index 0000000..3b78719 --- /dev/null +++ b/Template/Include/incl_global_rgpd.php @@ -0,0 +1,34 @@ +<?php + +// ############################################################################ +// # # +// # Description: Partie principale de la protection des vie privées # +// # # +// ############################################################################ + +echo("<!-- Division principale --> +<main id='mainRgpd'> + <h2>Politique de protection des données</h2> + <h3>Traitement de vos donées personelles</h3> + <p> + Lorsque vous visitez notre site internet \"Alphajob\", vous laissez derrière vous des données personelles pouvant + servir à vous identifier comme votre adresse IP. Des données personnelle sont également enregistrées + lors de la création d'un compte ou lorsque vous remplissez votre fiche personelle associée à ce dernier, ces données personelles + sont conservés, mais en aucun cas ne seront communiquées à un quelconque tiers. + </p> + <h3>Vos droits</h3> + <p> + En tant qu'utilisateur, vous posédez un droit d'accès, de rectifications ou encore d'effacement + des données personelles vous concernant, vous pouvez nous faire part de votre volonté d'exercer ce droit par mail. + Le responsable du traitement des données personnelles est Quentin Debulois et peut être contacté par + mail à cette adresse: quentin@debulois.fr + </p> + <h3>En savoir plus</h3> + <p> + <a href='https://www.cnil.fr/fr/donnees-personnelles' target='_blank'>CNIL RGPD infos</a><br> + <a href='https://lincnil.github.io/Guide-RGPD-du-developpeur/#D%C3%A9finition' target='_blank'>CNIL RGPD for dev</a><br> + <a href='https://gdpr.eu/?cn-reloaded=1' target='_blank'>GPDR EU (Anglais)</a> + </p> +</main>"); + +?>
\ No newline at end of file diff --git a/Template/Include/incl_index_rgpd.php b/Template/Include/incl_index_rgpd.php new file mode 100644 index 0000000..dbebf16 --- /dev/null +++ b/Template/Include/incl_index_rgpd.php @@ -0,0 +1,33 @@ +<?php + +// ############################################################################ +// # # +// # Description: Bandeau donnant le choix pour les cookies tiers # +// # # +// ############################################################################ + +echo("<!-- RGPD --> +<aside id='rgpd'> + <section> + <div id='mainRgpd'> + <div> + <h3>Choisissez quels cookies vous voulez ! 😋</h3> + <p>Afin de pouvoir avoir une meilleur vue d'ensemble sur la façon dont nos + visiteurs utilise notre site web, nous placons + <a href='https://marketingplatform.google.com/intl/fr/about/analytics/' target='_blank'>des cookies traçeurs fournies par Google</a>. + </p> + <p> + Cependant, conformément à <a href='https://www.cnil.fr/sites/default/files/atoms/files/lignes_directrices_de_la_cnil_sur_les_cookies_et_autres_traceurs.pdf' target='_blank'>la délibération n°2020-091 du 17 septembre 2020</a> + de la CNIL, vous avez le choix de refuser ou d'accepter ces cookies en cliquant sur l'un des deux boutons ci-dessous. + </p> + </div> + <span>🍪</span> + </div> + <div id='btnRgpd'> + <button type='button' id='rgpdDecline'>Refuser</button> + <button type='button' id='rgpdAccept'>Accepter</button> + </div> + </section> +</aside>"); + +?>
\ No newline at end of file diff --git a/Template/login.php b/Template/login.php index 4558cbf..d91306a 100644 --- a/Template/login.php +++ b/Template/login.php @@ -22,6 +22,12 @@ $_SESSION["src"] = basename(__FILE__, ".php"); <?php echo('<html lang="'.$_SESSION["lang"].'">'.PHP_EOL); ?> <!-- Balise contenant les metadata --> <head> +<?php +if (isset($_COOKIE["RGPD_ACCEPT"]) && $_COOKIE["RGPD_ACCEPT"]) { + echo(' <!-- Google analitycs --> + <script async src="https://www.googletagmanager.com/gtag/js?id=G-YK3Q3ES11T"></script> + <script src="/Static/Js/googleAnalitycs.js"></script>'); +}?> <?php require_once(dirname( __FILE__ )."/Include/incl_global_header.php"); ?> <?php echo(' <link href="/Static/Css/login.css" rel="stylesheet">'.PHP_EOL); ?> <?php require_once(dirname( __FILE__ )."/Include/".$_SESSION["lang"]."/title.php"); ?> diff --git a/Template/message.php b/Template/message.php index b9bf58b..baaf0a7 100644 --- a/Template/message.php +++ b/Template/message.php @@ -26,6 +26,12 @@ if (!isset($_SESSION["message"])) { <?php echo('<html lang="'.$_SESSION["lang"].'">'.PHP_EOL); ?> <!-- Balise contenant les metadata --> <head> +<?php +if (isset($_COOKIE["RGPD_ACCEPT"]) && $_COOKIE["RGPD_ACCEPT"]) { + echo(' <!-- Google analitycs --> + <script async src="https://www.googletagmanager.com/gtag/js?id=G-YK3Q3ES11T"></script> + <script src="/Static/Js/googleAnalitycs.js"></script>'); +}?> <?php require_once(dirname( __FILE__ )."/Include/incl_global_header.php"); ?> <?php echo(' <link href="/Static/Css/message.css" rel="stylesheet">'.PHP_EOL); ?> <?php require_once(dirname( __FILE__ )."/Include/".$_SESSION["lang"]."/title.php"); ?> diff --git a/Template/mission.php b/Template/mission.php index 33aa0c5..9cac87a 100644 --- a/Template/mission.php +++ b/Template/mission.php @@ -33,6 +33,12 @@ $_SESSION["src"] = basename(__FILE__, ".php"); <?php echo('<html lang="'.$_SESSION["lang"].'">'.PHP_EOL); ?> <!-- Balise contenant les metadata --> <head> +<?php +if (isset($_COOKIE["RGPD_ACCEPT"]) && $_COOKIE["RGPD_ACCEPT"]) { + echo(' <!-- Google analitycs --> + <script async src="https://www.googletagmanager.com/gtag/js?id=G-YK3Q3ES11T"></script> + <script src="/Static/Js/googleAnalitycs.js"></script>'); +}?> <?php require_once(dirname( __FILE__ )."/Include/incl_global_header.php"); ?> <?php echo(' <link href="/Static/Css/mission.css" rel="stylesheet">'.PHP_EOL); ?> <?php require_once(dirname( __FILE__ )."/Include/".$_SESSION["lang"]."/title.php"); ?> diff --git a/Template/myMission.php b/Template/myMission.php index dc7b79f..f488263 100644 --- a/Template/myMission.php +++ b/Template/myMission.php @@ -33,6 +33,12 @@ $_SESSION["src"] = basename(__FILE__, ".php"); <?php echo('<html lang="'.$_SESSION["lang"].'">'.PHP_EOL); ?> <!-- Balise contenant les metadata --> <head> +<?php +if (isset($_COOKIE["RGPD_ACCEPT"]) && $_COOKIE["RGPD_ACCEPT"]) { + echo(' <!-- Google analitycs --> + <script async src="https://www.googletagmanager.com/gtag/js?id=G-YK3Q3ES11T"></script> + <script src="/Static/Js/googleAnalitycs.js"></script>'); +}?> <?php require_once(dirname( __FILE__ )."/Include/incl_global_header.php"); ?> <?php echo(' <link href="/Static/Css/myMission.css" rel="stylesheet">'.PHP_EOL); ?> <?php require_once(dirname( __FILE__ )."/Include/".$_SESSION["lang"]."/title.php"); ?> diff --git a/Template/register.php b/Template/register.php index e92eeb1..cb5d5d4 100644 --- a/Template/register.php +++ b/Template/register.php @@ -22,6 +22,12 @@ $_SESSION["src"] = basename(__FILE__, ".php"); <?php echo('<html lang="'.$_SESSION["lang"].'">'.PHP_EOL); ?> <!-- Balise contenant les metadata --> <head> +<?php +if (isset($_COOKIE["RGPD_ACCEPT"]) && $_COOKIE["RGPD_ACCEPT"]) { + echo(' <!-- Google analitycs --> + <script async src="https://www.googletagmanager.com/gtag/js?id=G-YK3Q3ES11T"></script> + <script src="/Static/Js/googleAnalitycs.js"></script>'); +}?> <?php require_once(dirname( __FILE__ )."/Include/incl_global_header.php"); ?> <?php echo(' <link href="/Static/Css/register.css" rel="stylesheet">'.PHP_EOL); ?> <?php require_once(dirname( __FILE__ )."/Include/".$_SESSION["lang"]."/title.php"); ?> diff --git a/Template/rgpd.php b/Template/rgpd.php new file mode 100644 index 0000000..e155e91 --- /dev/null +++ b/Template/rgpd.php @@ -0,0 +1,39 @@ +<?php + +// ############################################################################ +// # # +// # Description: Page qui affiche la politique de protection des données # +// # # +// ############################################################################ + +// Démarrage de la session. +session_start(); + +// Utilisation de "dirname" pour réaliser des imports en chemin absolue. +// Import du dossier des textes en fonction de +// la langue sélectionnée dans la variable lang de la session. +?> +<!-- Déclaration du type de document --> +<!DOCTYPE html> +<!-- Balise racine d'un document HTML --> +<?php echo('<html lang="fr">'.PHP_EOL); ?> +<!-- Balise contenant les metadata --> +<head> +<?php +if (isset($_COOKIE["RGPD_ACCEPT"]) && $_COOKIE["RGPD_ACCEPT"]) { + echo(' <!-- Google analitycs --> + <script async src="https://www.googletagmanager.com/gtag/js?id=G-YK3Q3ES11T"></script> + <script src="/Static/Js/googleAnalitycs.js"></script>'); +}?> +<?php require_once(dirname( __FILE__ )."/Include/incl_global_header.php"); ?> +<?php echo(' <link href="/Static/Css/rgpd.css" rel="stylesheet">'.PHP_EOL); ?> +<?php echo(" <title>Politique de protection des données</title>".PHP_EOL); ?> +</head> +<!-- Balise principale contenant le corps du document HTML --> +<body> +<?php require_once(dirname( __FILE__ )."/Include/incl_global_navbar.php"); ?> +<?php require_once(dirname( __FILE__ )."/Include/incl_global_rgpd.php"); ?> +<?php require_once(dirname( __FILE__ )."/Include/incl_global_footer.php"); ?> + <?php echo('<script src="/Static/Js/main.js"></script>'); ?> +</body> +</html> diff --git a/Template/userInfo.php b/Template/userInfo.php index 192e568..989cce1 100644 --- a/Template/userInfo.php +++ b/Template/userInfo.php @@ -31,6 +31,12 @@ $_SESSION["src"] = basename(__FILE__, ".php"); <?php echo('<html lang="'.$_SESSION["lang"].'">'.PHP_EOL); ?> <!-- Balise contenant les metadata --> <head> +<?php +if (isset($_COOKIE["RGPD_ACCEPT"]) && $_COOKIE["RGPD_ACCEPT"]) { + echo(' <!-- Google analitycs --> + <script async src="https://www.googletagmanager.com/gtag/js?id=G-YK3Q3ES11T"></script> + <script src="/Static/Js/googleAnalitycs.js"></script>'); +}?> <?php require_once(dirname( __FILE__ )."/Include/incl_global_header.php"); ?> <?php echo(' <link href="/Static/Css/userInfo.css" rel="stylesheet">'.PHP_EOL); ?> <?php require_once(dirname( __FILE__ )."/Include/".$_SESSION["lang"]."/title.php"); ?> @@ -43,10 +43,19 @@ if (isset($_COOKIE["autoLogin"]) && $_SESSION["loggedIn"] == false) { <?php echo('<html lang="'.$_SESSION["lang"].'">'.PHP_EOL); ?> <!-- Balise contenant les metadata --> <head> +<?php +if (isset($_COOKIE["RGPD_ACCEPT"]) && $_COOKIE["RGPD_ACCEPT"]) { + echo(' <!-- Google analitycs --> + <script async src="https://www.googletagmanager.com/gtag/js?id=G-YK3Q3ES11T"></script> + <script src="/Static/Js/googleAnalitycs.js"></script>'); +}?> <?php require_once(dirname( __FILE__ )."/Template/Include/incl_global_header.php"); ?> <?php if (isset($_SESSION["notification"]) && $_SESSION["notification"]) { echo(' <link href="/Static/Css/notification.css" rel="stylesheet">'.PHP_EOL); } ?> +<?php if (!isset($_SESSION["rgpd"])) { + echo(' <link href="/Static/Css/rgpd.css" rel="stylesheet">'.PHP_EOL); +} ?> <?php echo(' <link href="/Static/Css/slideshow.css" rel="stylesheet">'.PHP_EOL); ?> <?php echo(' <link href="/Static/Css/search.css" rel="stylesheet">'.PHP_EOL); ?> <?php require_once(dirname( __FILE__ )."/Template/Include/".$_SESSION["lang"]."/title.php"); ?> @@ -54,9 +63,6 @@ if (isset($_COOKIE["autoLogin"]) && $_SESSION["loggedIn"] == false) { </head> <!-- Balise principale contenant le corps du document HTML --> <body> -<?php if (isset($_SESSION["notification"]) && $_SESSION["notification"]) { - require_once("./Template/Include/incl_global_notification.php"); -} ?> <?php require_once("./Template/Include/incl_global_navbar.php"); ?> <?php require_once("./Template/Include/incl_index_slideshow.php"); ?> <?php require_once("./Template/Include/incl_index_search.php");?> @@ -64,7 +70,13 @@ if (isset($_COOKIE["autoLogin"]) && $_SESSION["loggedIn"] == false) { <script src="/Static/Js/main.js"></script> <script src="/Static/Js/index.js"></script> <?php if (isset($_SESSION["notification"]) && $_SESSION["notification"]) { + require_once("./Template/Include/incl_global_notification.php"); echo(' <script src="/Static/Js/notification.js"></script>'); } ?> +<?php if (!isset($_COOKIE["RGPD_ACCEPT"])) { + require_once("./Template/Include/incl_index_rgpd.php"); + echo(' <!-- RGPD --> + <script src="/Static/Js/rgpd.js"></script>'); +}?> </body> </html>
\ No newline at end of file |
