RGPD + bug search

This commit is contained in:
fredtempez 2020-12-12 18:40:08 +01:00
parent 4406458c11
commit 0aad617a33
6 changed files with 75 additions and 47 deletions

View File

@ -1,7 +1,14 @@
# Changelog # Changelog
## Version 10.3.11
Modification :
- Message sur l'utilisation des cookies
Coorection :
- Recherche inopérante dans les articles des blogs.
## Version 10.3.10 ## Version 10.3.10
Corrections : Corrections :
- Conflit page inactive et droit d'un membre. - Conflit page inactive et droit d'un membre.
- Module de recherche, correction dans les pages enfants. - Module de recherche, correction dans les pages enfants.
- Module formulaire, perte des données en cas d'édition du fomulaire ou des champs. - Module formulaire, perte des données en cas d'édition du fomulaire ou des champs.

View File

@ -1,6 +1,6 @@
![](https://img.shields.io/github/last-commit/fredtempez/ZwiiCMS/master) ![](https://img.shields.io/github/release-date/fredtempez/ZwiiCMS) ![](https://img.shields.io/github/last-commit/fredtempez/ZwiiCMS/master) ![](https://img.shields.io/github/release-date/fredtempez/ZwiiCMS)
# ZwiiCMS 10.3.10 # ZwiiCMS 10.3.11
Zwii est un CMS sans base de données (flat-file) qui permet de créer et gérer facilement un site web sans aucune connaissance en programmation. Zwii est un CMS sans base de données (flat-file) qui permet de créer et gérer facilement un site web sans aucune connaissance en programmation.

View File

@ -221,14 +221,18 @@ core.start = function() {
/** /**
* Message sur l'utilisation des cookies * Message sur l'utilisation des cookies
*/ */
var analytics = "";
if (<?php echo json_encode($this->getData(['config', 'analyticsId'])); ?>) {
analytics = ' grâce au cookie Google Analytics'
}
if(<?php echo json_encode($this->getData(['config', 'cookieConsent'])); ?>) { if(<?php echo json_encode($this->getData(['config', 'cookieConsent'])); ?>) {
if(document.cookie.indexOf("ZWII_COOKIE_CONSENT") === -1) { if(document.cookie.indexOf("ZWII_COOKIE_CONSENT") === -1) {
$("body").append( $("body").append(
$("<div>").attr("id", "cookieConsent").append( $("<div>").attr("id", "cookieConsent").append(
$("<span>").text("En poursuivant votre navigation sur ce site, vous acceptez l'utilisation de cookies et de vos données de visite."), $("<span>").html("<p>Ce site utilise des cookies pour assurer l'authentification, améliorer l'expérience utilisateur"+analytics+". <br/>En cliquant sur ”Jaccepte”, vous acceptez lutilisation de ces cookies.</p>"),
$("<span>") $("<span>")
.attr("id", "cookieConsentConfirm") .attr("id", "cookieConsentConfirm")
.text("OK") .text("Accepter")
.on("click", function() { .on("click", function() {
// Créé le cookie d'acceptation // Créé le cookie d'acceptation
var expires = new Date(); var expires = new Date();
@ -237,7 +241,19 @@ core.start = function() {
document.cookie = "ZWII_COOKIE_CONSENT=true;" + expires; document.cookie = "ZWII_COOKIE_CONSENT=true;" + expires;
// Ferme le message // Ferme le message
$(this).parents("#cookieConsent").fadeOut(); $(this).parents("#cookieConsent").fadeOut();
}) }),
$("<span>")
.attr("id", "cookieConsentRefuse")
.text("Refuser")
.on("click", function() {
// Créé le cookie d'acceptation
var expires = new Date();
expires.setFullYear(expires.getFullYear() + 1);
expires = "expires=" + expires.toUTCString();
document.cookie = "ZWII_COOKIE_CONSENT=false;" + expires;
// Ferme le message
$(this).parents("#cookieConsent").fadeOut();
}),
) )
); );
} }

View File

@ -40,7 +40,7 @@ class common {
const ACCESS_TIMER = 1800; const ACCESS_TIMER = 1800;
// Numéro de version // Numéro de version
const ZWII_VERSION = '10.3.10'; const ZWII_VERSION = '10.3.11';
const ZWII_UPDATE_CHANNEL = "v10"; const ZWII_UPDATE_CHANNEL = "v10";
public static $actions = []; public static $actions = [];
@ -1845,9 +1845,9 @@ class core extends common {
} }
// Empêcher l'accès aux page désactivée par URL directe // Empêcher l'accès aux page désactivée par URL directe
if ( ( $this->getData(['page', $this->getUrl(0),'disable']) === true if ( ( $this->getData(['page', $this->getUrl(0),'disable']) === true
AND $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD') AND $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')
) OR ( ) OR (
$this->getData(['page', $this->getUrl(0),'disable']) === true $this->getData(['page', $this->getUrl(0),'disable']) === true
AND $this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD') AND $this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
AND $this->getUser('group') < self::GROUP_MODERATOR AND $this->getUser('group') < self::GROUP_MODERATOR
) )
@ -2196,14 +2196,15 @@ class layout extends common {
* Affiche le script Google Analytics * Affiche le script Google Analytics
*/ */
public function showAnalytics() { public function showAnalytics() {
if($code = $this->getData(['config', 'analyticsId'])) { if($code = $this->getData(['config', 'analyticsId'])
AND $this->getInput('ZWII_COOKIE_CONSENT') === 'true') {
echo '<!-- Global site tag (gtag.js) - Google Analytics --> echo '<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id='. $code .'"></script> <script async src="https://www.googletagmanager.com/gtag/js?id='. $code .'"></script>
<script> <script>
window.dataLayer = window.dataLayer || []; window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);} function gtag(){dataLayer.push(arguments);}
gtag("js", new Date()); gtag("js", new Date());
gtag("config","'. $code .'"); gtag("config","'. $code .'");
</script>'; </script>';
} }
} }
@ -2442,9 +2443,9 @@ class layout extends common {
$itemsLeft .= '<li>'; $itemsLeft .= '<li>';
if ( ( $this->getData(['page',$parentPageId,'disable']) === true if ( ( $this->getData(['page',$parentPageId,'disable']) === true
AND $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD') AND $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')
) OR ( ) OR (
$this->getData(['page',$parentPageId,'disable']) === true $this->getData(['page',$parentPageId,'disable']) === true
AND $this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD') AND $this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
AND $this->getUser('group') < self::GROUP_MODERATOR AND $this->getUser('group') < self::GROUP_MODERATOR
) )
@ -2502,9 +2503,9 @@ class layout extends common {
// Mise en page du sous-item // Mise en page du sous-item
$itemsLeft .= '<li>'; $itemsLeft .= '<li>';
if ( ( $this->getData(['page',$childKey,'disable']) === true if ( ( $this->getData(['page',$childKey,'disable']) === true
AND $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD') AND $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')
) OR ( ) OR (
$this->getData(['page',$childKey,'disable']) === true $this->getData(['page',$childKey,'disable']) === true
AND $this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD') AND $this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
AND $this->getUser('group') < self::GROUP_MODERATOR AND $this->getUser('group') < self::GROUP_MODERATOR
) )

View File

@ -835,31 +835,35 @@ footer #footerSocials .zwiico-github:hover {
background: rgba(33, 34, 35, 1); background: rgba(33, 34, 35, 1);
} }
/* Message sur les cookies */ /* Message sur les cookies */
#cookieConsent { #cookieConsent {
opacity: .9; width: 80%;
background: #212223; margin: auto;
position: fixed; opacity: .9;
right: 0; background: #212223;
bottom: 0; position: fixed;
left: 0; right: 0;
color: #FFF; bottom: 5%;
padding: 10px; left: 0;
z-index: 60; color: #FFF;
text-align: center; padding: 10px;
font-size: .9em; z-index: 60;
} text-align: center;
#cookieConsentConfirm { font-size: 1em;
cursor: pointer; }
margin-left: 10px;
background: #666; #cookieConsentConfirm, #cookieConsentRefuse {
padding: 4px 8px; cursor: pointer;
display: inline-block; margin-left: 10px;
transition: background .3s ease-out; background: #666;
} padding: 4px 8px;
#cookieConsentConfirm:hover { display: inline-block;
background: #777; transition: background .3s ease-out;
} }
#cookieConsentConfirm:hover, #cookieConsentRefuse:hover {
background: #777;
}
/* Bloc */ /* Bloc */
.block { .block {

View File

@ -126,8 +126,8 @@ class search extends common {
foreach($childIds as $childId) { foreach($childIds as $childId) {
// Sous page // Sous page
if ($this->getData(['page', $childId, 'disable']) === false && if ($this->getData(['page', $childId, 'disable']) === false &&
$this->getUser('group') >= $this->getData(['page', $childId, 'group']) && $this->getUser('group') >= $this->getData(['page', $parentId, 'group']) &&
$this->getData(['page', $childId, 'block']) !== 'bar') { $this->getData(['page', $parentId, 'block']) !== 'bar') {
$url = $childId; $url = $childId;
$titre = $this->getData(['page', $childId, 'title']); $titre = $this->getData(['page', $childId, 'title']);
$contenu = ' ' . $titre . ' ' . $this->getData(['page', $childId, 'content']); $contenu = ' ' . $titre . ' ' . $this->getData(['page', $childId, 'content']);