This commit is contained in:
Fred Tempez 2023-07-06 17:05:08 +02:00
commit 13af9832f7
30 changed files with 528 additions and 438 deletions

View File

@ -1,10 +1,16 @@
# Changelog # Changelog
## Version 12.4.00 ## Version 13.0.00
# Améliorations # Améliorations
- Gestion des groupes de profils d'utilisateurs. - Gestion des groupes de profils d'utilisateurs.
- Sécurise l'accès aux fonctions sensibles du CLMS.
- Améliore la gestion de la base de données et la génération du fichier de journalisation. - Améliore la gestion de la base de données et la génération du fichier de journalisation.
- Stockage des données JSON, forçage au format objet. - Stockage des données JSON, forçage au format objet.
- Correction de bugs mineurs dans la sauvegarde des modules installés.
## Version 12.4.00
- L'ID de session n'est plus transmise dans l'URL, les modules distribués ont été actualisés.
- Corrections de bug dans le module Blog, merci de consulter le fichier changes.log du module.
## Version 12.3.11 ## Version 12.3.11
- Interdit la création d'une langue autrement que par un administrateur. - Interdit la création d'une langue autrement que par un administrateur.

View File

@ -1,4 +1,4 @@
# ZwiiCMS 12.3.11 # ZwiiCMS 13.0.00
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

@ -1,4 +1,4 @@
# ZwiiCMS 12.3.11 # ZwiiCMS 13.0.00
Zwii is a database-less (flat-file) CMS that allows you to easily create and manage a web site without any programming knowledge. Zwii is a database-less (flat-file) CMS that allows you to easily create and manage a web site without any programming knowledge.

View File

@ -575,7 +575,7 @@ class layout extends common
and $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD') and $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')
) or ($this->getData(['page', $parentPageId, 'disable']) === true ) or ($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_EDITOR
) )
) { ) {
$pageUrl = ($this->getData(['locale', 'homePageId']) === $this->getUrl(0)) ? helper::baseUrl(false) : helper::baseUrl() . $this->getUrl(0); $pageUrl = ($this->getData(['locale', 'homePageId']) === $this->getUrl(0)) ? helper::baseUrl(false) : helper::baseUrl() . $this->getUrl(0);
@ -641,7 +641,7 @@ class layout extends common
and $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD') and $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')
) or ($this->getData(['page', $childKey, 'disable']) === true ) or ($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_EDITOR
) )
) { ) {
$pageUrl = ($this->getData(['locale', 'homePageId']) === $this->getUrl(0)) ? helper::baseUrl(false) : helper::baseUrl() . $this->getUrl(0); $pageUrl = ($this->getData(['locale', 'homePageId']) === $this->getUrl(0)) ? helper::baseUrl(false) : helper::baseUrl() . $this->getUrl(0);
@ -876,7 +876,7 @@ class layout extends common
// Items de gauche // Items de gauche
$leftItems = ''; $leftItems = '';
// Sélecteur de langues // Sélecteur de langues
if ($this->getUser('group') >= self::GROUP_MODERATOR) { if ($this->getUser('group') >= self::GROUP_EDITOR) {
$c = 0; $c = 0;
$leftItem = ''; $leftItem = '';
foreach (self::$languages as $key => $value) { foreach (self::$languages as $key => $value) {
@ -893,7 +893,7 @@ class layout extends common
} }
} }
// Liste des pages // Liste des pages
if ($this->getUser('group') >= self::GROUP_MODERATOR) { if ($this->getUser('group') >= self::GROUP_EDITOR) {
$leftItems .= '<li><select id="barSelectPage">'; $leftItems .= '<li><select id="barSelectPage">';
$leftItems .= '<option value="">' . helper::translate('Pages du site') . '</option>'; $leftItems .= '<option value="">' . helper::translate('Pages du site') . '</option>';
$leftItems .= '<optgroup label="' . helper::translate('Pages orphelines') . '">'; $leftItems .= '<optgroup label="' . helper::translate('Pages orphelines') . '">';
@ -1006,7 +1006,7 @@ class layout extends common
// Items de droite // Items de droite
$rightItems = ''; $rightItems = '';
if ( if (
$this->getUser('group') >= self::GROUP_MODERATOR $this->getUser('group') >= self::GROUP_EDITOR
&& $this->getUser( && $this->getUser(
'permission', 'permission',
'filemanager' 'filemanager'
@ -1066,7 +1066,7 @@ class layout extends common
} }
} }
if ( if (
$this->getUser('group') >= self::GROUP_MODERATOR $this->getUser('group') >= self::GROUP_EDITOR
&& $this->getUser('permission', 'user', 'edit') && $this->getUser('permission', 'user', 'edit')
) { ) {
@ -1153,7 +1153,7 @@ class layout extends common
$vars .= 'var baseUrlQs = ' . json_encode(helper::baseUrl()) . ';'; $vars .= 'var baseUrlQs = ' . json_encode(helper::baseUrl()) . ';';
if ( if (
$this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD') $this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
and $this->getUser('group') >= self::GROUP_MODERATOR and $this->getUser('group') >= self::GROUP_EDITOR
) { ) {
$vars .= 'var privateKey = ' . json_encode(md5_file(self::DATA_DIR . 'core.json')) . ';'; $vars .= 'var privateKey = ' . json_encode(md5_file(self::DATA_DIR . 'core.json')) . ';';
} }

View File

@ -541,7 +541,7 @@ class core extends common
and $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD') and $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD')
) or ($this->getData(['page', $this->getUrl(0), 'disable']) === true ) or ($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_EDITOR
) )
) { ) {
$access = false; $access = false;

View File

@ -27,7 +27,7 @@ class common
const GROUP_BANNED = -1; const GROUP_BANNED = -1;
const GROUP_VISITOR = 0; const GROUP_VISITOR = 0;
const GROUP_MEMBER = 1; const GROUP_MEMBER = 1;
const GROUP_MODERATOR = 2; const GROUP_EDITOR = 2;
const GROUP_ADMIN = 3; const GROUP_ADMIN = 3;
const SIGNATURE_ID = 1; const SIGNATURE_ID = 1;
const SIGNATURE_PSEUDO = 2; const SIGNATURE_PSEUDO = 2;
@ -136,24 +136,24 @@ class common
self::GROUP_BANNED => 'Banni', self::GROUP_BANNED => 'Banni',
self::GROUP_VISITOR => 'Visiteur', self::GROUP_VISITOR => 'Visiteur',
self::GROUP_MEMBER => 'Membre', self::GROUP_MEMBER => 'Membre',
self::GROUP_MODERATOR => 'Éditeur', self::GROUP_EDITOR => 'Éditeur',
self::GROUP_ADMIN => 'Administrateur' self::GROUP_ADMIN => 'Administrateur'
]; ];
public static $groupEdits = [ public static $groupEdits = [
self::GROUP_BANNED => 'Banni', self::GROUP_BANNED => 'Banni',
self::GROUP_MEMBER => 'Membre', self::GROUP_MEMBER => 'Membre',
self::GROUP_MODERATOR => 'Éditeur', self::GROUP_EDITOR => 'Éditeur',
self::GROUP_ADMIN => 'Administrateur' self::GROUP_ADMIN => 'Administrateur'
]; ];
public static $groupNews = [ public static $groupNews = [
self::GROUP_MEMBER => 'Membre', self::GROUP_MEMBER => 'Membre',
self::GROUP_MODERATOR => 'Éditeur', self::GROUP_EDITOR => 'Éditeur',
self::GROUP_ADMIN => 'Administrateur' self::GROUP_ADMIN => 'Administrateur'
]; ];
public static $groupPublics = [ public static $groupPublics = [
self::GROUP_VISITOR => 'Visiteur', self::GROUP_VISITOR => 'Visiteur',
self::GROUP_MEMBER => 'Membre', self::GROUP_MEMBER => 'Membre',
self::GROUP_MODERATOR => 'Éditeur', self::GROUP_EDITOR => 'Éditeur',
self::GROUP_ADMIN => 'Administrateur' self::GROUP_ADMIN => 'Administrateur'
]; ];

View File

@ -974,8 +974,8 @@ if ($this->getData(['core', 'dataVersion']) < 12309) {
// tableau des langues installées // tableau des langues installées
if (is_dir(self::DATA_DIR . $key)) { if (is_dir(self::DATA_DIR . $key)) {
$d = json_decode(file_get_contents(self::DATA_DIR . $key . '/locale.json'), true); $d = json_decode(file_get_contents(self::DATA_DIR . $key . '/locale.json'), true);
$d = array_merge($d['locale'],['poweredPageLabel' => 'Motorisé par']); $d = array_merge($d['locale'], ['poweredPageLabel' => 'Motorisé par']);
$t ['locale'] = $d; $t['locale'] = $d;
file_put_contents(self::DATA_DIR . $key . '/locale.json', json_encode($t)); file_put_contents(self::DATA_DIR . $key . '/locale.json', json_encode($t));
} }
} }
@ -985,7 +985,7 @@ if ($this->getData(['core', 'dataVersion']) < 12309) {
} }
// Version 12.4.00 // Version 12.4.00
if ($this->getData(['core', 'dataVersion']) < 12400) { if ($this->getData(['core', 'dataVersion']) < 13000) {
// Nettoyage du dossier de langue d'installation' // Nettoyage du dossier de langue d'installation'
if (file_exists('core/vendor/tinymce/langs/langs.zip')) if (file_exists('core/vendor/tinymce/langs/langs.zip'))
@ -999,15 +999,27 @@ if ($this->getData(['core', 'dataVersion']) < 12400) {
if (file_exists('core/module/install/ressource/i18n/gr_GR.json')) if (file_exists('core/module/install/ressource/i18n/gr_GR.json'))
unlink('core/module/install/ressource/i18n/gr_GR.json'); unlink('core/module/install/ressource/i18n/gr_GR.json');
// Création du dossier partga pour les nouveaux droits // Création du dossier partage pour les nouveaux droits
if (!is_dir(self::FILE_DIR . 'source/partage')) { if (!is_dir(self::FILE_DIR . 'source/partage')) {
mkdir(self::FILE_DIR . 'source/partage'); mkdir(self::FILE_DIR . 'source/partage');
} }
// Efface le script router.php // Efface le script router.php
if (file_exists('core/class/router.class.php')) // if (file_exists('core/class/router.class.php'))
unlink('core/class/router.class.php'); // unlink('core/class/router.class.php');
// Ajouter le prénom comme pseudo et le pseudo comme signature
foreach ($this->getData(['user']) as $userId => $userIds) {
switch ($this->getData(['user', $userId, 'group'])) {
case '1':
case '2':
$this->setData(['user', $userId, 'profil', 1]);
break;
default:
$this->setData(['user', $userId, 'profil', 0]);
break;
}
}
// Mise à jour // Mise à jour
$this->setData(['core', 'dataVersion', 12400]); $this->setData(['core', 'dataVersion', 13000]);
} }

View File

@ -647,6 +647,15 @@ class config extends common
public function logReset() public function logReset()
{ {
// Action interdite
if (
$this->getUser('permission', __CLASS__, __FUNCTION__) !== true
) {
// Valeurs en sortie
$this->addOutput([
'access' => false
]);
} else {
if (file_exists(self::DATA_DIR . 'journal.log')) { if (file_exists(self::DATA_DIR . 'journal.log')) {
unlink(self::DATA_DIR . 'journal.log'); unlink(self::DATA_DIR . 'journal.log');
// Créer les en-têtes des journaux // Créer les en-têtes des journaux
@ -669,6 +678,7 @@ class config extends common
]); ]);
} }
} }
}
@ -677,6 +687,15 @@ class config extends common
*/ */
public function logDownload() public function logDownload()
{ {
// Action interdite
if (
$this->getUser('permission', __CLASS__, __FUNCTION__) !== true
) {
// Valeurs en sortie
$this->addOutput([
'access' => false
]);
} else {
$fileName = self::DATA_DIR . 'journal.log'; $fileName = self::DATA_DIR . 'journal.log';
if (file_exists($fileName)) { if (file_exists($fileName)) {
ob_start(); ob_start();
@ -698,12 +717,22 @@ class config extends common
]); ]);
} }
} }
}
/** /**
* Tableau des IP blacklistés * Tableau des IP blacklistés
*/ */
public function blacklistDownload() public function blacklistDownload()
{ {
// Action interdite
if (
$this->getUser('permission', __CLASS__, __FUNCTION__) !== true
) {
// Valeurs en sortie
$this->addOutput([
'access' => false
]);
} else {
ob_start(); ob_start();
$fileName = self::TEMP_DIR . 'blacklist.log'; $fileName = self::TEMP_DIR . 'blacklist.log';
$d = 'Date dernière tentative;Heure dernière tentative;Id;Adresse IP;Nombre d\'échecs' . PHP_EOL; $d = 'Date dernière tentative;Heure dernière tentative;Id;Adresse IP;Nombre d\'échecs' . PHP_EOL;
@ -736,6 +765,7 @@ class config extends common
]); ]);
} }
} }
}
/** /**
* Réinitialiser les ip blacklistées * Réinitialiser les ip blacklistées
@ -743,6 +773,15 @@ class config extends common
public function blacklistReset() public function blacklistReset()
{ {
// Action interdite
if (
$this->getUser('permission', __CLASS__, __FUNCTION__) !== true
) {
// Valeurs en sortie
$this->addOutput([
'access' => false
]);
} else {
if (file_exists(self::DATA_DIR . 'blacklist.json')) { if (file_exists(self::DATA_DIR . 'blacklist.json')) {
$this->setData(['blacklist', []]); $this->setData(['blacklist', []]);
// Valeurs en sortie // Valeurs en sortie
@ -762,12 +801,22 @@ class config extends common
]); ]);
} }
} }
}
/** /**
* Récupération des backups auto dans le gestionnaire de fichiers * Récupération des backups auto dans le gestionnaire de fichiers
*/ */
public function copyBackups() public function copyBackups()
{ {
// Action interdite
if (
$this->getUser('permission', __CLASS__, __FUNCTION__) !== true
) {
// Valeurs en sortie
$this->addOutput([
'access' => false
]);
} else {
$success = $this->copyDir(self::BACKUP_DIR, self::FILE_DIR . 'source/backup'); $success = $this->copyDir(self::BACKUP_DIR, self::FILE_DIR . 'source/backup');
@ -779,12 +828,22 @@ class config extends common
'state' => $success 'state' => $success
]); ]);
} }
}
/** /**
* Vider le dosser des sauvegardes automatisées * Vider le dosser des sauvegardes automatisées
*/ */
public function delBackups() public function delBackups()
{ {
// Action interdite
if (
$this->getUser('permission', __CLASS__, __FUNCTION__) !== true
) {
// Valeurs en sortie
$this->addOutput([
'access' => false
]);
} else {
$path = realpath(self::BACKUP_DIR); $path = realpath(self::BACKUP_DIR);
$success = $fail = 0; $success = $fail = 0;
foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path)) as $filename) { foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path)) as $filename) {
@ -803,4 +862,5 @@ class config extends common
'state' => true 'state' => true
]); ]);
} }
}
} }

View File

@ -273,6 +273,15 @@ class install extends common
*/ */
public function steps() public function steps()
{ {
// Action interdite
if (
$this->getUser('permission', __CLASS__, __FUNCTION__) !== true
) {
// Valeurs en sortie
$this->addOutput([
'access' => false
]);
} else {
switch ($this->getInput('step', helper::FILTER_INT)) { switch ($this->getInput('step', helper::FILTER_INT)) {
// Préparation // Préparation
case 1: case 1:
@ -416,6 +425,7 @@ class install extends common
]); ]);
} }
} }
}
/** /**
* Mise à jour * Mise à jour

View File

@ -390,7 +390,7 @@ class init extends common
] ]
], ],
'2' => [ '2' => [
'name' => 'Membre', 'name' => 'Membre avec droit de partage',
'readonly' => false, 'readonly' => false,
'comment' => 'Accède aux pages réservées et à un dossier partagé', 'comment' => 'Accède aux pages réservées et à un dossier partagé',
'filemanager' => true, 'filemanager' => true,
@ -475,7 +475,7 @@ class init extends common
], ],
'2' => [ '2' => [
'1' => [ '1' => [
'name' => 'Modérateur', 'name' => 'Editeur simple',
'readonly' => false, 'readonly' => false,
'comment' => 'Édition des pages', 'comment' => 'Édition des pages',
'filemanager' => true, 'filemanager' => true,

View File

@ -18,12 +18,12 @@ class page extends common
{ {
public static $actions = [ public static $actions = [
'add' => self::GROUP_MODERATOR, 'add' => self::GROUP_EDITOR,
'delete' => self::GROUP_MODERATOR, 'delete' => self::GROUP_EDITOR,
'edit' => self::GROUP_MODERATOR, 'edit' => self::GROUP_EDITOR,
'duplicate' => self::GROUP_MODERATOR, 'duplicate' => self::GROUP_EDITOR,
'jsEditor' => self::GROUP_MODERATOR, 'jsEditor' => self::GROUP_EDITOR,
'cssEditor' => self::GROUP_MODERATOR 'cssEditor' => self::GROUP_EDITOR
]; ];
public static $pagesNoParentId = [ public static $pagesNoParentId = [
'' => 'Aucune' '' => 'Aucune'

View File

@ -580,7 +580,7 @@ class plugin extends common
]); ]);
} else { } else {
// Créer un dossier temporaire // Créer un dossier temporaire
$tmpFolder = self::TEMP_DIR . uniqid(); $tmpFolder = self::TEMP_DIR . uniqid() . '/';
if (!is_dir($tmpFolder)) { if (!is_dir($tmpFolder)) {
mkdir($tmpFolder, 0755); mkdir($tmpFolder, 0755);
} }
@ -590,21 +590,19 @@ class plugin extends common
// Descripteur de l'archive // Descripteur de l'archive
$infoModule = helper::getModules(); $infoModule = helper::getModules();
//Nom de l'archive
$fileName = $moduleId . $infoModule[$moduleId]['version'] . '.zip';
// Régénération du module //Nom de l'archive
$success = file_put_contents(self::MODULE_DIR . $moduleId . '/enum.json', json_encode($infoModule[$moduleId], JSON_UNESCAPED_UNICODE)); $fileName = $moduleId . str_replace('.', '-', $infoModule[$moduleId]['version']) . '.zip';
// Régénération du descripteur du module
file_put_contents(self::MODULE_DIR . $moduleId . '/enum.json', json_encode($infoModule[$moduleId], JSON_UNESCAPED_UNICODE));
// Construire l'archive // Construire l'archive
$this->makeZip(self::TEMP_DIR . $fileName, self::MODULE_DIR . $moduleId); $this->makeZip( $tmpFolder . $fileName, self::MODULE_DIR . $moduleId);
switch ($action) { switch ($action) {
case 'filemanager': case 'filemanager':
if (!file_exists(self::FILE_DIR . 'source/modules')) { $success = copy($tmpFolder . $fileName, self::FILE_DIR . 'source/modules/' . $fileName );
mkdir(self::FILE_DIR . 'source/modules');
}
$success = $success || copy(self::TEMP_DIR . $fileName, self::FILE_DIR . 'source/modules/' . $moduleId . '.zip');
// Valeurs en sortie // Valeurs en sortie
$this->addOutput([ $this->addOutput([
@ -612,24 +610,20 @@ class plugin extends common
'notification' => $success ? helper::translate('Archive copiée dans le dossier Modules du gestionnaire de fichier') : helper::translate('Erreur de copie'), 'notification' => $success ? helper::translate('Archive copiée dans le dossier Modules du gestionnaire de fichier') : helper::translate('Erreur de copie'),
'state' => $success 'state' => $success
]); ]);
// Nettoyage
unlink(self::TEMP_DIR . $fileName);
$this->removeDir($tmpFolder);
break; break;
case 'download': case 'download':
default:
// Téléchargement du ZIP // Téléchargement du ZIP
header('Content-Description: File Transfer'); header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream'); header('Content-Type: application/octet-stream');
header('Content-Transfer-Encoding: binary'); header('Content-Transfer-Encoding: binary');
header('Content-Disposition: attachment; filename="' . $fileName . '"'); header('Content-Disposition: attachment; filename="' . $fileName . '"');
header('Content-Length: ' . filesize(self::TEMP_DIR . $fileName)); header('Content-Length: ' . filesize($tmpFolder. $fileName));
readfile(self::TEMP_DIR . $fileName); readfile($tmpFolder . $fileName);
// Nettoyage du dossier
unlink(self::TEMP_DIR . $fileName);
exit(); exit();
} }
// Nettoyage
unlink(self::TEMP_DIR . $fileName);
$this->removeDir($tmpFolder);
} }
} }

View File

@ -1016,6 +1016,15 @@ class theme extends common
public function import($zipName = '') public function import($zipName = '')
{ {
// Action interdite
if (
$this->getUser('permission', __CLASS__, __FUNCTION__) !== true
) {
// Valeurs en sortie
$this->addOutput([
'access' => false
]);
} else {
if ( if (
$zipName !== '' && $zipName !== '' &&
@ -1092,6 +1101,7 @@ class theme extends common
return (['success' => false, 'notification' => helper::translate('Archive non spécifiée ou introuvable')]); return (['success' => false, 'notification' => helper::translate('Archive non spécifiée ou introuvable')]);
} }
}

View File

@ -66,7 +66,7 @@ class user extends common
public static $groupProfils = [ public static $groupProfils = [
self::GROUP_MEMBER => 'Membre', self::GROUP_MEMBER => 'Membre',
self::GROUP_MODERATOR => 'Editeur' self::GROUP_EDITOR => 'Editeur'
]; ];
/** /**
@ -98,8 +98,8 @@ class user extends common
// Profil // Profil
$group = $this->getInput('userAddGroup', helper::FILTER_INT, true); $group = $this->getInput('userAddGroup', helper::FILTER_INT, true);
$profil = null; $profil = 0;
if ($group > 1 || $group < 2) { if ($group === 1 || $group === 2) {
$profil = $this->getInput('userAddProfil' . $group, helper::FILTER_INT); $profil = $this->getInput('userAddProfil' . $group, helper::FILTER_INT);
} }
@ -191,7 +191,7 @@ class user extends common
// L'utilisateur n'existe pas // L'utilisateur n'existe pas
$this->getData(['user', $this->getUrl(2)]) === null $this->getData(['user', $this->getUrl(2)]) === null
// Groupe insuffisant // Groupe insuffisant
and ($this->getUrl('group') < self::GROUP_MODERATOR) and ($this->getUrl('group') < self::GROUP_EDITOR)
) { ) {
// Valeurs en sortie // Valeurs en sortie
$this->addOutput([ $this->addOutput([
@ -251,7 +251,7 @@ class user extends common
and $this->getUrl('group') <= self::GROUP_VISITOR and $this->getUrl('group') <= self::GROUP_VISITOR
) )
// Impossible d'éditer un autre utilisateur // Impossible d'éditer un autre utilisateur
or ($this->getUrl('group') < self::GROUP_MODERATOR) or ($this->getUrl('group') < self::GROUP_EDITOR)
) )
) { ) {
// Valeurs en sortie // Valeurs en sortie
@ -303,8 +303,8 @@ class user extends common
$newlastname = $this->getData(['user', $this->getUrl(2), 'lastname']); $newlastname = $this->getData(['user', $this->getUrl(2), 'lastname']);
} }
// Profil // Profil
$profil = null; $profil = 0;
if ($newGroup > 1 || $newGroup < 2) { if ($newGroup === 1 || $newGroup === 2) {
$profil = $this->getInput('userEditProfil' . $newGroup, helper::FILTER_INT); $profil = $this->getInput('userEditProfil' . $newGroup, helper::FILTER_INT);
} }
// Modifie l'utilisateur // Modifie l'utilisateur
@ -503,7 +503,7 @@ class user extends common
]; ];
} elseif ( } elseif (
$groupId == self::GROUP_MEMBER || $groupId == self::GROUP_MEMBER ||
$groupId == self::GROUP_MODERATOR $groupId == self::GROUP_EDITOR
) { ) {
// Enumérer les sous groupes MEMBER et MODERATOR // Enumérer les sous groupes MEMBER et MODERATOR
foreach ($groupData as $subGroupId => $subGroupData) { foreach ($groupData as $subGroupId => $subGroupData) {
@ -1014,7 +1014,8 @@ class user extends common
else { else {
// Soumission du formulaire // Soumission du formulaire
if ( if (
$this->getUser('permission', __CLASS__, __FUNCTION__) === true && // Tous les suers peuvent réinitialiser
// $this->getUser('permission', __CLASS__, __FUNCTION__) === true &&
$this->isPost() $this->isPost()
) { ) {
// Double vérification pour le mot de passe // Double vérification pour le mot de passe

View File

@ -102,8 +102,8 @@
]); ?> ]); ?>
</div> </div>
<div class="userAddGroupProfil displayNone" <div class="userAddGroupProfil displayNone"
id="userAddGroupProfil<?php echo self::GROUP_MODERATOR; ?>"> id="userAddGroupProfil<?php echo self::GROUP_EDITOR; ?>">
<?php echo template::select('userAddProfil' . self::GROUP_MODERATOR, $module::$userProfils[self::GROUP_MODERATOR], [ <?php echo template::select('userAddProfil' . self::GROUP_EDITOR, $module::$userProfils[self::GROUP_EDITOR], [
'label' => 'Profil', 'label' => 'Profil',
]); ?> ]); ?>
</div> </div>
@ -116,9 +116,9 @@
]); ]);
?> ?>
</div> </div>
<div id="userCommentProfil<?php echo self::GROUP_MODERATOR; ?>" class="col12 displayNone userCommentProfil"> <div id="userCommentProfil<?php echo self::GROUP_EDITOR; ?>" class="col12 displayNone userCommentProfil">
<?php echo template::textarea('useraddProfilComment2' . self::GROUP_MODERATOR, [ <?php echo template::textarea('useraddProfilComment2' . self::GROUP_EDITOR, [
"value" => implode("\n",$module::$userProfilsComments[self::GROUP_MODERATOR]) "value" => implode("\n",$module::$userProfilsComments[self::GROUP_EDITOR])
]); ]);
?> ?>
</div> </div>

View File

@ -123,8 +123,8 @@
]); ?> ]); ?>
</div> </div>
<div class="userEditGroupProfil displayNone" <div class="userEditGroupProfil displayNone"
id="userEditGroupProfil<?php echo self::GROUP_MODERATOR; ?>"> id="userEditGroupProfil<?php echo self::GROUP_EDITOR; ?>">
<?php echo template::select('userEditProfil' . self::GROUP_MODERATOR, $module::$userProfils[self::GROUP_MODERATOR], [ <?php echo template::select('userEditProfil' . self::GROUP_EDITOR, $module::$userProfils[self::GROUP_EDITOR], [
'label' => 'Profil', 'label' => 'Profil',
'selected' => $this->getData(['user', $this->getUrl(2), 'profil']) 'selected' => $this->getData(['user', $this->getUrl(2), 'profil'])
]); ?> ]); ?>
@ -138,9 +138,9 @@
]); ]);
?> ?>
</div> </div>
<div id="userCommentProfil<?php echo self::GROUP_MODERATOR; ?>" class="col12 displayNone userCommentProfil"> <div id="userCommentProfil<?php echo self::GROUP_EDITOR; ?>" class="col12 displayNone userCommentProfil">
<?php echo template::textarea('useraddProfilComment2' . self::GROUP_MODERATOR, [ <?php echo template::textarea('useraddProfilComment2' . self::GROUP_EDITOR, [
"value" => implode("\n",$module::$userProfilsComments[self::GROUP_MODERATOR]) "value" => implode("\n",$module::$userProfilsComments[self::GROUP_EDITOR])
]); ]);
?> ?>
</div> </div>

View File

@ -51,7 +51,7 @@
</div> </div>
</div> </div>
</div> </div>
<?php if ($this->getUrl(2) >= self::GROUP_MODERATOR): ?> <?php if ($this->getUrl(2) >= self::GROUP_EDITOR): ?>
<div class="row"> <div class="row">
<div class="col12"> <div class="col12">
<div class="block"> <div class="block">

View File

@ -27,15 +27,15 @@ class blog extends common
const EDIT_ALL = 'all'; const EDIT_ALL = 'all';
public static $actions = [ public static $actions = [
'add' => self::GROUP_MODERATOR, 'add' => self::GROUP_EDITOR,
'comment' => self::GROUP_MODERATOR, 'comment' => self::GROUP_EDITOR,
'commentApprove' => self::GROUP_MODERATOR, 'commentApprove' => self::GROUP_EDITOR,
'commentDelete' => self::GROUP_MODERATOR, 'commentDelete' => self::GROUP_EDITOR,
'commentDeleteAll' => self::GROUP_MODERATOR, 'commentDeleteAll' => self::GROUP_EDITOR,
'config' => self::GROUP_MODERATOR, 'config' => self::GROUP_EDITOR,
'option' => self::GROUP_MODERATOR, 'option' => self::GROUP_EDITOR,
'delete' => self::GROUP_MODERATOR, 'delete' => self::GROUP_EDITOR,
'edit' => self::GROUP_MODERATOR, 'edit' => self::GROUP_EDITOR,
'index' => self::GROUP_VISITOR, 'index' => self::GROUP_VISITOR,
'rss' => self::GROUP_VISITOR 'rss' => self::GROUP_VISITOR
]; ];
@ -697,7 +697,7 @@ class blog extends common
ksort(self::$users); ksort(self::$users);
foreach (self::$users as $userId => &$userFirstname) { foreach (self::$users as $userId => &$userFirstname) {
// Les membres ne sont pas éditeurs, les exclure de la liste // Les membres ne sont pas éditeurs, les exclure de la liste
if ($this->getData(['user', $userId, 'group']) < self::GROUP_MODERATOR) { if ($this->getData(['user', $userId, 'group']) < self::GROUP_EDITOR) {
unset(self::$users[$userId]); unset(self::$users[$userId]);
} }
$userFirstname = $userFirstname . ' ' . $this->getData(['user', $userId, 'lastname']) . ' (' . self::$groupEdits[$this->getData(['user', $userId, 'group'])] . ')'; $userFirstname = $userFirstname . ' ' . $this->getData(['user', $userId, 'lastname']) . ' (' . self::$groupEdits[$this->getData(['user', $userId, 'group'])] . ')';
@ -904,7 +904,6 @@ class blog extends common
*/ */
public function signature($userId) public function signature($userId)
{ {
if ($this->getUser('permission', __CLASS__, __FUNCTION__) !== true) {
switch ($this->getData(['user', $userId, 'signature'])) { switch ($this->getData(['user', $userId, 'signature'])) {
case 1: case 1:
return $userId; return $userId;
@ -922,6 +921,4 @@ class blog extends common
return $this->getData(['user', $userId, 'firstname']); return $this->getData(['user', $userId, 'firstname']);
} }
} }
}
} }

View File

@ -1 +1 @@
{"name":"blog","realName":"Blog","version":"6.8","update":"0.0","delete":true,"dataDirectory":""} {"name":"blog","realName":"Blog","version":"6.9","update":"0.0","delete":true,"dataDirectory":""}

View File

@ -29,7 +29,7 @@
or ( or (
// Groupe // Groupe
($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'editConsent']) === self::GROUP_ADMIN ($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'editConsent']) === self::GROUP_ADMIN
or $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'editConsent']) === self::GROUP_MODERATOR) or $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'editConsent']) === self::GROUP_EDITOR)
and $this->getUser('group') >= $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'editConsent']) and $this->getUser('group') >= $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'editConsent'])
) )
or ( or (

View File

@ -62,7 +62,7 @@
or ( or (
// Groupe // Groupe
($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'editConsent']) === self::GROUP_ADMIN ($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'editConsent']) === self::GROUP_ADMIN
or $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'editConsent']) === self::GROUP_MODERATOR) or $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'editConsent']) === self::GROUP_EDITOR)
and $this->getUser('group') >= $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'editConsent']) and $this->getUser('group') >= $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'editConsent'])
) )
or ( or (

View File

@ -1,6 +1,7 @@
# Version 3.10 # Version 3.10
- Bloque l'effacement selon le profil - Bloque l'effacement selon le profil
- Masque le code de vérification - Masque le code de vérification
- Export des données en CSV impossible
# Version 3.9 # Version 3.9
- Redirection des pages orphelines - Redirection des pages orphelines
# Version 3.8 # Version 3.8

View File

@ -1 +1 @@
{"name":"form","realName":"Formulaire","version":"3.9","update":"0.0","delete":true,"dataDirectory":""} {"name":"form","realName":"Formulaire","version":"3.10","update":"0.0","delete":true,"dataDirectory":""}

View File

@ -22,13 +22,13 @@ class form extends common
const DATADIRECTORY = ''; // Contenu localisé inclus par défaut (page.json et module.json) const DATADIRECTORY = ''; // Contenu localisé inclus par défaut (page.json et module.json)
public static $actions = [ public static $actions = [
'config' => self::GROUP_MODERATOR, 'config' => self::GROUP_EDITOR,
'option' => self::GROUP_MODERATOR, 'option' => self::GROUP_EDITOR,
'data' => self::GROUP_MODERATOR, 'data' => self::GROUP_EDITOR,
'delete' => self::GROUP_MODERATOR, 'delete' => self::GROUP_EDITOR,
'deleteall' => self::GROUP_MODERATOR, 'deleteall' => self::GROUP_EDITOR,
'index' => self::GROUP_VISITOR, 'index' => self::GROUP_VISITOR,
'export2csv' => self::GROUP_MODERATOR, 'export2csv' => self::GROUP_EDITOR,
]; ];
public static $data = []; public static $data = [];
@ -235,7 +235,7 @@ class form extends common
{ {
$data = $this->getData(['module', $this->getUrl(0), 'data']); $data = $this->getData(['module', $this->getUrl(0), 'data']);
if ( if (
$this->getUser('permission', __CLASS__, __FUNCTION__) !== true && $this->getUser('permission', __CLASS__, __FUNCTION__) === true &&
$data $data
) { ) {
// Pagination // Pagination
@ -297,7 +297,7 @@ class form extends common
fclose($fp); fclose($fp);
// Valeurs en sortie // Valeurs en sortie
$this->addOutput([ $this->addOutput([
'notification' => sprintf(helper::translate('Export CSV effectué dans %1 '), $csvfilename), 'notification' => sprintf(helper::translate('Export CSV effectué dans %s '), $csvfilename ),
'redirect' => helper::baseUrl() . $this->getUrl(0) . '/data', 'redirect' => helper::baseUrl() . $this->getUrl(0) . '/data',
'state' => true 'state' => true
]); ]);

View File

@ -1 +1 @@
{"name":"gallery","realName":"Galerie","version":"3.8","update":"0.0","delete":true,"dataDirectory":"site\/data\/gallery\/"} {"name":"gallery","realName":"Galerie","version":"3.9","update":"0.0","delete":true,"dataDirectory":"site\/data\/gallery\/"}

View File

@ -44,15 +44,15 @@ class gallery extends common
public static $config = []; public static $config = [];
public static $actions = [ public static $actions = [
'config' => self::GROUP_MODERATOR, 'config' => self::GROUP_EDITOR,
'delete' => self::GROUP_MODERATOR, 'delete' => self::GROUP_EDITOR,
'dirs' => self::GROUP_MODERATOR, 'dirs' => self::GROUP_EDITOR,
'sortGalleries' => self::GROUP_MODERATOR, 'sortGalleries' => self::GROUP_EDITOR,
'sortPictures' => self::GROUP_MODERATOR, 'sortPictures' => self::GROUP_EDITOR,
'edit' => self::GROUP_MODERATOR, 'edit' => self::GROUP_EDITOR,
'add' => self::GROUP_MODERATOR, 'add' => self::GROUP_EDITOR,
'theme' => self::GROUP_MODERATOR, 'theme' => self::GROUP_EDITOR,
'option' => self::GROUP_MODERATOR, 'option' => self::GROUP_EDITOR,
'index' => self::GROUP_VISITOR 'index' => self::GROUP_VISITOR
]; ];

View File

@ -1 +1 @@
{"name":"news","realName":"News","version":"4.3","update":"0.0","delete":true,"dataDirectory":"site\/data\/news\/"} {"name":"news","realName":"News","version":"4.4","update":"0.0","delete":true,"dataDirectory":"site\/data\/news\/"}

View File

@ -21,13 +21,13 @@ class news extends common
const DATADIRECTORY = self::DATA_DIR . 'news/'; const DATADIRECTORY = self::DATA_DIR . 'news/';
public static $actions = [ public static $actions = [
'add' => self::GROUP_MODERATOR, 'add' => self::GROUP_EDITOR,
'config' => self::GROUP_MODERATOR, 'config' => self::GROUP_EDITOR,
// Edition des news // Edition des news
'option' => self::GROUP_MODERATOR, 'option' => self::GROUP_EDITOR,
// paramétrage des news // paramétrage des news
'delete' => self::GROUP_MODERATOR, 'delete' => self::GROUP_EDITOR,
'edit' => self::GROUP_MODERATOR, 'edit' => self::GROUP_EDITOR,
'index' => self::GROUP_VISITOR, 'index' => self::GROUP_VISITOR,
'rss' => self::GROUP_VISITOR 'rss' => self::GROUP_VISITOR
]; ];

View File

@ -21,7 +21,7 @@ class redirection extends common
const DATADIRECTORY = ''; // Contenu localisé inclus par défaut (page.json et module.json) const DATADIRECTORY = ''; // Contenu localisé inclus par défaut (page.json et module.json)
public static $actions = [ public static $actions = [
'config' => self::GROUP_MODERATOR, 'config' => self::GROUP_EDITOR,
'index' => self::GROUP_VISITOR 'index' => self::GROUP_VISITOR
]; ];
@ -60,7 +60,7 @@ class redirection extends common
if ( if (
$this->getUser('permission', __CLASS__, __FUNCTION__) !== true $this->getUser('permission', __CLASS__, __FUNCTION__) !== true
&& $this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD') && $this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
&& $this->getUser('group') >= self::GROUP_MODERATOR && $this->getUser('group') >= self::GROUP_EDITOR
&& $this->getUrl(1) !== 'force' && $this->getUrl(1) !== 'force'
) { ) {
// Valeurs en sortie // Valeurs en sortie

View File

@ -26,7 +26,7 @@ class search extends common
public static $actions = [ public static $actions = [
'index' => self::GROUP_VISITOR, 'index' => self::GROUP_VISITOR,
'config' => self::GROUP_MODERATOR 'config' => self::GROUP_EDITOR
]; ];
// Variables pour l'affichage des résultats // Variables pour l'affichage des résultats
@ -177,7 +177,6 @@ class search extends common
$this->update(); $this->update();
if ( if (
$this->getUser('permission', __CLASS__, __FUNCTION__) === true &&
$this->isPost() $this->isPost()
) { ) {
//Initialisations variables //Initialisations variables