Role renomme Groupe WIP

This commit is contained in:
Fred Tempez 2025-02-06 16:40:59 +01:00
parent 962e4c5d7c
commit 99a8b776b5
41 changed files with 224 additions and 170 deletions

View File

@ -353,7 +353,7 @@ class layout extends common
} }
// Affichage de la barre de membre simple // Affichage de la barre de membre simple
if ( if (
$this->getUser('group') >= self::GROUP_MEMBER && $this->getUser('group') < self::GROUP_ADMIN $this->getUser('role') >= self::GROUP_MEMBER && $this->getUser('role') < self::GROUP_ADMIN
&& $this->getData(['theme', 'footer', 'memberBar']) === true && $this->getData(['theme', 'footer', 'memberBar']) === true
) { ) {
$items .= '<span id="footerDisplayMemberAccount"'; $items .= '<span id="footerDisplayMemberAccount"';
@ -514,11 +514,11 @@ class layout extends common
} }
// Commandes pour les membres simples // Commandes pour les membres simples
if ( if (
$this->getUser('group') === self::GROUP_MEMBER $this->getUser('role') === self::GROUP_MEMBER
&& $this->getData(['theme', 'menu', 'memberBar']) === true && $this->getData(['theme', 'menu', 'memberBar']) === true
) { ) {
if ( if (
$this->getUser('group') >= self::GROUP_MEMBER && $this->getUser('role') >= self::GROUP_MEMBER &&
$this->getUser('permission', 'filemanager') === true $this->getUser('permission', 'filemanager') === true
) { ) {
$itemsRight .= '<li>' . template::ico('folder', [ $itemsRight .= '<li>' . template::ico('folder', [
@ -591,7 +591,7 @@ class layout extends common
and $this->isConnected() === false and $this->isConnected() === false
) or ($this->getData(['page', $parentPageId, 'disable']) === true ) or ($this->getData(['page', $parentPageId, 'disable']) === true
and $this->isConnected() === true and $this->isConnected() === true
and $this->getUser('group') < self::GROUP_EDITOR and $this->getUser('role') < 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);
@ -657,7 +657,7 @@ class layout extends common
and $this->isConnected() === false and $this->isConnected() === false
) or ($this->getData(['page', $childKey, 'disable']) === true ) or ($this->getData(['page', $childKey, 'disable']) === true
and $this->isConnected() === true and $this->isConnected() === true
and $this->getUser('group') < self::GROUP_EDITOR and $this->getUser('role') < 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);
@ -914,7 +914,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_EDITOR) { if ($this->getUser('role') >= self::GROUP_EDITOR) {
$leftItem = ''; $leftItem = '';
foreach (self::$languages as $key => $value) { foreach (self::$languages as $key => $value) {
if (is_dir(self::DATA_DIR . $key)) { if (is_dir(self::DATA_DIR . $key)) {
@ -926,7 +926,7 @@ class layout extends common
$leftItems .= $leftItem; $leftItems .= $leftItem;
$leftItems .= '</select></li>'; $leftItems .= '</select></li>';
} }
if ($this->getUser('group') >= self::GROUP_ADMIN) { if ($this->getUser('role') >= self::GROUP_ADMIN) {
$leftItems .= '<li>' . template::ico('flag', [ $leftItems .= '<li>' . template::ico('flag', [
'help' => 'Langues', 'help' => 'Langues',
'href' => helper::baseUrl() . 'language' 'href' => helper::baseUrl() . 'language'
@ -934,7 +934,7 @@ class layout extends common
} }
// Liste des pages // Liste des pages
if ($this->getUser('group') >= self::GROUP_EDITOR) { if ($this->getUser('role') >= 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') . '">';
@ -1055,7 +1055,7 @@ class layout extends common
// Items de droite // Items de droite
$rightItems = ''; $rightItems = '';
if ( if (
$this->getUser('group') >= self::GROUP_EDITOR $this->getUser('role') >= self::GROUP_EDITOR
&& $this->getUser( && $this->getUser(
'permission', 'permission',
'filemanager' 'filemanager'
@ -1067,7 +1067,7 @@ class layout extends common
'attr' => 'data-lity' 'attr' => 'data-lity'
]) . '</li>'; ]) . '</li>';
} }
if ($this->getUser('group') >= self::GROUP_ADMIN) { if ($this->getUser('role') >= self::GROUP_ADMIN) {
$rightItems .= '<li>' . template::ico('brush', [ $rightItems .= '<li>' . template::ico('brush', [
'help' => 'Thème', 'help' => 'Thème',
'href' => helper::baseUrl() . 'theme' 'href' => helper::baseUrl() . 'theme'
@ -1141,7 +1141,7 @@ class layout extends common
} }
// Boutons depuis le groupe éditeur // Boutons depuis le groupe éditeur
if ( if (
$this->getUser('group') >= self::GROUP_EDITOR $this->getUser('role') >= self::GROUP_EDITOR
&& $this->getUser('permission', 'user', 'edit') && $this->getUser('permission', 'user', 'edit')
) { ) {
@ -1228,7 +1228,7 @@ class layout extends common
$vars .= 'var baseUrlQs = ' . json_encode(helper::baseUrl()) . ';'; $vars .= 'var baseUrlQs = ' . json_encode(helper::baseUrl()) . ';';
if ( if (
$this->isConnected() === true $this->isConnected() === true
and $this->getUser('group') >= self::GROUP_EDITOR and $this->getUser('role') >= 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

@ -414,7 +414,7 @@ class core extends common
// Force la déconnexion des membres bannis ou d'une seconde session // Force la déconnexion des membres bannis ou d'une seconde session
if ( if (
$this->isConnected() === true $this->isConnected() === true
and ($this->getUser('group') === common::GROUP_BANNED and ($this->getUser('role') === common::GROUP_BANNED
or ($_SESSION['csrf'] !== $this->getData(['user', $this->getUser('id'), 'accessCsrf']) or ($_SESSION['csrf'] !== $this->getData(['user', $this->getUser('id'), 'accessCsrf'])
and $this->getData(['config', 'connect', 'autoDisconnect']) === true) and $this->getData(['config', 'connect', 'autoDisconnect']) === true)
) )
@ -429,7 +429,7 @@ class core extends common
and $this->getUrl(1) !== 'login' and $this->getUrl(1) !== 'login'
and ($this->isConnected() === false and ($this->isConnected() === false
or ($this->isConnected() === true or ($this->isConnected() === true
and $this->getUser('group') < common::GROUP_ADMIN and $this->getUser('role') < common::GROUP_ADMIN
) )
) )
) { ) {
@ -446,11 +446,11 @@ class core extends common
$access = null; $access = null;
if ($this->getData(['page', $this->getUrl(0)]) !== null) { if ($this->getData(['page', $this->getUrl(0)]) !== null) {
if ( if (
$this->getData(['page', $this->getUrl(0), 'group']) === common::GROUP_VISITOR $this->getData(['page', $this->getUrl(0), 'role']) === common::GROUP_VISITOR
or ($this->isConnected() === true or ($this->isConnected() === true
// and $this->getUser('group') >= $this->getData(['page', $this->getUrl(0), 'group']) // and $this->getUser('role') >= $this->getData(['page', $this->getUrl(0), 'role'])
// Modification qui tient compte du profil de la page // Modification qui tient compte du profil de la page
and ($this->getUser('group') * 10 + $this->getUser('profil')) >= ($this->getData(['page', $this->getUrl(0), 'group']) * 10 + $this->getData(['page', $this->getUrl(0), 'profil'])) and ($this->getUser('role') * 10 + $this->getUser('profil')) >= ($this->getData(['page', $this->getUrl(0), 'role']) * 10 + $this->getData(['page', $this->getUrl(0), 'profil']))
) )
) { ) {
$access = true; $access = true;
@ -467,7 +467,7 @@ class core extends common
and $this->isConnected() === false and $this->isConnected() === false
) or ($this->getData(['page', $this->getUrl(0), 'disable']) === true ) or ($this->getData(['page', $this->getUrl(0), 'disable']) === true
and $this->isConnected() === true and $this->isConnected() === true
and $this->getUser('group') < common::GROUP_EDITOR and $this->getUser('role') < common::GROUP_EDITOR
) )
) { ) {
$access = false; $access = false;
@ -637,7 +637,7 @@ class core extends common
if ( if (
($module::$actions[$action] === common::GROUP_VISITOR ($module::$actions[$action] === common::GROUP_VISITOR
or ($this->isConnected() === true or ($this->isConnected() === true
and $this->getUser('group') >= $module::$actions[$action] and $this->getUser('role') >= $module::$actions[$action]
and $this->getUser('permission', $moduleId, $action) and $this->getUser('permission', $moduleId, $action)
) )
) )

View File

@ -28,7 +28,7 @@ class common
const GROUP_VISITOR = 0; const GROUP_VISITOR = 0;
const GROUP_MEMBER = 1; const GROUP_MEMBER = 1;
const GROUP_EDITOR = 2; const GROUP_EDITOR = 2;
// Groupe MODERATOR, compatibilité avec les anciens modules : // Role MODERATOR, compatibilité avec les anciens modules :
const GROUP_MODERATOR = 2; const GROUP_MODERATOR = 2;
const GROUP_ADMIN = 3; const GROUP_ADMIN = 3;
const SIGNATURE_ID = 1; const SIGNATURE_ID = 1;
@ -813,11 +813,11 @@ class common
// Page parent // Page parent
$this->getData(['page', $pageId, 'parentPageId']) === "" $this->getData(['page', $pageId, 'parentPageId']) === ""
// Ignore les pages dont l'utilisateur n'a pas accès // Ignore les pages dont l'utilisateur n'a pas accès
and ($this->getData(['page', $pageId, 'group']) === self::GROUP_VISITOR and ($this->getData(['page', $pageId, 'role']) === self::GROUP_VISITOR
or ($this->isConnected() === true or ($this->isConnected() === true
//and $this->getUser('group') >= $this->getData(['page', $pageId, 'group']) //and $this->getUser('role') >= $this->getData(['page', $pageId, 'role'])
// Modification qui tient compte du profil de la page // Modification qui tient compte du profil de la page
and ($this->getUser('group') * self::MAX_PROFILS + $this->getUser('profil')) >= ($this->getData(['page', $pageId, 'group']) * self::MAX_PROFILS + $this->getData(['page', $pageId, 'profil'])) and ($this->getUser('role') * self::MAX_PROFILS + $this->getUser('profil')) >= ($this->getData(['page', $pageId, 'role']) * self::MAX_PROFILS + $this->getData(['page', $pageId, 'profil']))
) )
) )
@ -840,14 +840,14 @@ class common
// Ignore les pages dont l'utilisateur n'a pas accès // Ignore les pages dont l'utilisateur n'a pas accès
and ( and (
( (
$this->getData(['page', $pageId, 'group']) === self::GROUP_VISITOR $this->getData(['page', $pageId, 'role']) === self::GROUP_VISITOR
and and
$this->getData(['page', $parentId, 'group']) === self::GROUP_VISITOR $this->getData(['page', $parentId, 'role']) === self::GROUP_VISITOR
) )
or ( or (
$this->isConnected() === true $this->isConnected() === true
and and
$this->getUser('group') * self::MAX_PROFILS + $this->getUser('profil')) >= ($this->getData(['page', $pageId, 'group']) * self::MAX_PROFILS + $this->getData(['page', $pageId, 'profil']) $this->getUser('role') * self::MAX_PROFILS + $this->getUser('profil')) >= ($this->getData(['page', $pageId, 'role']) * self::MAX_PROFILS + $this->getData(['page', $pageId, 'profil'])
) )
) )
@ -1042,33 +1042,33 @@ class common
{ {
// Administrateur, toutes les permissions // Administrateur, toutes les permissions
if ($this->getUser('group') === self::GROUP_ADMIN) { if ($this->getUser('role') === self::GROUP_ADMIN) {
return true; return true;
} elseif ($this->getUser('group') <= self::GROUP_VISITOR) { // Groupe sans autorisation } elseif ($this->getUser('role') <= self::GROUP_VISITOR) { // Role sans autorisation
return false; return false;
} elseif ( } elseif (
// Groupe avec profil, consultation des autorisations sur deux clés // Role avec profil, consultation des autorisations sur deux clés
$key1 $key1
&& $key2 && $key2
&& $this->user && $this->user
&& $this->getData(['profil', $this->user['group'], $this->user['profil'], $key1]) && $this->getData(['profil', $this->user['role'], $this->user['profil'], $key1])
&& array_key_exists($key2, $this->getData(['profil', $this->user['group'], $this->user['profil'], $key1])) && array_key_exists($key2, $this->getData(['profil', $this->user['role'], $this->user['profil'], $key1]))
) { ) {
return $this->getData(['profil', $this->user['group'], $this->user['profil'], $key1, $key2]); return $this->getData(['profil', $this->user['role'], $this->user['profil'], $key1, $key2]);
// Groupe avec profil, consultation des autorisations sur une seule clé // Role avec profil, consultation des autorisations sur une seule clé
} elseif ( } elseif (
$key1 $key1
&& $this->user && $this->user
&& $this->getData(['profil', $this->user['group'], $this->user['profil']]) && $this->getData(['profil', $this->user['role'], $this->user['profil']])
&& array_key_exists($key1, $this->getData(['profil', $this->user['group'], $this->user['profil']])) && array_key_exists($key1, $this->getData(['profil', $this->user['role'], $this->user['profil']]))
) { ) {
return $this->getData(['profil', $this->user['group'], $this->user['profil'], $key1]); return $this->getData(['profil', $this->user['role'], $this->user['profil'], $key1]);
} else { } else {
// Une permission non spécifiée dans le profil est autorisée selon la valeur de $actions // Une permission non spécifiée dans le profil est autorisée selon la valeur de $actions
if (class_exists($key1)) { if (class_exists($key1)) {
$module = new $key1; $module = new $key1;
if (array_key_exists($key2, $module::$actions)) { if (array_key_exists($key2, $module::$actions)) {
return $this->getUser('group') >= $module::$actions[$key2]; return $this->getUser('role') >= $module::$actions[$key2];
} }
} }
return false; return false;
@ -1163,7 +1163,7 @@ class common
foreach ($this->getHierarchy() as $parentPageId => $childrenPageIds) { foreach ($this->getHierarchy() as $parentPageId => $childrenPageIds) {
// Exclure les barres et les pages non publiques et les pages masquées // Exclure les barres et les pages non publiques et les pages masquées
if ( if (
$this->getData(['page', $parentPageId, 'group']) !== 0 || $this->getData(['page', $parentPageId, 'role']) !== 0 ||
$this->getData(['page', $parentPageId, 'block']) === 'bar' $this->getData(['page', $parentPageId, 'block']) === 'bar'
) { ) {
continue; continue;
@ -1190,7 +1190,7 @@ class common
} }
// Sous-pages // Sous-pages
foreach ($childrenPageIds as $childKey) { foreach ($childrenPageIds as $childKey) {
if ($this->getData(['page', $childKey, 'group']) !== 0 || $this->getData(['page', $childKey, 'disable']) === true) { if ($this->getData(['page', $childKey, 'role']) !== 0 || $this->getData(['page', $childKey, 'disable']) === true) {
continue; continue;
} }
// Cas de la page d'accueil ne pas dupliquer l'URL // Cas de la page d'accueil ne pas dupliquer l'URL

View File

@ -1115,4 +1115,58 @@ if ($this->getData(['core', 'dataVersion']) < 13101) {
// Mise à jour // Mise à jour
$this->setData(['core', 'dataVersion', 13101]); $this->setData(['core', 'dataVersion', 13101]);
} }
// Version 1.21.00
if (
$this->getData(['core', 'dataVersion']) < 13600
) {
/**
* Renomme la clé dans la base des utilisateurs
*/
if (
is_array($this->getData(['user']))
&& empty($this->getData(['user'])) === false
) {
foreach ($this->getData(['user']) as $userId => $userValue) {
$d = $this->getData(['user', $userId]);
if (isset($d['group']) && $d['group'] !== '') {
$position = array_search('group', array_keys($d)) + 1;
$l = array_merge(
array_slice($d, 0, $position),
['role' => $d['group']],
array_slice($d, $position)
);
unset($l['group']);
$this->setData(['user', $userId, $l], false);
}
}
}
$this->saveDb('user');
/**
* Convertit les pages et les modules
*/
$languages = array_merge($this->getData(['language']));
foreach ($languages as $languageId => $courseValue) {
// Les pages
$filePath = self::DATA_DIR . $languageId . '/page.json';
$jsonContent = file_get_contents($filePath);
$updatedJsonContent = str_replace('"group":', '"role":', $jsonContent);
if ($updatedJsonContent !== $jsonContent) {
file_put_contents($filePath, $updatedJsonContent);
}
// Les modules
$filePath = self::DATA_DIR . $languageId . '/module.json';
$jsonContent = file_get_contents($filePath);
$updatedJsonContent = str_replace('"group":', '"role":', $jsonContent);
if ($updatedJsonContent !== $jsonContent) {
file_put_contents($filePath, $updatedJsonContent);
}
}
$this->setData(['core', 'dataVersion', 13600]);
}

View File

@ -42,7 +42,7 @@
<body> <body>
<!-- Barre d'administration --> <!-- Barre d'administration -->
<?php if ($this->getUser('group') > self::GROUP_MEMBER): ?> <?php if ($this->getUser('role') > self::GROUP_MEMBER): ?>
<?php $layout->showBar(); ?> <?php $layout->showBar(); ?>
<?php endif; ?> <?php endif; ?>
<!-- Notifications --> <!-- Notifications -->
@ -55,7 +55,7 @@
$this->getData(['theme', 'menu', 'position']) === 'top' $this->getData(['theme', 'menu', 'position']) === 'top'
and $this->getData(['theme', 'menu', 'fixed']) === true and $this->getData(['theme', 'menu', 'fixed']) === true
and $this->isConnected() === true and $this->isConnected() === true
and $this->getUser('group') > self::GROUP_MEMBER and $this->getUser('role') > self::GROUP_MEMBER
) { ) {
echo '<nav id="navfixedconnected" >'; echo '<nav id="navfixedconnected" >';
} else { } else {

View File

@ -151,7 +151,7 @@ class install extends common
[ [
'firstname' => $userFirstname, 'firstname' => $userFirstname,
'forgot' => 0, 'forgot' => 0,
'group' => self::GROUP_ADMIN, 'role' => self::GROUP_ADMIN,
'profil' => 0, 'profil' => 0,
'lastname' => $userLastname, 'lastname' => $userLastname,
'pseudo' => 'Admin', 'pseudo' => 'Admin',

View File

@ -46,7 +46,7 @@ class init extends common
] ]
], ],
'core' => [ 'core' => [
'dataVersion' => 13000, 'dataVersion' => 13600,
'lastBackup' => 0, 'lastBackup' => 0,
'lastClearTmp' => 0, 'lastClearTmp' => 0,
'lastAutoUpdate' => 0, 'lastAutoUpdate' => 0,
@ -689,7 +689,7 @@ class init extends common
'modulePosition' => 'bottom', 'modulePosition' => 'bottom',
'parentPageId' => '', 'parentPageId' => '',
'position' => 1, 'position' => 1,
'group' => self::GROUP_VISITOR, 'role' => self::GROUP_VISITOR,
'profil' => 0, 'profil' => 0,
'targetBlank' => false, 'targetBlank' => false,
'title' => 'Accueil', 'title' => 'Accueil',
@ -744,7 +744,7 @@ class init extends common
'modulePosition' => 'bottom', 'modulePosition' => 'bottom',
'parentPageId' => '', 'parentPageId' => '',
'position' => 1, 'position' => 1,
'group' => self::GROUP_VISITOR, 'role' => self::GROUP_VISITOR,
'profil' => 0, 'profil' => 0,
'targetBlank' => false, 'targetBlank' => false,
'title' => 'Página de inicio', 'title' => 'Página de inicio',
@ -800,7 +800,7 @@ class init extends common
'modulePosition' => 'bottom', 'modulePosition' => 'bottom',
'parentPageId' => '', 'parentPageId' => '',
'position' => 1, 'position' => 1,
'group' => self::GROUP_VISITOR, 'role' => self::GROUP_VISITOR,
'profil' => 0, 'profil' => 0,
'targetBlank' => false, 'targetBlank' => false,
'title' => 'Home page', 'title' => 'Home page',
@ -836,7 +836,7 @@ class init extends common
'modulePosition' => 'bottom', 'modulePosition' => 'bottom',
'parentPageId' => '', 'parentPageId' => '',
'position' => 1, 'position' => 1,
'group' => self::GROUP_VISITOR, 'role' => self::GROUP_VISITOR,
'profil' => 0, 'profil' => 0,
'targetBlank' => false, 'targetBlank' => false,
'title' => 'Accueil', 'title' => 'Accueil',
@ -864,7 +864,7 @@ class init extends common
'modulePosition' => 'bottom', 'modulePosition' => 'bottom',
'parentPageId' => 'accueil', 'parentPageId' => 'accueil',
'position' => 1, 'position' => 1,
'group' => self::GROUP_VISITOR, 'role' => self::GROUP_VISITOR,
'profil' => 0, 'profil' => 0,
'targetBlank' => false, 'targetBlank' => false,
'title' => 'Page Enfant', 'title' => 'Page Enfant',
@ -892,7 +892,7 @@ class init extends common
'parentPageId' => '', 'parentPageId' => '',
'modulePosition' => 'bottom', 'modulePosition' => 'bottom',
'position' => 2, 'position' => 2,
'group' => self::GROUP_MEMBER, 'role' => self::GROUP_MEMBER,
'profil' => 1, 'profil' => 1,
'targetBlank' => false, 'targetBlank' => false,
'title' => 'Page privée', 'title' => 'Page privée',
@ -920,7 +920,7 @@ class init extends common
'parentPageId' => 'accueil', 'parentPageId' => 'accueil',
'modulePosition' => 'bottom', 'modulePosition' => 'bottom',
'position' => 2, 'position' => 2,
'group' => self::GROUP_VISITOR, 'role' => self::GROUP_VISITOR,
'profil' => 0, 'profil' => 0,
'targetBlank' => false, 'targetBlank' => false,
'title' => 'Mise en page', 'title' => 'Mise en page',
@ -948,7 +948,7 @@ class init extends common
'parentPageId' => 'accueil', 'parentPageId' => 'accueil',
'modulePosition' => 'bottom', 'modulePosition' => 'bottom',
'position' => 3, 'position' => 3,
'group' => self::GROUP_VISITOR, 'role' => self::GROUP_VISITOR,
'profil' => 0, 'profil' => 0,
'targetBlank' => false, 'targetBlank' => false,
'title' => 'Barre latérale avec menu', 'title' => 'Barre latérale avec menu',
@ -976,7 +976,7 @@ class init extends common
'modulePosition' => 'bottom', 'modulePosition' => 'bottom',
'parentPageId' => '', 'parentPageId' => '',
'position' => 3, 'position' => 3,
'group' => self::GROUP_VISITOR, 'role' => self::GROUP_VISITOR,
'profil' => 0, 'profil' => 0,
'targetBlank' => false, 'targetBlank' => false,
'title' => 'Blog', 'title' => 'Blog',
@ -1004,7 +1004,7 @@ class init extends common
'modulePosition' => 'bottom', 'modulePosition' => 'bottom',
'parentPageId' => '', 'parentPageId' => '',
'position' => 4, 'position' => 4,
'group' => self::GROUP_VISITOR, 'role' => self::GROUP_VISITOR,
'profil' => 0, 'profil' => 0,
'targetBlank' => false, 'targetBlank' => false,
'title' => 'Galeries d\'images', 'title' => 'Galeries d\'images',
@ -1033,7 +1033,7 @@ class init extends common
'modulePosition' => 'bottom', 'modulePosition' => 'bottom',
'parentPageId' => '', 'parentPageId' => '',
'position' => 5, 'position' => 5,
'group' => self::GROUP_VISITOR, 'role' => self::GROUP_VISITOR,
'profil' => 0, 'profil' => 0,
'targetBlank' => true, 'targetBlank' => true,
'title' => 'Site de Zwii', 'title' => 'Site de Zwii',
@ -1061,7 +1061,7 @@ class init extends common
'modulePosition' => 'bottom', 'modulePosition' => 'bottom',
'parentPageId' => '', 'parentPageId' => '',
'position' => 6, 'position' => 6,
'group' => self::GROUP_VISITOR, 'role' => self::GROUP_VISITOR,
'profil' => 0, 'profil' => 0,
'targetBlank' => false, 'targetBlank' => false,
'title' => 'Contact', 'title' => 'Contact',
@ -1089,7 +1089,7 @@ class init extends common
'modulePosition' => 'bottom', 'modulePosition' => 'bottom',
'parentPageId' => '', 'parentPageId' => '',
'position' => 0, 'position' => 0,
'group' => self::GROUP_VISITOR, 'role' => self::GROUP_VISITOR,
'profil' => 0, 'profil' => 0,
'targetBlank' => false, 'targetBlank' => false,
'title' => 'Barre latérale', 'title' => 'Barre latérale',
@ -1117,7 +1117,7 @@ class init extends common
'modulePosition' => 'bottom', 'modulePosition' => 'bottom',
'parentPageId' => '', 'parentPageId' => '',
'position' => 0, 'position' => 0,
'group' => self::GROUP_VISITOR, 'role' => self::GROUP_VISITOR,
'profil' => 0, 'profil' => 0,
'targetBlank' => false, 'targetBlank' => false,
'title' => 'Barre latérale avec menu', 'title' => 'Barre latérale avec menu',
@ -1145,7 +1145,7 @@ class init extends common
'modulePosition' => 'bottom', 'modulePosition' => 'bottom',
'parentPageId' => '', 'parentPageId' => '',
'position' => 0, 'position' => 0,
'group' => self::GROUP_VISITOR, 'role' => self::GROUP_VISITOR,
'profil' => 0, 'profil' => 0,
'targetBlank' => false, 'targetBlank' => false,
'title' => 'Mentions légales', 'title' => 'Mentions légales',
@ -1174,7 +1174,7 @@ class init extends common
'modulePosition' => '', 'modulePosition' => '',
'parentPageId' => '', 'parentPageId' => '',
'position' => 0, 'position' => 0,
'group' => self::GROUP_VISITOR, 'role' => self::GROUP_VISITOR,
'profil' => 0, 'profil' => 0,
'targetBlank' => false, 'targetBlank' => false,
'title' => 'Maintenance en cours', 'title' => 'Maintenance en cours',
@ -1203,7 +1203,7 @@ class init extends common
'modulePosition' => 'bottom', 'modulePosition' => 'bottom',
'parentPageId' => '', 'parentPageId' => '',
'position' => 0, 'position' => 0,
'group' => self::GROUP_VISITOR, 'role' => self::GROUP_VISITOR,
'profil' => 0, 'profil' => 0,
'targetBlank' => false, 'targetBlank' => false,
'title' => 'Erreur 403', 'title' => 'Erreur 403',
@ -1231,7 +1231,7 @@ class init extends common
'modulePosition' => 'bottom', 'modulePosition' => 'bottom',
'parentPageId' => '', 'parentPageId' => '',
'position' => 0, 'position' => 0,
'group' => self::GROUP_VISITOR, 'role' => self::GROUP_VISITOR,
'profil' => 0, 'profil' => 0,
'targetBlank' => false, 'targetBlank' => false,
'title' => 'Erreur 404', 'title' => 'Erreur 404',
@ -1259,7 +1259,7 @@ class init extends common
'modulePosition' => 'bottom', 'modulePosition' => 'bottom',
'parentPageId' => '', 'parentPageId' => '',
'position' => 7, 'position' => 7,
'group' => self::GROUP_VISITOR, 'role' => self::GROUP_VISITOR,
'profil' => 0, 'profil' => 0,
'targetBlank' => false, 'targetBlank' => false,
'title' => 'Recherche dans le site', 'title' => 'Recherche dans le site',
@ -1427,7 +1427,7 @@ class init extends common
'config' => [ 'config' => [
'button' => '', 'button' => '',
'captcha' => true, 'captcha' => true,
'group' => self::GROUP_ADMIN, 'role' => self::GROUP_ADMIN,
'pageId' => '', 'pageId' => '',
'subject' => '' 'subject' => ''
], ],

View File

@ -261,9 +261,9 @@
"Grande (220%)": "Grande (220%)", "Grande (220%)": "Grande (220%)",
"Grande (300px)": "Grande (300px)", "Grande (300px)": "Grande (300px)",
"Gras": "Bold", "Gras": "Bold",
"Groupe": "Group", "Rôle": "Group",
"Groupe associé": "Associated Group", "Rôle associé": "Associated Group",
"Groupe requis pour accéder à la page :": "Group required to access the page:", "Rôle requis pour accéder à la page :": "Group required to access the page:",
"Groupes": "Groups", "Groupes": "Groups",
"Générer sitemap.xml et robots.txt": "Generate sitemap.xml and robots.txt", "Générer sitemap.xml et robots.txt": "Generate sitemap.xml and robots.txt",
"Générer une capture Open Graph": "Generate an Open Graph capture", "Générer une capture Open Graph": "Generate an Open Graph capture",

View File

@ -261,9 +261,9 @@
"Grande (220%)": "Grande (220%)", "Grande (220%)": "Grande (220%)",
"Grande (300px)": "Grande (300px)", "Grande (300px)": "Grande (300px)",
"Gras": "Negrita", "Gras": "Negrita",
"Groupe": "Grupo", "Rôle": "Grupo",
"Groupe associé": "Grupo asociado", "Rôle associé": "Grupo asociado",
"Groupe requis pour accéder à la page :": "Grupo necesario para acceder a la página:", "Rôle requis pour accéder à la page :": "Grupo necesario para acceder a la página:",
"Groupes": "Grupos", "Groupes": "Grupos",
"Générer sitemap.xml et robots.txt": "Generar sitemap.xml y robots.txt", "Générer sitemap.xml et robots.txt": "Generar sitemap.xml y robots.txt",
"Générer une capture Open Graph": "Generar una captura de Open Graph", "Générer une capture Open Graph": "Generar una captura de Open Graph",

View File

@ -261,9 +261,9 @@
"Grande (220%)": "", "Grande (220%)": "",
"Grande (300px)": "", "Grande (300px)": "",
"Gras": "", "Gras": "",
"Groupe": "", "Rôle": "",
"Groupe associé": "", "Rôle associé": "",
"Groupe requis pour accéder à la page :": "", "Rôle requis pour accéder à la page :": "",
"Groupes": "", "Groupes": "",
"Générer sitemap.xml et robots.txt": "", "Générer sitemap.xml et robots.txt": "",
"Générer une capture Open Graph": "", "Générer une capture Open Graph": "",

View File

@ -178,7 +178,7 @@ class page extends common
'parentPageId' => '', 'parentPageId' => '',
'modulePosition' => 'bottom', 'modulePosition' => 'bottom',
'position' => 0, 'position' => 0,
'group' => self::GROUP_VISITOR, 'role' => self::GROUP_VISITOR,
'targetBlank' => false, 'targetBlank' => false,
'title' => $pageTitle, 'title' => $pageTitle,
'shortTitle' => $pageTitle, 'shortTitle' => $pageTitle,
@ -538,7 +538,7 @@ class page extends common
'modulePosition' => $this->getInput('pageModulePosition'), 'modulePosition' => $this->getInput('pageModulePosition'),
'parentPageId' => $this->getInput('pageEditParentPageId'), 'parentPageId' => $this->getInput('pageEditParentPageId'),
'position' => $position, 'position' => $position,
'group' => $group, 'role' => $group,
'profil' => $profil, 'profil' => $profil,
'targetBlank' => $this->getInput('pageEditTargetBlank', helper::FILTER_BOOLEAN), 'targetBlank' => $this->getInput('pageEditTargetBlank', helper::FILTER_BOOLEAN),
'title' => $this->getInput('pageEditTitle', helper::FILTER_STRING_SHORT), 'title' => $this->getInput('pageEditTitle', helper::FILTER_STRING_SHORT),

View File

@ -359,8 +359,8 @@
<div class="row"> <div class="row">
<div class='col6'> <div class='col6'>
<?php echo template::select('pageEditGroup', self::$groupPublics, [ <?php echo template::select('pageEditGroup', self::$groupPublics, [
'label' => 'Groupe minimal pour accéder à la page', 'label' => 'Rôle minimal pour accéder à la page',
'selected' => $this->getData(['page', $this->getUrl(2), 'group']), 'selected' => $this->getData(['page', $this->getUrl(2), 'role']),
'help' => 'Les groupes de niveau supérieur accèdent à la page.' 'help' => 'Les groupes de niveau supérieur accèdent à la page.'
]); ?> ]); ?>
</div> </div>

View File

@ -29,7 +29,7 @@ class sitemap extends common
$items = '<ul>'; $items = '<ul>';
foreach ($this->getHierarchy(null, true, null) as $parentId => $childIds) { foreach ($this->getHierarchy(null, true, null) as $parentId => $childIds) {
$items .= ' <li>'; $items .= ' <li>';
if ($this->getData(['page', $parentId, 'disable']) === false && $this->getUser('group') >= $this->getData(['page', $parentId, 'group'])) { if ($this->getData(['page', $parentId, 'disable']) === false && $this->getUser('role') >= $this->getData(['page', $parentId, 'role'])) {
$pageUrl = ($parentId !== $this->getData(['locale', 'homePageId'])) ? helper::baseUrl() . $parentId : helper::baseUrl(false); $pageUrl = ($parentId !== $this->getData(['locale', 'homePageId'])) ? helper::baseUrl() . $parentId : helper::baseUrl(false);
$items .= '<a href="' . $pageUrl . '">' . $this->getData(['page', $parentId, 'title']) . '</a>'; $items .= '<a href="' . $pageUrl . '">' . $this->getData(['page', $parentId, 'title']) . '</a>';
} else { } else {
@ -66,7 +66,7 @@ class sitemap extends common
$items .= '<ul>'; $items .= '<ul>';
// Sous-page // Sous-page
$items .= ' <li>'; $items .= ' <li>';
if ($this->getData(['page', $childId, 'disable']) === false && $this->getUser('group') >= $this->getData(['page', $parentId, 'group'])) { if ($this->getData(['page', $childId, 'disable']) === false && $this->getUser('role') >= $this->getData(['page', $parentId, 'role'])) {
$pageUrl = ($childId !== $this->getData(['locale', 'homePageId'])) ? helper::baseUrl() . $childId : helper::baseUrl(false); $pageUrl = ($childId !== $this->getData(['locale', 'homePageId'])) ? helper::baseUrl() . $childId : helper::baseUrl(false);
$items .= '<a href="' . $pageUrl . '">' . $this->getData(['page', $childId, 'title']) . '</a>'; $items .= '<a href="' . $pageUrl . '">' . $this->getData(['page', $childId, 'title']) . '</a>';
} else { } else {

View File

@ -122,7 +122,7 @@ class user extends common
[ [
'firstname' => $userFirstname, 'firstname' => $userFirstname,
'forgot' => 0, 'forgot' => 0,
'group' => $group, 'role' => $group,
'profil' => $profil, 'profil' => $profil,
'lastname' => $userLastname, 'lastname' => $userLastname,
'pseudo' => $pseudo, 'pseudo' => $pseudo,
@ -206,8 +206,8 @@ class user extends common
$this->getUser('permission', __CLASS__, __FUNCTION__) !== true || $this->getUser('permission', __CLASS__, __FUNCTION__) !== true ||
// 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 // Role insuffisant
and ($this->getUrl('group') < self::GROUP_EDITOR) and ($this->getUrl('role') < self::GROUP_EDITOR)
) { ) {
// Valeurs en sortie // Valeurs en sortie
$this->addOutput([ $this->addOutput([
@ -254,10 +254,10 @@ class user extends common
and ( and (
// Impossible de s'auto-éditer // Impossible de s'auto-éditer
($this->getUser('id') === $this->getUrl(2) ($this->getUser('id') === $this->getUrl(2)
and $this->getUrl('group') <= self::GROUP_VISITOR and $this->getUrl('role') <= self::GROUP_VISITOR
) )
// Impossible d'éditer un autre utilisateur // Impossible d'éditer un autre utilisateur
or ($this->getUrl('group') < self::GROUP_EDITOR) or ($this->getUrl('role') < self::GROUP_EDITOR)
) )
) { ) {
// Valeurs en sortie // Valeurs en sortie
@ -273,7 +273,7 @@ class user extends common
) { ) {
$oldPassword = $this->getData(['user', $this->getUrl(2), 'password']); $oldPassword = $this->getData(['user', $this->getUrl(2), 'password']);
// Double vérification pour le mot de passe // Double vérification pour le mot de passe
if ($this->getUser('group') < self::GROUP_ADMIN) { if ($this->getUser('role') < self::GROUP_ADMIN) {
if ($this->getInput('userEditNewPassword')) { if ($this->getInput('userEditNewPassword')) {
// L'ancien mot de passe est correct // L'ancien mot de passe est correct
if (password_verify(html_entity_decode($this->getInput('userEditOldPassword')), $this->getData(['user', $this->getUrl(2), 'password']))) { if (password_verify(html_entity_decode($this->getInput('userEditOldPassword')), $this->getData(['user', $this->getUrl(2), 'password']))) {
@ -308,15 +308,15 @@ class user extends common
// Modification du groupe // Modification du groupe
if ( if (
$this->getUser('group') === self::GROUP_ADMIN $this->getUser('role') === self::GROUP_ADMIN
and $this->getUrl(2) !== $this->getUser('id') and $this->getUrl(2) !== $this->getUser('id')
) { ) {
$newGroup = $this->getInput('userEditGroup', helper::FILTER_INT, true); $newGroup = $this->getInput('userEditGroup', helper::FILTER_INT, true);
} else { } else {
$newGroup = $this->getData(['user', $this->getUrl(2), 'group']); $newGroup = $this->getData(['user', $this->getUrl(2), 'role']);
} }
// Modification de nom Prénom // Modification de nom Prénom
if ($this->getUser('group') === self::GROUP_ADMIN) { if ($this->getUser('role') === self::GROUP_ADMIN) {
$newfirstname = $this->getInput('userEditFirstname', helper::FILTER_STRING_SHORT, true); $newfirstname = $this->getInput('userEditFirstname', helper::FILTER_STRING_SHORT, true);
$newlastname = $this->getInput('userEditLastname', helper::FILTER_STRING_SHORT, true); $newlastname = $this->getInput('userEditLastname', helper::FILTER_STRING_SHORT, true);
} else { } else {
@ -335,7 +335,7 @@ class user extends common
[ [
'firstname' => $newfirstname, 'firstname' => $newfirstname,
'forgot' => 0, 'forgot' => 0,
'group' => $newGroup, 'role' => $newGroup,
'profil' => $profil, 'profil' => $profil,
'lastname' => $newlastname, 'lastname' => $newlastname,
'pseudo' => $this->getInput('userEditPseudo', helper::FILTER_STRING_SHORT, true), 'pseudo' => $this->getInput('userEditPseudo', helper::FILTER_STRING_SHORT, true),
@ -358,7 +358,7 @@ class user extends common
$redirect = helper::baseUrl() . 'user/login/' . str_replace('/', '_', $this->getUrl()); $redirect = helper::baseUrl() . 'user/login/' . str_replace('/', '_', $this->getUrl());
} }
// Redirection si retour en arrière possible // Redirection si retour en arrière possible
elseif ($this->getUser('group') === self::GROUP_ADMIN) { elseif ($this->getUser('role') === self::GROUP_ADMIN) {
$redirect = helper::baseUrl() . 'user'; $redirect = helper::baseUrl() . 'user';
} }
// Redirection normale // Redirection normale
@ -470,7 +470,7 @@ class user extends common
case "2": case "2":
foreach ($groupValue as $profilId => $profilValue) { foreach ($groupValue as $profilId => $profilValue) {
if ($profilId) { if ($profilId) {
self::$usersGroups[$groupId . $profilId] = sprintf(helper::translate('Groupe %s - Profil %s'), self::$groupPublics[$groupId], $profilValue['name']); self::$usersGroups[$groupId . $profilId] = sprintf(helper::translate('Rôle %s - Profil %s'), self::$groupPublics[$groupId], $profilValue['name']);
$profils[$groupId . $profilId] = 0; $profils[$groupId . $profilId] = 0;
} }
} }
@ -487,17 +487,17 @@ class user extends common
$userIdsLastNames = helper::arrayColumn($this->getData(['user']), 'lastname'); $userIdsLastNames = helper::arrayColumn($this->getData(['user']), 'lastname');
ksort($userIdsLastNames); ksort($userIdsLastNames);
foreach ($userIdsLastNames as $userId => $userLastNames) { foreach ($userIdsLastNames as $userId => $userLastNames) {
if ($this->getData(['user', $userId, 'group'])) { if ($this->getData(['user', $userId, 'role'])) {
// Compte les rôles // Compte les rôles
if (isset($profils[$this->getData(['user', $userId, 'group']) . $this->getData(['user', $userId, 'profil'])])) { if (isset($profils[$this->getData(['user', $userId, 'role']) . $this->getData(['user', $userId, 'profil'])])) {
$profils[$this->getData(['user', $userId, 'group']) . $this->getData(['user', $userId, 'profil'])]++; $profils[$this->getData(['user', $userId, 'role']) . $this->getData(['user', $userId, 'profil'])]++;
} }
// Filtres // Filtres
if ($this->isPost()) { if ($this->isPost()) {
// Groupe et profils // Role et profils
$group = (string) $this->getData(['user', $userId, 'group']); $group = (string) $this->getData(['user', $userId, 'role']);
$profil = (string) $this->getData(['user', $userId, 'profil']); $profil = (string) $this->getData(['user', $userId, 'profil']);
$firstName = $this->getData(['user', $userId, 'firstname']); $firstName = $this->getData(['user', $userId, 'firstname']);
$lastName = $this->getData(['user', $userId, 'lastname']); $lastName = $this->getData(['user', $userId, 'lastname']);
@ -526,10 +526,10 @@ class user extends common
self::$users[] = [ self::$users[] = [
$userId, $userId,
sprintf('%s %s',$userLastNames, $this->getData(['user', $userId, 'firstname'])), sprintf('%s %s',$userLastNames, $this->getData(['user', $userId, 'firstname'])),
helper::translate(self::$groups[(int) $this->getData(['user', $userId, 'group'])]), helper::translate(self::$groups[(int) $this->getData(['user', $userId, 'role'])]),
empty($this->getData(['profil', $this->getData(['user', $userId, 'group']), $this->getData(['user', $userId, 'profil']), 'name'])) empty($this->getData(['profil', $this->getData(['user', $userId, 'role']), $this->getData(['user', $userId, 'profil']), 'name']))
? helper::translate(self::$groups[(int) $this->getData(['user', $userId, 'group'])]) ? helper::translate(self::$groups[(int) $this->getData(['user', $userId, 'role'])])
: $this->getData(['profil', $this->getData(['user', $userId, 'group']), $this->getData(['user', $userId, 'profil']), 'name']), : $this->getData(['profil', $this->getData(['user', $userId, 'role']), $this->getData(['user', $userId, 'profil']), 'name']),
$this->getData(['user', $userId, 'tags']), $this->getData(['user', $userId, 'tags']),
template::button('userEdit' . $userId, [ template::button('userEdit' . $userId, [
'href' => helper::baseUrl() . 'user/edit/' . $userId, 'href' => helper::baseUrl() . 'user/edit/' . $userId,
@ -574,7 +574,7 @@ class user extends common
// Ne pas supprimer un profil utililsé // Ne pas supprimer un profil utililsé
// recherche les membres du groupe // recherche les membres du groupe
$groups = helper::arrayColumn($this->getData(['user']), 'group'); $groups = helper::arrayColumn($this->getData(['user']), 'role');
$groups = array_keys($groups, $this->getUrl(2)); $groups = array_keys($groups, $this->getUrl(2));
$profilUsed = true; $profilUsed = true;
// Stoppe si le profil est affecté // Stoppe si le profil est affecté
@ -939,7 +939,7 @@ class user extends common
{ {
// Ne pas supprimer un profil utililsé // Ne pas supprimer un profil utililsé
// recherche les membres du groupe // recherche les membres du groupe
$groups = helper::arrayColumn($this->getData(['user']), 'group'); $groups = helper::arrayColumn($this->getData(['user']), 'role');
$groups = array_keys($groups, $this->getUrl(2)); $groups = array_keys($groups, $this->getUrl(2));
$flag = true; $flag = true;
// Stoppe si le profil est affecté // Stoppe si le profil est affecté
@ -1046,7 +1046,7 @@ class user extends common
($this->getData(['user', $userId, 'connectTimeout']) + $this->getData(['config', 'connect', 'timeout'])) < time() ($this->getData(['user', $userId, 'connectTimeout']) + $this->getData(['config', 'connect', 'timeout'])) < time()
and $this->getData(['user', $userId, 'connectFail']) < $this->getData(['config', 'connect', 'attempt']) and $this->getData(['user', $userId, 'connectFail']) < $this->getData(['config', 'connect', 'attempt'])
and password_verify(html_entity_decode($this->getInput('userLoginPassword', helper::FILTER_STRING_SHORT, true)), $this->getData(['user', $userId, 'password'])) and password_verify(html_entity_decode($this->getInput('userLoginPassword', helper::FILTER_STRING_SHORT, true)), $this->getData(['user', $userId, 'password']))
and $this->getData(['user', $userId, 'group']) >= self::GROUP_MEMBER and $this->getData(['user', $userId, 'role']) >= self::GROUP_MEMBER
and $captcha === true and $captcha === true
) { ) {
@ -1060,7 +1060,7 @@ class user extends common
// Valeurs en sortie lorsque le site est en maintenance et que l'utilisateur n'est pas administrateur // Valeurs en sortie lorsque le site est en maintenance et que l'utilisateur n'est pas administrateur
if ( if (
$this->getData(['config', 'maintenance']) $this->getData(['config', 'maintenance'])
and $this->getData(['user', $userId, 'group']) < self::GROUP_ADMIN and $this->getData(['user', $userId, 'role']) < self::GROUP_ADMIN
) { ) {
$this->addOutput([ $this->addOutput([
'notification' => helper::translate('Seul un administrateur peut se connecter lors d\'une maintenance'), 'notification' => helper::translate('Seul un administrateur peut se connecter lors d\'une maintenance'),
@ -1080,7 +1080,7 @@ class user extends common
$authRedirect = ''; $authRedirect = '';
if ( if (
$this->getData(['config', 'connect', 'mailAuth']) > 0 $this->getData(['config', 'connect', 'mailAuth']) > 0
&& $this->getData(['user', $userId, 'group']) >= $this->getData(['config', 'connect', 'mailAuth']) && $this->getData(['user', $userId, 'role']) >= $this->getData(['config', 'connect', 'mailAuth'])
) { ) {
/** /**
* Envoi d'un email contenant une clé * Envoi d'un email contenant une clé
@ -1427,9 +1427,9 @@ class user extends common
$item['nom'], $item['nom'],
$item['prenom'], $item['prenom'],
self::$groups[$item['groupe']], self::$groups[$item['groupe']],
empty($this->getData(['profil', $this->getData(['user', $userId, 'group']), $this->getData(['user', $userId, 'profil']), 'name'])) empty($this->getData(['profil', $this->getData(['user', $userId, 'role']), $this->getData(['user', $userId, 'profil']), 'name']))
? helper::translate(self::$groups[(int) $this->getData(['user', $userId, 'group'])]) ? helper::translate(self::$groups[(int) $this->getData(['user', $userId, 'role'])])
: $this->getData(['profil', $this->getData(['user', $userId, 'group']), $this->getData(['user', $userId, 'profil']), 'name']), : $this->getData(['profil', $this->getData(['user', $userId, 'role']), $this->getData(['user', $userId, 'profil']), 'name']),
$item['prenom'], $item['prenom'],
helper::filter($item['email'], helper::FILTER_MAIL), helper::filter($item['email'], helper::FILTER_MAIL),
$item['tags'], $item['tags'],
@ -1445,7 +1445,7 @@ class user extends common
[ [
'firstname' => $item['prenom'], 'firstname' => $item['prenom'],
'forgot' => 0, 'forgot' => 0,
'group' => $item['groupe'], 'role' => $item['groupe'],
'profil' => $item['profil'], 'profil' => $item['profil'],
'lastname' => $item['nom'], 'lastname' => $item['nom'],
'mail' => $item['email'], 'mail' => $item['email'],
@ -1490,9 +1490,9 @@ class user extends common
$item['nom'], $item['nom'],
$item['prenom'], $item['prenom'],
self::$groups[$item['groupe']], self::$groups[$item['groupe']],
empty($this->getData(['profil', $this->getData(['user', $userId, 'group']), $this->getData(['user', $userId, 'profil']), 'name'])) empty($this->getData(['profil', $this->getData(['user', $userId, 'role']), $this->getData(['user', $userId, 'profil']), 'name']))
? helper::translate(self::$groups[(int) $this->getData(['user', $userId, 'group'])]) ? helper::translate(self::$groups[(int) $this->getData(['user', $userId, 'role'])])
: $this->getData(['profil', $this->getData(['user', $userId, 'group']), $this->getData(['user', $userId, 'profil']), 'name']), : $this->getData(['profil', $this->getData(['user', $userId, 'role']), $this->getData(['user', $userId, 'profil']), 'name']),
$item['prenom'], $item['prenom'],
$item['email'], $item['email'],
$item['tags'], $item['tags'],

View File

@ -105,7 +105,7 @@
<div class="row"> <div class="row">
<div class="col6"> <div class="col6">
<?php echo template::select('userAddGroup', self::$groupNews, [ <?php echo template::select('userAddGroup', self::$groupNews, [
'label' => 'Groupe', 'label' => 'Rôle',
'selected' => self::GROUP_MEMBER 'selected' => self::GROUP_MEMBER
]); ?> ]); ?>
</div> </div>

View File

@ -1,7 +1,7 @@
<?php echo template::formOpen('userEditForm'); ?> <?php echo template::formOpen('userEditForm'); ?>
<div class="row"> <div class="row">
<div class="col1"> <div class="col1">
<?php if ($this->getUser('group') === self::GROUP_ADMIN): ?> <?php if ($this->getUser('role') === self::GROUP_ADMIN): ?>
<?php echo template::button('userEditBack', [ <?php echo template::button('userEditBack', [
'class' => 'buttonGrey', 'class' => 'buttonGrey',
'href' => helper::baseUrl() . 'user', 'href' => helper::baseUrl() . 'user',
@ -29,7 +29,7 @@
<div class="col6"> <div class="col6">
<?php echo template::text('userEditFirstname', [ <?php echo template::text('userEditFirstname', [
'autocomplete' => 'off', 'autocomplete' => 'off',
'disabled' => $this->getUser('group') > self::GROUP_EDITOR ? false : true, 'disabled' => $this->getUser('role') > self::GROUP_EDITOR ? false : true,
'label' => 'Prénom', 'label' => 'Prénom',
'value' => $this->getData(['user', $this->getUrl(2), 'firstname']) 'value' => $this->getData(['user', $this->getUrl(2), 'firstname'])
]); ?> ]); ?>
@ -37,7 +37,7 @@
<div class="col6"> <div class="col6">
<?php echo template::text('userEditLastname', [ <?php echo template::text('userEditLastname', [
'autocomplete' => 'off', 'autocomplete' => 'off',
'disabled' => $this->getUser('group') > self::GROUP_EDITOR ? false : true, 'disabled' => $this->getUser('role') > self::GROUP_EDITOR ? false : true,
'label' => 'Nom', 'label' => 'Nom',
'value' => $this->getData(['user', $this->getUrl(2), 'lastname']) 'value' => $this->getData(['user', $this->getUrl(2), 'lastname'])
]); ?> ]); ?>
@ -77,7 +77,7 @@
<div class="col12"> <div class="col12">
<?php echo template::text('userEditTags', [ <?php echo template::text('userEditTags', [
'label' => 'Étiquettes', 'label' => 'Étiquettes',
'disabled' => $this->getUser('group') > self::GROUP_EDITOR ? false : true, 'disabled' => $this->getUser('role') > self::GROUP_EDITOR ? false : true,
'value' => $this->getData(['user', $this->getUrl(2), 'tags']), 'value' => $this->getData(['user', $this->getUrl(2), 'tags']),
'help' => 'Les étiquettes sont séparées par des espaces' 'help' => 'Les étiquettes sont séparées par des espaces'
]); ?> ]); ?>
@ -99,7 +99,7 @@
]); ?> ]); ?>
<?php <?php
// Les admins ont le pouvoir de forcer le changement de mot de passe // Les admins ont le pouvoir de forcer le changement de mot de passe
if ($this->getUser('group') < self::GROUP_ADMIN): ?> if ($this->getUser('role') < self::GROUP_ADMIN): ?>
<?php echo template::password('userEditOldPassword', [ <?php echo template::password('userEditOldPassword', [
'autocomplete' => 'new-password', 'autocomplete' => 'new-password',
// remplace 'off' pour éviter le pré remplissage auto // remplace 'off' pour éviter le pré remplissage auto
@ -125,16 +125,16 @@
</h4> </h4>
<div class="row"> <div class="row">
<div class="col12"> <div class="col12">
<?php if ($this->getUser('group') === self::GROUP_ADMIN): ?> <?php if ($this->getUser('role') === self::GROUP_ADMIN): ?>
<?php echo template::select('userEditGroup', self::$groupEdits, [ <?php echo template::select('userEditGroup', self::$groupEdits, [
'disabled' => ($this->getUrl(2) === $this->getUser('id')), 'disabled' => ($this->getUrl(2) === $this->getUser('id')),
'help' => ($this->getUrl(2) === $this->getUser('id') ? 'Impossible de modifier votre propre groupe.' : ''), 'help' => ($this->getUrl(2) === $this->getUser('id') ? 'Impossible de modifier votre propre groupe.' : ''),
'label' => 'Groupe', 'label' => 'Rôle',
'selected' => $this->getData(['user', $this->getUrl(2), 'group']), 'selected' => $this->getData(['user', $this->getUrl(2), 'role']),
]); ?> ]); ?>
<?php else: ?> <?php else: ?>
<?php echo template::hidden('userEditGroup', [ <?php echo template::hidden('userEditGroup', [
'value' => $this->getData(['user', $this->getUrl(2), 'group']) 'value' => $this->getData(['user', $this->getUrl(2), 'role'])
]); ?> ]); ?>
<?php endif; ?> <?php endif; ?>
</div> </div>
@ -143,14 +143,14 @@
<?php echo template::select('userEditProfil' . self::GROUP_MEMBER, user::$userProfils[self::GROUP_MEMBER], [ <?php echo template::select('userEditProfil' . self::GROUP_MEMBER, user::$userProfils[self::GROUP_MEMBER], [
'label' => 'Profil', 'label' => 'Profil',
'selected' => $this->getData(['user', $this->getUrl(2), 'profil']), 'selected' => $this->getData(['user', $this->getUrl(2), 'profil']),
'disabled' => $this->getUser('group') !== self::GROUP_ADMIN, 'disabled' => $this->getUser('role') !== self::GROUP_ADMIN,
]); ?> ]); ?>
</div> </div>
<div class="userEditGroupProfil" id="userEditGroupProfil<?php echo self::GROUP_EDITOR; ?>"> <div class="userEditGroupProfil" id="userEditGroupProfil<?php echo self::GROUP_EDITOR; ?>">
<?php echo template::select('userEditProfil' . self::GROUP_EDITOR, user::$userProfils[self::GROUP_EDITOR], [ <?php echo template::select('userEditProfil' . self::GROUP_EDITOR, user::$userProfils[self::GROUP_EDITOR], [
'label' => 'Profil', 'label' => 'Profil',
'selected' => $this->getData(['user', $this->getUrl(2), 'profil']), 'selected' => $this->getData(['user', $this->getUrl(2), 'profil']),
'disabled' => $this->getUser('group') !== self::GROUP_ADMIN, 'disabled' => $this->getUser('role') !== self::GROUP_ADMIN,
]); ?> ]); ?>
</div> </div>
</div> </div>

View File

@ -61,7 +61,7 @@
<?php if (user::$users): ?> <?php if (user::$users): ?>
<div class="row"> <div class="row">
<div class="col12 textAlignCenter"> <div class="col12 textAlignCenter">
<?php echo template::table([1, 2, 2, 1, 1, 1, 2, 1, 1], user::$users, ['Id', 'Nom', 'Prénom', 'Groupe', 'Profil', 'Pseudo', 'eMail', 'Étiquettes', '']); ?> <?php echo template::table([1, 2, 2, 1, 1, 1, 2, 1, 1], user::$users, ['Id', 'Nom', 'Prénom', 'Rôle', 'Profil', 'Pseudo', 'eMail', 'Étiquettes', '']); ?>
<?php echo template::ico('check'); ?> Compte créé | <?php echo template::ico('check'); ?> Compte créé |
<?php echo template::ico('mail'); ?> Compte créé et notifié | <?php echo template::ico('mail'); ?> Compte créé et notifié |
<?php echo template::ico('cancel'); ?> Erreur dans le fichier ou le compte existe. <?php echo template::ico('cancel'); ?> Erreur dans le fichier ou le compte existe.

View File

@ -60,4 +60,4 @@
</div> </div>
</div> </div>
<?php echo template::formClose(); ?> <?php echo template::formClose(); ?>
<?php echo template::table([2, 2, 2, 2, 2, 1, 1], user::$users, ['Identifiant', 'Nom', 'Groupe', 'Profil', 'Étiquettes', '', ''], ['id' => 'dataTables']); ?> <?php echo template::table([2, 2, 2, 2, 2, 1, 1], user::$users, ['Identifiant', 'Nom', 'Rôle', 'Profil', 'Étiquettes', '', ''], ['id' => 'dataTables']); ?>

View File

@ -28,7 +28,7 @@
</div> </div>
<div class="col12"> <div class="col12">
<?php echo template::select('profilAddGroup', user::$groupProfils, [ <?php echo template::select('profilAddGroup', user::$groupProfils, [
'label' => 'Groupe associé', 'label' => 'Rôle associé',
'selected' => $this->getUrl(2) 'selected' => $this->getUrl(2)
]); ?> ]); ?>
</div> </div>

View File

@ -40,7 +40,7 @@
</div> </div>
<div class="col12"> <div class="col12">
<?php echo template::text('profilEditDisplayGroup', [ <?php echo template::text('profilEditDisplayGroup', [
'label' => 'Groupe associé', 'label' => 'Rôle associé',
'value' => helper::translate(self::$groups[$this->getUrl(2)]), 'value' => helper::translate(self::$groups[$this->getUrl(2)]),
'disabled' => true 'disabled' => true
]); ?> ]); ?>

View File

@ -24,7 +24,7 @@ $g = json_decode(file_get_contents('../../../site/data/profil.json'), true);
// Lecture les droits // Lecture les droits
if (!is_null($u) && !is_null($g) && !is_null($userId)) { if (!is_null($u) && !is_null($g) && !is_null($userId)) {
$group = $u['user'][$userId]['group']; $group = $u['user'][$userId]['role'];
switch ($group) { switch ($group) {
case 3: case 3:
// Accès admin // Accès admin

View File

@ -23,7 +23,7 @@ class blog 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)
const EDIT_OWNER = 'owner'; const EDIT_OWNER = 'owner';
const EDIT_GROUP = 'group'; const EDIT_GROUP = 'role';
const EDIT_ALL = 'all'; const EDIT_ALL = 'all';
public static $actions = [ public static $actions = [
@ -112,7 +112,7 @@ class blog extends common
// Permissions d'un article // Permissions d'un article
public static $articleConsent = [ public static $articleConsent = [
self::EDIT_ALL => 'Tous les groupes', self::EDIT_ALL => 'Tous les groupes',
self::EDIT_GROUP => 'Groupe du propriétaire', self::EDIT_GROUP => 'Rôle du propriétaire',
self::EDIT_OWNER => 'Propriétaire' self::EDIT_OWNER => 'Propriétaire'
]; ];
@ -259,7 +259,7 @@ class blog extends common
$this->isPost() $this->isPost()
) { ) {
// Modification de l'userId // Modification de l'userId
if ($this->getUser('group') === self::GROUP_ADMIN) { if ($this->getUser('role') === self::GROUP_ADMIN) {
$newuserid = $this->getInput('blogAddUserId', helper::FILTER_STRING_SHORT, true); $newuserid = $this->getInput('blogAddUserId', helper::FILTER_STRING_SHORT, true);
} else { } else {
$newuserid = $this->getUser('id'); $newuserid = $this->getUser('id');
@ -284,7 +284,7 @@ class blog extends common
'state' => $this->getInput('blogAddState', helper::FILTER_BOOLEAN), 'state' => $this->getInput('blogAddState', helper::FILTER_BOOLEAN),
'title' => $this->getInput('blogAddTitle', helper::FILTER_STRING_SHORT, true), 'title' => $this->getInput('blogAddTitle', helper::FILTER_STRING_SHORT, true),
'userId' => $newuserid, 'userId' => $newuserid,
'editConsent' => $this->getInput('blogAddConsent') === self::EDIT_GROUP ? $this->getUser('group') : $this->getInput('blogAddConsent'), 'editConsent' => $this->getInput('blogAddConsent') === self::EDIT_GROUP ? $this->getUser('role') : $this->getInput('blogAddConsent'),
'commentMaxlength' => $this->getInput('blogAddCommentMaxlength'), 'commentMaxlength' => $this->getInput('blogAddCommentMaxlength'),
'commentApproved' => $this->getInput('blogAddCommentApproved', helper::FILTER_BOOLEAN), 'commentApproved' => $this->getInput('blogAddCommentApproved', helper::FILTER_BOOLEAN),
'commentClose' => $this->getInput('blogAddCommentClose', helper::FILTER_BOOLEAN), 'commentClose' => $this->getInput('blogAddCommentClose', helper::FILTER_BOOLEAN),
@ -493,13 +493,13 @@ class blog extends common
( // Propriétaire ( // Propriétaire
$this->getData(['module', $this->getUrl(0), 'posts', $value, 'editConsent']) === self::EDIT_OWNER $this->getData(['module', $this->getUrl(0), 'posts', $value, 'editConsent']) === self::EDIT_OWNER
and ($this->getData(['module', $this->getUrl(0), 'posts', $value, 'userId']) === $this->getUser('id') and ($this->getData(['module', $this->getUrl(0), 'posts', $value, 'userId']) === $this->getUser('id')
or $this->getUser('group') === self::GROUP_ADMIN) or $this->getUser('role') === self::GROUP_ADMIN)
) )
or ( or (
// Groupe // Role
$this->getData(['module', $this->getUrl(0), 'posts', $value, 'editConsent']) !== self::EDIT_OWNER $this->getData(['module', $this->getUrl(0), 'posts', $value, 'editConsent']) !== self::EDIT_OWNER
and $this->getUser('group') >= $this->getData(['module', $this->getUrl(0), 'posts', $value, 'editConsent']) and $this->getUser('role') >= $this->getData(['module', $this->getUrl(0), 'posts', $value, 'editConsent'])
) )
or ( or (
// Tout le monde // Tout le monde
@ -655,7 +655,7 @@ class blog extends common
$this->getUser('permission', __CLASS__, __FUNCTION__) === true && $this->getUser('permission', __CLASS__, __FUNCTION__) === true &&
$this->isPost() $this->isPost()
) { ) {
if ($this->getUser('group') === self::GROUP_ADMIN) { if ($this->getUser('role') === self::GROUP_ADMIN) {
$newuserid = $this->getInput('blogEditUserId', helper::FILTER_STRING_SHORT, true); $newuserid = $this->getInput('blogEditUserId', helper::FILTER_STRING_SHORT, true);
} else { } else {
$newuserid = $this->getUser('id'); $newuserid = $this->getUser('id');
@ -683,7 +683,7 @@ class blog extends common
'publishedOn' => $this->getInput('blogEditPublishedOn', helper::FILTER_DATETIME, true), 'publishedOn' => $this->getInput('blogEditPublishedOn', helper::FILTER_DATETIME, true),
'state' => $this->getInput('blogEditState', helper::FILTER_BOOLEAN), 'state' => $this->getInput('blogEditState', helper::FILTER_BOOLEAN),
'userId' => $newuserid, 'userId' => $newuserid,
'editConsent' => $this->getInput('blogEditConsent') === self::EDIT_GROUP ? $this->getUser('group') : $this->getInput('blogEditConsent'), 'editConsent' => $this->getInput('blogEditConsent') === self::EDIT_GROUP ? $this->getUser('role') : $this->getInput('blogEditConsent'),
'commentMaxlength' => $this->getInput('blogEditCommentMaxlength'), 'commentMaxlength' => $this->getInput('blogEditCommentMaxlength'),
'commentApproved' => $this->getInput('blogEditCommentApproved', helper::FILTER_BOOLEAN), 'commentApproved' => $this->getInput('blogEditCommentApproved', helper::FILTER_BOOLEAN),
'commentClose' => $this->getInput('blogEditCommentClose', helper::FILTER_BOOLEAN), 'commentClose' => $this->getInput('blogEditCommentClose', helper::FILTER_BOOLEAN),
@ -707,10 +707,10 @@ 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_EDITOR) { if ($this->getData(['user', $userId, 'role']) < 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, 'role'])] . ')';
} }
unset($userFirstname); unset($userFirstname);
// Valeurs en sortie // Valeurs en sortie
@ -783,7 +783,7 @@ class blog extends common
$to = []; $to = [];
// Liste des destinataires // Liste des destinataires
foreach ($this->getData(['user']) as $userId => $user) { foreach ($this->getData(['user']) as $userId => $user) {
if ($user['group'] >= $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'commentGroupNotification'])) { if ($user['role'] >= $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'commentGroupNotification'])) {
$to[] = $user['mail']; $to[] = $user['mail'];
$firstname[] = $user['firstname']; $firstname[] = $user['firstname'];
$lastname[] = $user['lastname']; $lastname[] = $user['lastname'];

View File

@ -27,7 +27,7 @@
"Commentaires supprimés": "Gelöschte Kommentare", "Commentaires supprimés": "Gelöschte Kommentare",
"Fermer les commentaires": "Schalten Sie die Kommentare aus", "Fermer les commentaires": "Schalten Sie die Kommentare aus",
"Gestion des commentaires": "Kommentarmanagement", "Gestion des commentaires": "Kommentarmanagement",
"Groupe du propriétaire": "Besitzergruppe", "Rôle du propriétaire": "Besitzergruppe",
"Image de couverture": "Berichterstattung", "Image de couverture": "Berichterstattung",
"Informations générales": "Allgemeine Informationen", "Informations générales": "Allgemeine Informationen",
"Lien du flux RSS": "Lien du flux RSS", "Lien du flux RSS": "Lien du flux RSS",

View File

@ -27,7 +27,7 @@
"Commentaires supprimés": "Deleted comments", "Commentaires supprimés": "Deleted comments",
"Fermer les commentaires": "Turn off the comments", "Fermer les commentaires": "Turn off the comments",
"Gestion des commentaires": "Comment management", "Gestion des commentaires": "Comment management",
"Groupe du propriétaire": "Owner's group", "Rôle du propriétaire": "Owner's group",
"Image de couverture": "Coverage", "Image de couverture": "Coverage",
"Informations générales": "General informations", "Informations générales": "General informations",
"Lien du flux RSS": "Lien du Flux RSS", "Lien du flux RSS": "Lien du Flux RSS",

View File

@ -27,7 +27,7 @@
"Commentaires supprimés": "Comentarios eliminados", "Commentaires supprimés": "Comentarios eliminados",
"Fermer les commentaires": "Cerrar los comentarios", "Fermer les commentaires": "Cerrar los comentarios",
"Gestion des commentaires": "Gestión de comentarios", "Gestion des commentaires": "Gestión de comentarios",
"Groupe du propriétaire": "Grupo de propietarios", "Rôle du propriétaire": "Grupo de propietarios",
"Image de couverture": "Imagen de portada", "Image de couverture": "Imagen de portada",
"Informations générales": "Información general", "Informations générales": "Información general",
"Lien du flux RSS": "Enlace de fuente RSS", "Lien du flux RSS": "Enlace de fuente RSS",

View File

@ -27,7 +27,7 @@
"Commentaires supprimés": "", "Commentaires supprimés": "",
"Fermer les commentaires": "", "Fermer les commentaires": "",
"Gestion des commentaires": "", "Gestion des commentaires": "",
"Groupe du propriétaire": "", "Rôle du propriétaire": "",
"Image de couverture": "", "Image de couverture": "",
"Informations générales": "", "Informations générales": "",
"Lien du flux RSS": "", "Lien du flux RSS": "",

View File

@ -27,7 +27,7 @@
"Commentaires supprimés": "Σχόλια διαγράφονται", "Commentaires supprimés": "Σχόλια διαγράφονται",
"Fermer les commentaires": "Κλείσιμο σχολίων", "Fermer les commentaires": "Κλείσιμο σχολίων",
"Gestion des commentaires": "Διαχείριση σχολίων", "Gestion des commentaires": "Διαχείριση σχολίων",
"Groupe du propriétaire": "Ομάδα ιδιοκτήτη", "Rôle du propriétaire": "Ομάδα ιδιοκτήτη",
"Image de couverture": "εικόνα εξωφύλλου", "Image de couverture": "εικόνα εξωφύλλου",
"Informations générales": "Γενικές πληροφορίες", "Informations générales": "Γενικές πληροφορίες",
"Lien du flux RSS": "Σύνδεσμος τροφοδοσίας RSS", "Lien du flux RSS": "Σύνδεσμος τροφοδοσίας RSS",

View File

@ -27,7 +27,7 @@
"Commentaires supprimés": "Commenti cancellati", "Commentaires supprimés": "Commenti cancellati",
"Fermer les commentaires": "Disattiva i commenti", "Fermer les commentaires": "Disattiva i commenti",
"Gestion des commentaires": "Gestione dei commenti", "Gestion des commentaires": "Gestione dei commenti",
"Groupe du propriétaire": "Gruppo del proprietario", "Rôle du propriétaire": "Gruppo del proprietario",
"Image de couverture": "Copertura", "Image de couverture": "Copertura",
"Informations générales": "Informazioni generali", "Informations générales": "Informazioni generali",
"Lien du flux RSS": "Lien Du Flux RSS", "Lien du flux RSS": "Lien Du Flux RSS",

View File

@ -27,7 +27,7 @@
"Commentaires supprimés": "Comentários excluídos", "Commentaires supprimés": "Comentários excluídos",
"Fermer les commentaires": "Desligue os comentários", "Fermer les commentaires": "Desligue os comentários",
"Gestion des commentaires": "Gerenciamento de comentários", "Gestion des commentaires": "Gerenciamento de comentários",
"Groupe du propriétaire": "Grupo do proprietário", "Rôle du propriétaire": "Grupo do proprietário",
"Image de couverture": "Cobertura", "Image de couverture": "Cobertura",
"Informations générales": "Informações gerais", "Informations générales": "Informações gerais",
"Lien du flux RSS": "Lien du Flux RSS", "Lien du flux RSS": "Lien du Flux RSS",

View File

@ -27,7 +27,7 @@
"Commentaires supprimés": "Silinen yorumlar", "Commentaires supprimés": "Silinen yorumlar",
"Fermer les commentaires": "Yorumları kapat", "Fermer les commentaires": "Yorumları kapat",
"Gestion des commentaires": "Yorum yönetimi", "Gestion des commentaires": "Yorum yönetimi",
"Groupe du propriétaire": "Sahip grubu", "Rôle du propriétaire": "Sahip grubu",
"Image de couverture": "Kapak resmi", "Image de couverture": "Kapak resmi",
"Informations générales": "Genel bilgiler", "Informations générales": "Genel bilgiler",
"Lien du flux RSS": "RSS dağıtım bağlantısı", "Lien du flux RSS": "RSS dağıtım bağlantısı",

View File

@ -82,7 +82,7 @@
<?php echo template::select('blogAddUserId', blog::$users, [ <?php echo template::select('blogAddUserId', blog::$users, [
'label' => 'Auteur', 'label' => 'Auteur',
'selected' => $this->getUser('id'), 'selected' => $this->getUser('id'),
'disabled' => $this->getUser('group') !== self::GROUP_ADMIN ? true : false 'disabled' => $this->getUser('role') !== self::GROUP_ADMIN ? true : false
]); ?> ]); ?>
</div> </div>
<div class="col4"> <div class="col4">

View File

@ -52,18 +52,18 @@
( // Propriétaire ( // Propriétaire
($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'editConsent']) === blog::EDIT_OWNER ($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'editConsent']) === blog::EDIT_OWNER
and ($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'userId']) === $this->getUser('id') and ($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'userId']) === $this->getUser('id')
or $this->getUser('group') === self::GROUP_ADMIN) or $this->getUser('role') === self::GROUP_ADMIN)
) )
or ( or (
// Groupe // Role
($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_EDITOR) 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('role') >= $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'editConsent'])
) )
or ( or (
// Tout le monde // Tout le monde
$this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'editConsent']) === blog::EDIT_ALL $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'editConsent']) === blog::EDIT_ALL
and $this->getUser('group') >= blog::$actions['config'] and $this->getUser('role') >= blog::$actions['config']
) )
) )
): ?> ): ?>

View File

@ -89,7 +89,7 @@
<?php echo template::select('blogEditUserId', blog::$users, [ <?php echo template::select('blogEditUserId', blog::$users, [
'label' => 'Auteur', 'label' => 'Auteur',
'selected' => $this->getUser('id'), 'selected' => $this->getUser('id'),
'disabled' => $this->getUser('group') !== self::GROUP_ADMIN ? true : false 'disabled' => $this->getUser('role') !== self::GROUP_ADMIN ? true : false
]); ?> ]); ?>
</div> </div>
<div class="col4"> <div class="col4">

View File

@ -77,18 +77,18 @@
( // Propriétaire ( // Propriétaire
($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'editConsent']) === blog::EDIT_OWNER ($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'editConsent']) === blog::EDIT_OWNER
and ($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'userId']) === $this->getUser('id') and ($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'userId']) === $this->getUser('id')
or $this->getUser('group') === self::GROUP_ADMIN) or $this->getUser('role') === self::GROUP_ADMIN)
) )
or ( or (
// Groupe // Role
($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_EDITOR) 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('role') >= $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'editConsent'])
) )
or ( or (
// Tout le monde // Tout le monde
$this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'editConsent']) === blog::EDIT_ALL $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'editConsent']) === blog::EDIT_ALL
and $this->getUser('group') >= blog::$actions['config'] and $this->getUser('role') >= blog::$actions['config']
) )
) )
): ?> ): ?>

View File

@ -185,7 +185,7 @@ class form extends common
[ [
'button' => $this->getInput('formOptionButton'), 'button' => $this->getInput('formOptionButton'),
'captcha' => $this->getInput('formOptionCaptcha', helper::FILTER_BOOLEAN), 'captcha' => $this->getInput('formOptionCaptcha', helper::FILTER_BOOLEAN),
'group' => $this->getInput('formOptionGroup', helper::FILTER_INT), 'role' => $this->getInput('formOptionGroup', helper::FILTER_INT),
'user' => self::$listUsers[$this->getInput('formOptionUser', helper::FILTER_INT)], 'user' => self::$listUsers[$this->getInput('formOptionUser', helper::FILTER_INT)],
'mail' => $this->getInput('formOptionMail'), 'mail' => $this->getInput('formOptionMail'),
'pageId' => $this->getInput('formOptionPageIdToggle', helper::FILTER_BOOLEAN) === true ? $this->getInput('formOptionPageId', helper::FILTER_ID) : '', 'pageId' => $this->getInput('formOptionPageIdToggle', helper::FILTER_BOOLEAN) === true ? $this->getInput('formOptionPageId', helper::FILTER_ID) : '',
@ -454,7 +454,7 @@ class form extends common
'mail' 'mail'
]); ]);
$singlemail = $this->getData(['module', $this->getUrl(0), 'config', 'mail']); $singlemail = $this->getData(['module', $this->getUrl(0), 'config', 'mail']);
$group = $this->getData(['module', $this->getUrl(0), 'config', 'group']); $group = $this->getData(['module', $this->getUrl(0), 'config', 'role']);
// Verification si le mail peut être envoyé // Verification si le mail peut être envoyé
if ( if (
self::$inputNotices === [] && ( self::$inputNotices === [] && (
@ -466,7 +466,7 @@ class form extends common
$to = []; $to = [];
if ($group > 0) { if ($group > 0) {
foreach ($this->getData(['user']) as $userId => $user) { foreach ($this->getData(['user']) as $userId => $user) {
if ($user['group'] >= $group) { if ($user['role'] >= $group) {
$to[] = $user['mail']; $to[] = $user['mail'];
} }
} }

View File

@ -3,7 +3,7 @@ class init extends form {
public static $defaultData = [ public static $defaultData = [
'button'=> '', 'button'=> '',
'captcha'=> false, 'captcha'=> false,
'group'=> 0, 'role'=> 0,
'user'=> '', 'user'=> '',
'mail'=> '', 'mail'=> '',
'pageId'=> '', 'pageId'=> '',

View File

@ -80,7 +80,7 @@
<div class="block"> <div class="block">
<h4><?php echo helper::translate('Courriel'); ?></h4> <h4><?php echo helper::translate('Courriel'); ?></h4>
<?php echo template::checkbox('formOptionMailOptionsToggle', true, 'Envoyer par mail les données saisies :', [ <?php echo template::checkbox('formOptionMailOptionsToggle', true, 'Envoyer par mail les données saisies :', [
'checked' => (bool) $this->getData(['module', $this->getUrl(0), 'config', 'group']) || 'checked' => (bool) $this->getData(['module', $this->getUrl(0), 'config', 'role']) ||
!empty($this->getData(['module', $this->getUrl(0), 'config', 'user'])) || !empty($this->getData(['module', $this->getUrl(0), 'config', 'user'])) ||
!empty($this->getData(['module', $this->getUrl(0), 'config', 'mail'])), !empty($this->getData(['module', $this->getUrl(0), 'config', 'mail'])),
'help' => 'Sélectionnez au moins un groupe, un utilisateur ou saisissez un email. Votre serveur doit autoriser les envois de mail.' 'help' => 'Sélectionnez au moins un groupe, un utilisateur ou saisissez un email. Votre serveur doit autoriser les envois de mail.'
@ -103,7 +103,7 @@
<div class="col4"> <div class="col4">
<?php echo template::select('formOptionGroup', $groupMembers, [ <?php echo template::select('formOptionGroup', $groupMembers, [
'label' => 'A tous les groupes depuis', 'label' => 'A tous les groupes depuis',
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'group']), 'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'role']),
]); ?> ]); ?>
</div> </div>
<div class="col4"> <div class="col4">

View File

@ -42,7 +42,7 @@
$this->isConnected() === true $this->isConnected() === true
and and
( // Propriétaire ( // Propriétaire
($this->getUser('group') === self::GROUP_ADMIN) ($this->getUser('role') === self::GROUP_ADMIN)
) )
): ?> ): ?>
<a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/edit/' . $this->getUrl(1); ?>"> <a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/edit/' . $this->getUrl(1); ?>">

View File

@ -52,7 +52,7 @@
$this->isConnected() === true $this->isConnected() === true
and and
( // Propriétaire ( // Propriétaire
($this->getUser('group') === self::GROUP_ADMIN) ($this->getUser('role') === self::GROUP_ADMIN)
) )
): ?> ): ?>
<a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/edit/' . $newsId; ?>"> <a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/edit/' . $newsId; ?>">

View File

@ -59,7 +59,7 @@ class redirection extends common
// Message si l'utilisateur peut éditer la page // Message si l'utilisateur peut éditer la page
if ( if (
$this->isConnected() === true $this->isConnected() === true
&& $this->getUser('group') >= self::GROUP_EDITOR && $this->getUser('role') >= self::GROUP_EDITOR
&& $this->getUrl(1) !== 'force' && $this->getUrl(1) !== 'force'
) { ) {
// Valeurs en sortie // Valeurs en sortie

View File

@ -208,7 +208,7 @@ class search extends common
foreach ($this->getHierarchy(null, false, null) as $parentId => $childIds) { foreach ($this->getHierarchy(null, false, null) as $parentId => $childIds) {
if ( if (
$this->getData(['page', $parentId, 'disable']) === false && $this->getData(['page', $parentId, 'disable']) === false &&
$this->getUser('group') >= $this->getData(['page', $parentId, 'group']) && $this->getUser('role') >= $this->getData(['page', $parentId, 'role']) &&
$this->getData(['page', $parentId, 'block']) !== 'bar' $this->getData(['page', $parentId, 'block']) !== 'bar'
) { ) {
$url = $parentId; $url = $parentId;
@ -227,7 +227,7 @@ class search extends common
// Sous page // Sous page
if ( if (
$this->getData(['page', $childId, 'disable']) === false && $this->getData(['page', $childId, 'disable']) === false &&
$this->getUser('group') >= $this->getData(['page', $parentId, 'group']) && $this->getUser('role') >= $this->getData(['page', $parentId, 'role']) &&
$this->getData(['page', $parentId, 'block']) !== 'bar' $this->getData(['page', $parentId, 'block']) !== 'bar'
) { ) {
$url = $childId; $url = $childId;