Role renomme Groupe WIP
This commit is contained in:
parent
962e4c5d7c
commit
99a8b776b5
@ -353,7 +353,7 @@ class layout extends common
|
||||
}
|
||||
// Affichage de la barre de membre simple
|
||||
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
|
||||
) {
|
||||
$items .= '<span id="footerDisplayMemberAccount"';
|
||||
@ -514,11 +514,11 @@ class layout extends common
|
||||
}
|
||||
// Commandes pour les membres simples
|
||||
if (
|
||||
$this->getUser('group') === self::GROUP_MEMBER
|
||||
$this->getUser('role') === self::GROUP_MEMBER
|
||||
&& $this->getData(['theme', 'menu', 'memberBar']) === true
|
||||
) {
|
||||
if (
|
||||
$this->getUser('group') >= self::GROUP_MEMBER &&
|
||||
$this->getUser('role') >= self::GROUP_MEMBER &&
|
||||
$this->getUser('permission', 'filemanager') === true
|
||||
) {
|
||||
$itemsRight .= '<li>' . template::ico('folder', [
|
||||
@ -591,7 +591,7 @@ class layout extends common
|
||||
and $this->isConnected() === false
|
||||
) or ($this->getData(['page', $parentPageId, 'disable']) === 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);
|
||||
@ -657,7 +657,7 @@ class layout extends common
|
||||
and $this->isConnected() === false
|
||||
) or ($this->getData(['page', $childKey, 'disable']) === 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);
|
||||
@ -914,7 +914,7 @@ class layout extends common
|
||||
// Items de gauche
|
||||
$leftItems = '';
|
||||
// Sélecteur de langues
|
||||
if ($this->getUser('group') >= self::GROUP_EDITOR) {
|
||||
if ($this->getUser('role') >= self::GROUP_EDITOR) {
|
||||
$leftItem = '';
|
||||
foreach (self::$languages as $key => $value) {
|
||||
if (is_dir(self::DATA_DIR . $key)) {
|
||||
@ -926,7 +926,7 @@ class layout extends common
|
||||
$leftItems .= $leftItem;
|
||||
$leftItems .= '</select></li>';
|
||||
}
|
||||
if ($this->getUser('group') >= self::GROUP_ADMIN) {
|
||||
if ($this->getUser('role') >= self::GROUP_ADMIN) {
|
||||
$leftItems .= '<li>' . template::ico('flag', [
|
||||
'help' => 'Langues',
|
||||
'href' => helper::baseUrl() . 'language'
|
||||
@ -934,7 +934,7 @@ class layout extends common
|
||||
}
|
||||
|
||||
// Liste des pages
|
||||
if ($this->getUser('group') >= self::GROUP_EDITOR) {
|
||||
if ($this->getUser('role') >= self::GROUP_EDITOR) {
|
||||
$leftItems .= '<li><select id="barSelectPage">';
|
||||
$leftItems .= '<option value="">' . helper::translate('Pages du site') . '</option>';
|
||||
$leftItems .= '<optgroup label="' . helper::translate('Pages orphelines') . '">';
|
||||
@ -1055,7 +1055,7 @@ class layout extends common
|
||||
// Items de droite
|
||||
$rightItems = '';
|
||||
if (
|
||||
$this->getUser('group') >= self::GROUP_EDITOR
|
||||
$this->getUser('role') >= self::GROUP_EDITOR
|
||||
&& $this->getUser(
|
||||
'permission',
|
||||
'filemanager'
|
||||
@ -1067,7 +1067,7 @@ class layout extends common
|
||||
'attr' => 'data-lity'
|
||||
]) . '</li>';
|
||||
}
|
||||
if ($this->getUser('group') >= self::GROUP_ADMIN) {
|
||||
if ($this->getUser('role') >= self::GROUP_ADMIN) {
|
||||
$rightItems .= '<li>' . template::ico('brush', [
|
||||
'help' => 'Thème',
|
||||
'href' => helper::baseUrl() . 'theme'
|
||||
@ -1141,7 +1141,7 @@ class layout extends common
|
||||
}
|
||||
// Boutons depuis le groupe éditeur
|
||||
if (
|
||||
$this->getUser('group') >= self::GROUP_EDITOR
|
||||
$this->getUser('role') >= self::GROUP_EDITOR
|
||||
&& $this->getUser('permission', 'user', 'edit')
|
||||
|
||||
) {
|
||||
@ -1228,7 +1228,7 @@ class layout extends common
|
||||
$vars .= 'var baseUrlQs = ' . json_encode(helper::baseUrl()) . ';';
|
||||
if (
|
||||
$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')) . ';';
|
||||
}
|
||||
|
@ -414,7 +414,7 @@ class core extends common
|
||||
// Force la déconnexion des membres bannis ou d'une seconde session
|
||||
if (
|
||||
$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'])
|
||||
and $this->getData(['config', 'connect', 'autoDisconnect']) === true)
|
||||
)
|
||||
@ -429,7 +429,7 @@ class core extends common
|
||||
and $this->getUrl(1) !== 'login'
|
||||
and ($this->isConnected() === false
|
||||
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;
|
||||
if ($this->getData(['page', $this->getUrl(0)]) !== null) {
|
||||
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
|
||||
// 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
|
||||
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;
|
||||
@ -467,7 +467,7 @@ class core extends common
|
||||
and $this->isConnected() === false
|
||||
) or ($this->getData(['page', $this->getUrl(0), 'disable']) === true
|
||||
and $this->isConnected() === true
|
||||
and $this->getUser('group') < common::GROUP_EDITOR
|
||||
and $this->getUser('role') < common::GROUP_EDITOR
|
||||
)
|
||||
) {
|
||||
$access = false;
|
||||
@ -637,7 +637,7 @@ class core extends common
|
||||
if (
|
||||
($module::$actions[$action] === common::GROUP_VISITOR
|
||||
or ($this->isConnected() === true
|
||||
and $this->getUser('group') >= $module::$actions[$action]
|
||||
and $this->getUser('role') >= $module::$actions[$action]
|
||||
and $this->getUser('permission', $moduleId, $action)
|
||||
)
|
||||
)
|
||||
|
@ -28,7 +28,7 @@ class common
|
||||
const GROUP_VISITOR = 0;
|
||||
const GROUP_MEMBER = 1;
|
||||
const GROUP_EDITOR = 2;
|
||||
// Groupe MODERATOR, compatibilité avec les anciens modules :
|
||||
// Role MODERATOR, compatibilité avec les anciens modules :
|
||||
const GROUP_MODERATOR = 2;
|
||||
const GROUP_ADMIN = 3;
|
||||
const SIGNATURE_ID = 1;
|
||||
@ -813,11 +813,11 @@ class common
|
||||
// Page parent
|
||||
$this->getData(['page', $pageId, 'parentPageId']) === ""
|
||||
// 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
|
||||
//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
|
||||
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
|
||||
and (
|
||||
(
|
||||
$this->getData(['page', $pageId, 'group']) === self::GROUP_VISITOR
|
||||
$this->getData(['page', $pageId, 'role']) === self::GROUP_VISITOR
|
||||
and
|
||||
$this->getData(['page', $parentId, 'group']) === self::GROUP_VISITOR
|
||||
$this->getData(['page', $parentId, 'role']) === self::GROUP_VISITOR
|
||||
)
|
||||
or (
|
||||
$this->isConnected() === true
|
||||
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
|
||||
if ($this->getUser('group') === self::GROUP_ADMIN) {
|
||||
if ($this->getUser('role') === self::GROUP_ADMIN) {
|
||||
return true;
|
||||
} elseif ($this->getUser('group') <= self::GROUP_VISITOR) { // Groupe sans autorisation
|
||||
} elseif ($this->getUser('role') <= self::GROUP_VISITOR) { // Role sans autorisation
|
||||
return false;
|
||||
} elseif (
|
||||
// Groupe avec profil, consultation des autorisations sur deux clés
|
||||
// Role avec profil, consultation des autorisations sur deux clés
|
||||
$key1
|
||||
&& $key2
|
||||
&& $this->user
|
||||
&& $this->getData(['profil', $this->user['group'], $this->user['profil'], $key1])
|
||||
&& array_key_exists($key2, $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['role'], $this->user['profil'], $key1]))
|
||||
) {
|
||||
return $this->getData(['profil', $this->user['group'], $this->user['profil'], $key1, $key2]);
|
||||
// Groupe avec profil, consultation des autorisations sur une seule clé
|
||||
return $this->getData(['profil', $this->user['role'], $this->user['profil'], $key1, $key2]);
|
||||
// Role avec profil, consultation des autorisations sur une seule clé
|
||||
} elseif (
|
||||
$key1
|
||||
&& $this->user
|
||||
&& $this->getData(['profil', $this->user['group'], $this->user['profil']])
|
||||
&& array_key_exists($key1, $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['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 {
|
||||
// Une permission non spécifiée dans le profil est autorisée selon la valeur de $actions
|
||||
if (class_exists($key1)) {
|
||||
$module = new $key1;
|
||||
if (array_key_exists($key2, $module::$actions)) {
|
||||
return $this->getUser('group') >= $module::$actions[$key2];
|
||||
return $this->getUser('role') >= $module::$actions[$key2];
|
||||
}
|
||||
}
|
||||
return false;
|
||||
@ -1163,7 +1163,7 @@ class common
|
||||
foreach ($this->getHierarchy() as $parentPageId => $childrenPageIds) {
|
||||
// Exclure les barres et les pages non publiques et les pages masquées
|
||||
if (
|
||||
$this->getData(['page', $parentPageId, 'group']) !== 0 ||
|
||||
$this->getData(['page', $parentPageId, 'role']) !== 0 ||
|
||||
$this->getData(['page', $parentPageId, 'block']) === 'bar'
|
||||
) {
|
||||
continue;
|
||||
@ -1190,7 +1190,7 @@ class common
|
||||
}
|
||||
// Sous-pages
|
||||
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;
|
||||
}
|
||||
// Cas de la page d'accueil ne pas dupliquer l'URL
|
||||
|
@ -1115,4 +1115,58 @@ if ($this->getData(['core', 'dataVersion']) < 13101) {
|
||||
|
||||
// Mise à jour
|
||||
$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]);
|
||||
}
|
||||
|
@ -42,7 +42,7 @@
|
||||
|
||||
<body>
|
||||
<!-- Barre d'administration -->
|
||||
<?php if ($this->getUser('group') > self::GROUP_MEMBER): ?>
|
||||
<?php if ($this->getUser('role') > self::GROUP_MEMBER): ?>
|
||||
<?php $layout->showBar(); ?>
|
||||
<?php endif; ?>
|
||||
<!-- Notifications -->
|
||||
@ -55,7 +55,7 @@
|
||||
$this->getData(['theme', 'menu', 'position']) === 'top'
|
||||
and $this->getData(['theme', 'menu', 'fixed']) === true
|
||||
and $this->isConnected() === true
|
||||
and $this->getUser('group') > self::GROUP_MEMBER
|
||||
and $this->getUser('role') > self::GROUP_MEMBER
|
||||
) {
|
||||
echo '<nav id="navfixedconnected" >';
|
||||
} else {
|
||||
|
@ -151,7 +151,7 @@ class install extends common
|
||||
[
|
||||
'firstname' => $userFirstname,
|
||||
'forgot' => 0,
|
||||
'group' => self::GROUP_ADMIN,
|
||||
'role' => self::GROUP_ADMIN,
|
||||
'profil' => 0,
|
||||
'lastname' => $userLastname,
|
||||
'pseudo' => 'Admin',
|
||||
|
@ -46,7 +46,7 @@ class init extends common
|
||||
]
|
||||
],
|
||||
'core' => [
|
||||
'dataVersion' => 13000,
|
||||
'dataVersion' => 13600,
|
||||
'lastBackup' => 0,
|
||||
'lastClearTmp' => 0,
|
||||
'lastAutoUpdate' => 0,
|
||||
@ -689,7 +689,7 @@ class init extends common
|
||||
'modulePosition' => 'bottom',
|
||||
'parentPageId' => '',
|
||||
'position' => 1,
|
||||
'group' => self::GROUP_VISITOR,
|
||||
'role' => self::GROUP_VISITOR,
|
||||
'profil' => 0,
|
||||
'targetBlank' => false,
|
||||
'title' => 'Accueil',
|
||||
@ -744,7 +744,7 @@ class init extends common
|
||||
'modulePosition' => 'bottom',
|
||||
'parentPageId' => '',
|
||||
'position' => 1,
|
||||
'group' => self::GROUP_VISITOR,
|
||||
'role' => self::GROUP_VISITOR,
|
||||
'profil' => 0,
|
||||
'targetBlank' => false,
|
||||
'title' => 'Página de inicio',
|
||||
@ -800,7 +800,7 @@ class init extends common
|
||||
'modulePosition' => 'bottom',
|
||||
'parentPageId' => '',
|
||||
'position' => 1,
|
||||
'group' => self::GROUP_VISITOR,
|
||||
'role' => self::GROUP_VISITOR,
|
||||
'profil' => 0,
|
||||
'targetBlank' => false,
|
||||
'title' => 'Home page',
|
||||
@ -836,7 +836,7 @@ class init extends common
|
||||
'modulePosition' => 'bottom',
|
||||
'parentPageId' => '',
|
||||
'position' => 1,
|
||||
'group' => self::GROUP_VISITOR,
|
||||
'role' => self::GROUP_VISITOR,
|
||||
'profil' => 0,
|
||||
'targetBlank' => false,
|
||||
'title' => 'Accueil',
|
||||
@ -864,7 +864,7 @@ class init extends common
|
||||
'modulePosition' => 'bottom',
|
||||
'parentPageId' => 'accueil',
|
||||
'position' => 1,
|
||||
'group' => self::GROUP_VISITOR,
|
||||
'role' => self::GROUP_VISITOR,
|
||||
'profil' => 0,
|
||||
'targetBlank' => false,
|
||||
'title' => 'Page Enfant',
|
||||
@ -892,7 +892,7 @@ class init extends common
|
||||
'parentPageId' => '',
|
||||
'modulePosition' => 'bottom',
|
||||
'position' => 2,
|
||||
'group' => self::GROUP_MEMBER,
|
||||
'role' => self::GROUP_MEMBER,
|
||||
'profil' => 1,
|
||||
'targetBlank' => false,
|
||||
'title' => 'Page privée',
|
||||
@ -920,7 +920,7 @@ class init extends common
|
||||
'parentPageId' => 'accueil',
|
||||
'modulePosition' => 'bottom',
|
||||
'position' => 2,
|
||||
'group' => self::GROUP_VISITOR,
|
||||
'role' => self::GROUP_VISITOR,
|
||||
'profil' => 0,
|
||||
'targetBlank' => false,
|
||||
'title' => 'Mise en page',
|
||||
@ -948,7 +948,7 @@ class init extends common
|
||||
'parentPageId' => 'accueil',
|
||||
'modulePosition' => 'bottom',
|
||||
'position' => 3,
|
||||
'group' => self::GROUP_VISITOR,
|
||||
'role' => self::GROUP_VISITOR,
|
||||
'profil' => 0,
|
||||
'targetBlank' => false,
|
||||
'title' => 'Barre latérale avec menu',
|
||||
@ -976,7 +976,7 @@ class init extends common
|
||||
'modulePosition' => 'bottom',
|
||||
'parentPageId' => '',
|
||||
'position' => 3,
|
||||
'group' => self::GROUP_VISITOR,
|
||||
'role' => self::GROUP_VISITOR,
|
||||
'profil' => 0,
|
||||
'targetBlank' => false,
|
||||
'title' => 'Blog',
|
||||
@ -1004,7 +1004,7 @@ class init extends common
|
||||
'modulePosition' => 'bottom',
|
||||
'parentPageId' => '',
|
||||
'position' => 4,
|
||||
'group' => self::GROUP_VISITOR,
|
||||
'role' => self::GROUP_VISITOR,
|
||||
'profil' => 0,
|
||||
'targetBlank' => false,
|
||||
'title' => 'Galeries d\'images',
|
||||
@ -1033,7 +1033,7 @@ class init extends common
|
||||
'modulePosition' => 'bottom',
|
||||
'parentPageId' => '',
|
||||
'position' => 5,
|
||||
'group' => self::GROUP_VISITOR,
|
||||
'role' => self::GROUP_VISITOR,
|
||||
'profil' => 0,
|
||||
'targetBlank' => true,
|
||||
'title' => 'Site de Zwii',
|
||||
@ -1061,7 +1061,7 @@ class init extends common
|
||||
'modulePosition' => 'bottom',
|
||||
'parentPageId' => '',
|
||||
'position' => 6,
|
||||
'group' => self::GROUP_VISITOR,
|
||||
'role' => self::GROUP_VISITOR,
|
||||
'profil' => 0,
|
||||
'targetBlank' => false,
|
||||
'title' => 'Contact',
|
||||
@ -1089,7 +1089,7 @@ class init extends common
|
||||
'modulePosition' => 'bottom',
|
||||
'parentPageId' => '',
|
||||
'position' => 0,
|
||||
'group' => self::GROUP_VISITOR,
|
||||
'role' => self::GROUP_VISITOR,
|
||||
'profil' => 0,
|
||||
'targetBlank' => false,
|
||||
'title' => 'Barre latérale',
|
||||
@ -1117,7 +1117,7 @@ class init extends common
|
||||
'modulePosition' => 'bottom',
|
||||
'parentPageId' => '',
|
||||
'position' => 0,
|
||||
'group' => self::GROUP_VISITOR,
|
||||
'role' => self::GROUP_VISITOR,
|
||||
'profil' => 0,
|
||||
'targetBlank' => false,
|
||||
'title' => 'Barre latérale avec menu',
|
||||
@ -1145,7 +1145,7 @@ class init extends common
|
||||
'modulePosition' => 'bottom',
|
||||
'parentPageId' => '',
|
||||
'position' => 0,
|
||||
'group' => self::GROUP_VISITOR,
|
||||
'role' => self::GROUP_VISITOR,
|
||||
'profil' => 0,
|
||||
'targetBlank' => false,
|
||||
'title' => 'Mentions légales',
|
||||
@ -1174,7 +1174,7 @@ class init extends common
|
||||
'modulePosition' => '',
|
||||
'parentPageId' => '',
|
||||
'position' => 0,
|
||||
'group' => self::GROUP_VISITOR,
|
||||
'role' => self::GROUP_VISITOR,
|
||||
'profil' => 0,
|
||||
'targetBlank' => false,
|
||||
'title' => 'Maintenance en cours',
|
||||
@ -1203,7 +1203,7 @@ class init extends common
|
||||
'modulePosition' => 'bottom',
|
||||
'parentPageId' => '',
|
||||
'position' => 0,
|
||||
'group' => self::GROUP_VISITOR,
|
||||
'role' => self::GROUP_VISITOR,
|
||||
'profil' => 0,
|
||||
'targetBlank' => false,
|
||||
'title' => 'Erreur 403',
|
||||
@ -1231,7 +1231,7 @@ class init extends common
|
||||
'modulePosition' => 'bottom',
|
||||
'parentPageId' => '',
|
||||
'position' => 0,
|
||||
'group' => self::GROUP_VISITOR,
|
||||
'role' => self::GROUP_VISITOR,
|
||||
'profil' => 0,
|
||||
'targetBlank' => false,
|
||||
'title' => 'Erreur 404',
|
||||
@ -1259,7 +1259,7 @@ class init extends common
|
||||
'modulePosition' => 'bottom',
|
||||
'parentPageId' => '',
|
||||
'position' => 7,
|
||||
'group' => self::GROUP_VISITOR,
|
||||
'role' => self::GROUP_VISITOR,
|
||||
'profil' => 0,
|
||||
'targetBlank' => false,
|
||||
'title' => 'Recherche dans le site',
|
||||
@ -1427,7 +1427,7 @@ class init extends common
|
||||
'config' => [
|
||||
'button' => '',
|
||||
'captcha' => true,
|
||||
'group' => self::GROUP_ADMIN,
|
||||
'role' => self::GROUP_ADMIN,
|
||||
'pageId' => '',
|
||||
'subject' => ''
|
||||
],
|
||||
|
@ -261,9 +261,9 @@
|
||||
"Grande (220%)": "Grande (220%)",
|
||||
"Grande (300px)": "Grande (300px)",
|
||||
"Gras": "Bold",
|
||||
"Groupe": "Group",
|
||||
"Groupe associé": "Associated Group",
|
||||
"Groupe requis pour accéder à la page :": "Group required to access the page:",
|
||||
"Rôle": "Group",
|
||||
"Rôle associé": "Associated Group",
|
||||
"Rôle requis pour accéder à la page :": "Group required to access the page:",
|
||||
"Groupes": "Groups",
|
||||
"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",
|
||||
|
@ -261,9 +261,9 @@
|
||||
"Grande (220%)": "Grande (220%)",
|
||||
"Grande (300px)": "Grande (300px)",
|
||||
"Gras": "Negrita",
|
||||
"Groupe": "Grupo",
|
||||
"Groupe associé": "Grupo asociado",
|
||||
"Groupe requis pour accéder à la page :": "Grupo necesario para acceder a la página:",
|
||||
"Rôle": "Grupo",
|
||||
"Rôle associé": "Grupo asociado",
|
||||
"Rôle requis pour accéder à la page :": "Grupo necesario para acceder a la página:",
|
||||
"Groupes": "Grupos",
|
||||
"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",
|
||||
|
@ -261,9 +261,9 @@
|
||||
"Grande (220%)": "",
|
||||
"Grande (300px)": "",
|
||||
"Gras": "",
|
||||
"Groupe": "",
|
||||
"Groupe associé": "",
|
||||
"Groupe requis pour accéder à la page :": "",
|
||||
"Rôle": "",
|
||||
"Rôle associé": "",
|
||||
"Rôle requis pour accéder à la page :": "",
|
||||
"Groupes": "",
|
||||
"Générer sitemap.xml et robots.txt": "",
|
||||
"Générer une capture Open Graph": "",
|
||||
|
@ -178,7 +178,7 @@ class page extends common
|
||||
'parentPageId' => '',
|
||||
'modulePosition' => 'bottom',
|
||||
'position' => 0,
|
||||
'group' => self::GROUP_VISITOR,
|
||||
'role' => self::GROUP_VISITOR,
|
||||
'targetBlank' => false,
|
||||
'title' => $pageTitle,
|
||||
'shortTitle' => $pageTitle,
|
||||
@ -538,7 +538,7 @@ class page extends common
|
||||
'modulePosition' => $this->getInput('pageModulePosition'),
|
||||
'parentPageId' => $this->getInput('pageEditParentPageId'),
|
||||
'position' => $position,
|
||||
'group' => $group,
|
||||
'role' => $group,
|
||||
'profil' => $profil,
|
||||
'targetBlank' => $this->getInput('pageEditTargetBlank', helper::FILTER_BOOLEAN),
|
||||
'title' => $this->getInput('pageEditTitle', helper::FILTER_STRING_SHORT),
|
||||
|
@ -359,8 +359,8 @@
|
||||
<div class="row">
|
||||
<div class='col6'>
|
||||
<?php echo template::select('pageEditGroup', self::$groupPublics, [
|
||||
'label' => 'Groupe minimal pour accéder à la page',
|
||||
'selected' => $this->getData(['page', $this->getUrl(2), 'group']),
|
||||
'label' => 'Rôle minimal pour accéder à la page',
|
||||
'selected' => $this->getData(['page', $this->getUrl(2), 'role']),
|
||||
'help' => 'Les groupes de niveau supérieur accèdent à la page.'
|
||||
]); ?>
|
||||
</div>
|
||||
|
@ -29,7 +29,7 @@ class sitemap extends common
|
||||
$items = '<ul>';
|
||||
foreach ($this->getHierarchy(null, true, null) as $parentId => $childIds) {
|
||||
$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);
|
||||
$items .= '<a href="' . $pageUrl . '">' . $this->getData(['page', $parentId, 'title']) . '</a>';
|
||||
} else {
|
||||
@ -66,7 +66,7 @@ class sitemap extends common
|
||||
$items .= '<ul>';
|
||||
// Sous-page
|
||||
$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);
|
||||
$items .= '<a href="' . $pageUrl . '">' . $this->getData(['page', $childId, 'title']) . '</a>';
|
||||
} else {
|
||||
|
@ -122,7 +122,7 @@ class user extends common
|
||||
[
|
||||
'firstname' => $userFirstname,
|
||||
'forgot' => 0,
|
||||
'group' => $group,
|
||||
'role' => $group,
|
||||
'profil' => $profil,
|
||||
'lastname' => $userLastname,
|
||||
'pseudo' => $pseudo,
|
||||
@ -206,8 +206,8 @@ class user extends common
|
||||
$this->getUser('permission', __CLASS__, __FUNCTION__) !== true ||
|
||||
// L'utilisateur n'existe pas
|
||||
$this->getData(['user', $this->getUrl(2)]) === null
|
||||
// Groupe insuffisant
|
||||
and ($this->getUrl('group') < self::GROUP_EDITOR)
|
||||
// Role insuffisant
|
||||
and ($this->getUrl('role') < self::GROUP_EDITOR)
|
||||
) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
@ -254,10 +254,10 @@ class user extends common
|
||||
and (
|
||||
// Impossible de s'auto-éditer
|
||||
($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
|
||||
or ($this->getUrl('group') < self::GROUP_EDITOR)
|
||||
or ($this->getUrl('role') < self::GROUP_EDITOR)
|
||||
)
|
||||
) {
|
||||
// Valeurs en sortie
|
||||
@ -273,7 +273,7 @@ class user extends common
|
||||
) {
|
||||
$oldPassword = $this->getData(['user', $this->getUrl(2), 'password']);
|
||||
// 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')) {
|
||||
// L'ancien mot de passe est correct
|
||||
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
|
||||
if (
|
||||
$this->getUser('group') === self::GROUP_ADMIN
|
||||
$this->getUser('role') === self::GROUP_ADMIN
|
||||
and $this->getUrl(2) !== $this->getUser('id')
|
||||
) {
|
||||
$newGroup = $this->getInput('userEditGroup', helper::FILTER_INT, true);
|
||||
} else {
|
||||
$newGroup = $this->getData(['user', $this->getUrl(2), 'group']);
|
||||
$newGroup = $this->getData(['user', $this->getUrl(2), 'role']);
|
||||
}
|
||||
// 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);
|
||||
$newlastname = $this->getInput('userEditLastname', helper::FILTER_STRING_SHORT, true);
|
||||
} else {
|
||||
@ -335,7 +335,7 @@ class user extends common
|
||||
[
|
||||
'firstname' => $newfirstname,
|
||||
'forgot' => 0,
|
||||
'group' => $newGroup,
|
||||
'role' => $newGroup,
|
||||
'profil' => $profil,
|
||||
'lastname' => $newlastname,
|
||||
'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());
|
||||
}
|
||||
// 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';
|
||||
}
|
||||
// Redirection normale
|
||||
@ -470,7 +470,7 @@ class user extends common
|
||||
case "2":
|
||||
foreach ($groupValue as $profilId => $profilValue) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
@ -487,17 +487,17 @@ class user extends common
|
||||
$userIdsLastNames = helper::arrayColumn($this->getData(['user']), 'lastname');
|
||||
ksort($userIdsLastNames);
|
||||
foreach ($userIdsLastNames as $userId => $userLastNames) {
|
||||
if ($this->getData(['user', $userId, 'group'])) {
|
||||
if ($this->getData(['user', $userId, 'role'])) {
|
||||
|
||||
// Compte les rôles
|
||||
if (isset($profils[$this->getData(['user', $userId, 'group']) . $this->getData(['user', $userId, 'profil'])])) {
|
||||
$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, 'role']) . $this->getData(['user', $userId, 'profil'])]++;
|
||||
}
|
||||
|
||||
// Filtres
|
||||
if ($this->isPost()) {
|
||||
// Groupe et profils
|
||||
$group = (string) $this->getData(['user', $userId, 'group']);
|
||||
// Role et profils
|
||||
$group = (string) $this->getData(['user', $userId, 'role']);
|
||||
$profil = (string) $this->getData(['user', $userId, 'profil']);
|
||||
$firstName = $this->getData(['user', $userId, 'firstname']);
|
||||
$lastName = $this->getData(['user', $userId, 'lastname']);
|
||||
@ -526,10 +526,10 @@ class user extends common
|
||||
self::$users[] = [
|
||||
$userId,
|
||||
sprintf('%s %s',$userLastNames, $this->getData(['user', $userId, 'firstname'])),
|
||||
helper::translate(self::$groups[(int) $this->getData(['user', $userId, 'group'])]),
|
||||
empty($this->getData(['profil', $this->getData(['user', $userId, 'group']), $this->getData(['user', $userId, 'profil']), 'name']))
|
||||
? helper::translate(self::$groups[(int) $this->getData(['user', $userId, 'group'])])
|
||||
: $this->getData(['profil', $this->getData(['user', $userId, 'group']), $this->getData(['user', $userId, 'profil']), 'name']),
|
||||
helper::translate(self::$groups[(int) $this->getData(['user', $userId, 'role'])]),
|
||||
empty($this->getData(['profil', $this->getData(['user', $userId, 'role']), $this->getData(['user', $userId, 'profil']), 'name']))
|
||||
? helper::translate(self::$groups[(int) $this->getData(['user', $userId, 'role'])])
|
||||
: $this->getData(['profil', $this->getData(['user', $userId, 'role']), $this->getData(['user', $userId, 'profil']), 'name']),
|
||||
$this->getData(['user', $userId, 'tags']),
|
||||
template::button('userEdit' . $userId, [
|
||||
'href' => helper::baseUrl() . 'user/edit/' . $userId,
|
||||
@ -574,7 +574,7 @@ class user extends common
|
||||
|
||||
// Ne pas supprimer un profil utililsé
|
||||
// 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));
|
||||
$profilUsed = true;
|
||||
// Stoppe si le profil est affecté
|
||||
@ -939,7 +939,7 @@ class user extends common
|
||||
{
|
||||
// Ne pas supprimer un profil utililsé
|
||||
// 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));
|
||||
$flag = true;
|
||||
// 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()
|
||||
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 $this->getData(['user', $userId, 'group']) >= self::GROUP_MEMBER
|
||||
and $this->getData(['user', $userId, 'role']) >= self::GROUP_MEMBER
|
||||
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
|
||||
if (
|
||||
$this->getData(['config', 'maintenance'])
|
||||
and $this->getData(['user', $userId, 'group']) < self::GROUP_ADMIN
|
||||
and $this->getData(['user', $userId, 'role']) < self::GROUP_ADMIN
|
||||
) {
|
||||
$this->addOutput([
|
||||
'notification' => helper::translate('Seul un administrateur peut se connecter lors d\'une maintenance'),
|
||||
@ -1080,7 +1080,7 @@ class user extends common
|
||||
$authRedirect = '';
|
||||
if (
|
||||
$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é
|
||||
@ -1427,9 +1427,9 @@ class user extends common
|
||||
$item['nom'],
|
||||
$item['prenom'],
|
||||
self::$groups[$item['groupe']],
|
||||
empty($this->getData(['profil', $this->getData(['user', $userId, 'group']), $this->getData(['user', $userId, 'profil']), 'name']))
|
||||
? helper::translate(self::$groups[(int) $this->getData(['user', $userId, 'group'])])
|
||||
: $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, 'role'])])
|
||||
: $this->getData(['profil', $this->getData(['user', $userId, 'role']), $this->getData(['user', $userId, 'profil']), 'name']),
|
||||
$item['prenom'],
|
||||
helper::filter($item['email'], helper::FILTER_MAIL),
|
||||
$item['tags'],
|
||||
@ -1445,7 +1445,7 @@ class user extends common
|
||||
[
|
||||
'firstname' => $item['prenom'],
|
||||
'forgot' => 0,
|
||||
'group' => $item['groupe'],
|
||||
'role' => $item['groupe'],
|
||||
'profil' => $item['profil'],
|
||||
'lastname' => $item['nom'],
|
||||
'mail' => $item['email'],
|
||||
@ -1490,9 +1490,9 @@ class user extends common
|
||||
$item['nom'],
|
||||
$item['prenom'],
|
||||
self::$groups[$item['groupe']],
|
||||
empty($this->getData(['profil', $this->getData(['user', $userId, 'group']), $this->getData(['user', $userId, 'profil']), 'name']))
|
||||
? helper::translate(self::$groups[(int) $this->getData(['user', $userId, 'group'])])
|
||||
: $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, 'role'])])
|
||||
: $this->getData(['profil', $this->getData(['user', $userId, 'role']), $this->getData(['user', $userId, 'profil']), 'name']),
|
||||
$item['prenom'],
|
||||
$item['email'],
|
||||
$item['tags'],
|
||||
|
@ -105,7 +105,7 @@
|
||||
<div class="row">
|
||||
<div class="col6">
|
||||
<?php echo template::select('userAddGroup', self::$groupNews, [
|
||||
'label' => 'Groupe',
|
||||
'label' => 'Rôle',
|
||||
'selected' => self::GROUP_MEMBER
|
||||
]); ?>
|
||||
</div>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php echo template::formOpen('userEditForm'); ?>
|
||||
<div class="row">
|
||||
<div class="col1">
|
||||
<?php if ($this->getUser('group') === self::GROUP_ADMIN): ?>
|
||||
<?php if ($this->getUser('role') === self::GROUP_ADMIN): ?>
|
||||
<?php echo template::button('userEditBack', [
|
||||
'class' => 'buttonGrey',
|
||||
'href' => helper::baseUrl() . 'user',
|
||||
@ -29,7 +29,7 @@
|
||||
<div class="col6">
|
||||
<?php echo template::text('userEditFirstname', [
|
||||
'autocomplete' => 'off',
|
||||
'disabled' => $this->getUser('group') > self::GROUP_EDITOR ? false : true,
|
||||
'disabled' => $this->getUser('role') > self::GROUP_EDITOR ? false : true,
|
||||
'label' => 'Prénom',
|
||||
'value' => $this->getData(['user', $this->getUrl(2), 'firstname'])
|
||||
]); ?>
|
||||
@ -37,7 +37,7 @@
|
||||
<div class="col6">
|
||||
<?php echo template::text('userEditLastname', [
|
||||
'autocomplete' => 'off',
|
||||
'disabled' => $this->getUser('group') > self::GROUP_EDITOR ? false : true,
|
||||
'disabled' => $this->getUser('role') > self::GROUP_EDITOR ? false : true,
|
||||
'label' => 'Nom',
|
||||
'value' => $this->getData(['user', $this->getUrl(2), 'lastname'])
|
||||
]); ?>
|
||||
@ -77,7 +77,7 @@
|
||||
<div class="col12">
|
||||
<?php echo template::text('userEditTags', [
|
||||
'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']),
|
||||
'help' => 'Les étiquettes sont séparées par des espaces'
|
||||
]); ?>
|
||||
@ -99,7 +99,7 @@
|
||||
]); ?>
|
||||
<?php
|
||||
// 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', [
|
||||
'autocomplete' => 'new-password',
|
||||
// remplace 'off' pour éviter le pré remplissage auto
|
||||
@ -125,16 +125,16 @@
|
||||
</h4>
|
||||
<div class="row">
|
||||
<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, [
|
||||
'disabled' => ($this->getUrl(2) === $this->getUser('id')),
|
||||
'help' => ($this->getUrl(2) === $this->getUser('id') ? 'Impossible de modifier votre propre groupe.' : ''),
|
||||
'label' => 'Groupe',
|
||||
'selected' => $this->getData(['user', $this->getUrl(2), 'group']),
|
||||
'label' => 'Rôle',
|
||||
'selected' => $this->getData(['user', $this->getUrl(2), 'role']),
|
||||
]); ?>
|
||||
<?php else: ?>
|
||||
<?php echo template::hidden('userEditGroup', [
|
||||
'value' => $this->getData(['user', $this->getUrl(2), 'group'])
|
||||
'value' => $this->getData(['user', $this->getUrl(2), 'role'])
|
||||
]); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
@ -143,14 +143,14 @@
|
||||
<?php echo template::select('userEditProfil' . self::GROUP_MEMBER, user::$userProfils[self::GROUP_MEMBER], [
|
||||
'label' => '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 class="userEditGroupProfil" id="userEditGroupProfil<?php echo self::GROUP_EDITOR; ?>">
|
||||
<?php echo template::select('userEditProfil' . self::GROUP_EDITOR, user::$userProfils[self::GROUP_EDITOR], [
|
||||
'label' => '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>
|
||||
|
@ -61,7 +61,7 @@
|
||||
<?php if (user::$users): ?>
|
||||
<div class="row">
|
||||
<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('mail'); ?> Compte créé et notifié |
|
||||
<?php echo template::ico('cancel'); ?> Erreur dans le fichier ou le compte existe.
|
||||
|
@ -60,4 +60,4 @@
|
||||
</div>
|
||||
</div>
|
||||
<?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']); ?>
|
@ -28,7 +28,7 @@
|
||||
</div>
|
||||
<div class="col12">
|
||||
<?php echo template::select('profilAddGroup', user::$groupProfils, [
|
||||
'label' => 'Groupe associé',
|
||||
'label' => 'Rôle associé',
|
||||
'selected' => $this->getUrl(2)
|
||||
]); ?>
|
||||
</div>
|
||||
|
@ -40,7 +40,7 @@
|
||||
</div>
|
||||
<div class="col12">
|
||||
<?php echo template::text('profilEditDisplayGroup', [
|
||||
'label' => 'Groupe associé',
|
||||
'label' => 'Rôle associé',
|
||||
'value' => helper::translate(self::$groups[$this->getUrl(2)]),
|
||||
'disabled' => true
|
||||
]); ?>
|
||||
|
2
core/vendor/filemanager/config/config.php
vendored
2
core/vendor/filemanager/config/config.php
vendored
@ -24,7 +24,7 @@ $g = json_decode(file_get_contents('../../../site/data/profil.json'), true);
|
||||
|
||||
// Lecture les droits
|
||||
if (!is_null($u) && !is_null($g) && !is_null($userId)) {
|
||||
$group = $u['user'][$userId]['group'];
|
||||
$group = $u['user'][$userId]['role'];
|
||||
switch ($group) {
|
||||
case 3:
|
||||
// Accès admin
|
||||
|
@ -23,7 +23,7 @@ class blog extends common
|
||||
const DATADIRECTORY = ''; // Contenu localisé inclus par défaut (page.json et module.json)
|
||||
|
||||
const EDIT_OWNER = 'owner';
|
||||
const EDIT_GROUP = 'group';
|
||||
const EDIT_GROUP = 'role';
|
||||
const EDIT_ALL = 'all';
|
||||
|
||||
public static $actions = [
|
||||
@ -112,7 +112,7 @@ class blog extends common
|
||||
// Permissions d'un article
|
||||
public static $articleConsent = [
|
||||
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'
|
||||
];
|
||||
|
||||
@ -259,7 +259,7 @@ class blog extends common
|
||||
$this->isPost()
|
||||
) {
|
||||
// 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);
|
||||
} else {
|
||||
$newuserid = $this->getUser('id');
|
||||
@ -284,7 +284,7 @@ class blog extends common
|
||||
'state' => $this->getInput('blogAddState', helper::FILTER_BOOLEAN),
|
||||
'title' => $this->getInput('blogAddTitle', helper::FILTER_STRING_SHORT, true),
|
||||
'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'),
|
||||
'commentApproved' => $this->getInput('blogAddCommentApproved', helper::FILTER_BOOLEAN),
|
||||
'commentClose' => $this->getInput('blogAddCommentClose', helper::FILTER_BOOLEAN),
|
||||
@ -493,13 +493,13 @@ class blog extends common
|
||||
( // Propriétaire
|
||||
$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')
|
||||
or $this->getUser('group') === self::GROUP_ADMIN)
|
||||
or $this->getUser('role') === self::GROUP_ADMIN)
|
||||
)
|
||||
|
||||
or (
|
||||
// Groupe
|
||||
// Role
|
||||
$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 (
|
||||
// Tout le monde
|
||||
@ -655,7 +655,7 @@ class blog extends common
|
||||
$this->getUser('permission', __CLASS__, __FUNCTION__) === true &&
|
||||
$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);
|
||||
} else {
|
||||
$newuserid = $this->getUser('id');
|
||||
@ -683,7 +683,7 @@ class blog extends common
|
||||
'publishedOn' => $this->getInput('blogEditPublishedOn', helper::FILTER_DATETIME, true),
|
||||
'state' => $this->getInput('blogEditState', helper::FILTER_BOOLEAN),
|
||||
'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'),
|
||||
'commentApproved' => $this->getInput('blogEditCommentApproved', helper::FILTER_BOOLEAN),
|
||||
'commentClose' => $this->getInput('blogEditCommentClose', helper::FILTER_BOOLEAN),
|
||||
@ -707,10 +707,10 @@ class blog extends common
|
||||
ksort(self::$users);
|
||||
foreach (self::$users as $userId => &$userFirstname) {
|
||||
// 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]);
|
||||
}
|
||||
$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);
|
||||
// Valeurs en sortie
|
||||
@ -783,7 +783,7 @@ class blog extends common
|
||||
$to = [];
|
||||
// Liste des destinataires
|
||||
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'];
|
||||
$firstname[] = $user['firstname'];
|
||||
$lastname[] = $user['lastname'];
|
||||
|
@ -27,7 +27,7 @@
|
||||
"Commentaires supprimés": "Gelöschte Kommentare",
|
||||
"Fermer les commentaires": "Schalten Sie die Kommentare aus",
|
||||
"Gestion des commentaires": "Kommentarmanagement",
|
||||
"Groupe du propriétaire": "Besitzergruppe",
|
||||
"Rôle du propriétaire": "Besitzergruppe",
|
||||
"Image de couverture": "Berichterstattung",
|
||||
"Informations générales": "Allgemeine Informationen",
|
||||
"Lien du flux RSS": "Lien du flux RSS",
|
||||
|
@ -27,7 +27,7 @@
|
||||
"Commentaires supprimés": "Deleted comments",
|
||||
"Fermer les commentaires": "Turn off the comments",
|
||||
"Gestion des commentaires": "Comment management",
|
||||
"Groupe du propriétaire": "Owner's group",
|
||||
"Rôle du propriétaire": "Owner's group",
|
||||
"Image de couverture": "Coverage",
|
||||
"Informations générales": "General informations",
|
||||
"Lien du flux RSS": "Lien du Flux RSS",
|
||||
|
@ -27,7 +27,7 @@
|
||||
"Commentaires supprimés": "Comentarios eliminados",
|
||||
"Fermer les commentaires": "Cerrar los 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",
|
||||
"Informations générales": "Información general",
|
||||
"Lien du flux RSS": "Enlace de fuente RSS",
|
||||
|
@ -27,7 +27,7 @@
|
||||
"Commentaires supprimés": "",
|
||||
"Fermer les commentaires": "",
|
||||
"Gestion des commentaires": "",
|
||||
"Groupe du propriétaire": "",
|
||||
"Rôle du propriétaire": "",
|
||||
"Image de couverture": "",
|
||||
"Informations générales": "",
|
||||
"Lien du flux RSS": "",
|
||||
|
@ -27,7 +27,7 @@
|
||||
"Commentaires supprimés": "Σχόλια διαγράφονται",
|
||||
"Fermer les commentaires": "Κλείσιμο σχολίων",
|
||||
"Gestion des commentaires": "Διαχείριση σχολίων",
|
||||
"Groupe du propriétaire": "Ομάδα ιδιοκτήτη",
|
||||
"Rôle du propriétaire": "Ομάδα ιδιοκτήτη",
|
||||
"Image de couverture": "εικόνα εξωφύλλου",
|
||||
"Informations générales": "Γενικές πληροφορίες",
|
||||
"Lien du flux RSS": "Σύνδεσμος τροφοδοσίας RSS",
|
||||
|
@ -27,7 +27,7 @@
|
||||
"Commentaires supprimés": "Commenti cancellati",
|
||||
"Fermer les commentaires": "Disattiva i 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",
|
||||
"Informations générales": "Informazioni generali",
|
||||
"Lien du flux RSS": "Lien Du Flux RSS",
|
||||
|
@ -27,7 +27,7 @@
|
||||
"Commentaires supprimés": "Comentários excluídos",
|
||||
"Fermer les commentaires": "Desligue os 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",
|
||||
"Informations générales": "Informações gerais",
|
||||
"Lien du flux RSS": "Lien du Flux RSS",
|
||||
|
@ -27,7 +27,7 @@
|
||||
"Commentaires supprimés": "Silinen yorumlar",
|
||||
"Fermer les commentaires": "Yorumları kapat",
|
||||
"Gestion des commentaires": "Yorum yönetimi",
|
||||
"Groupe du propriétaire": "Sahip grubu",
|
||||
"Rôle du propriétaire": "Sahip grubu",
|
||||
"Image de couverture": "Kapak resmi",
|
||||
"Informations générales": "Genel bilgiler",
|
||||
"Lien du flux RSS": "RSS dağıtım bağlantısı",
|
||||
|
@ -82,7 +82,7 @@
|
||||
<?php echo template::select('blogAddUserId', blog::$users, [
|
||||
'label' => 'Auteur',
|
||||
'selected' => $this->getUser('id'),
|
||||
'disabled' => $this->getUser('group') !== self::GROUP_ADMIN ? true : false
|
||||
'disabled' => $this->getUser('role') !== self::GROUP_ADMIN ? true : false
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
|
@ -52,18 +52,18 @@
|
||||
( // Propriétaire
|
||||
($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')
|
||||
or $this->getUser('group') === self::GROUP_ADMIN)
|
||||
or $this->getUser('role') === self::GROUP_ADMIN)
|
||||
)
|
||||
or (
|
||||
// Groupe
|
||||
// Role
|
||||
($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)
|
||||
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 (
|
||||
// Tout le monde
|
||||
$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']
|
||||
)
|
||||
)
|
||||
): ?>
|
||||
|
@ -89,7 +89,7 @@
|
||||
<?php echo template::select('blogEditUserId', blog::$users, [
|
||||
'label' => 'Auteur',
|
||||
'selected' => $this->getUser('id'),
|
||||
'disabled' => $this->getUser('group') !== self::GROUP_ADMIN ? true : false
|
||||
'disabled' => $this->getUser('role') !== self::GROUP_ADMIN ? true : false
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
|
@ -77,18 +77,18 @@
|
||||
( // Propriétaire
|
||||
($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')
|
||||
or $this->getUser('group') === self::GROUP_ADMIN)
|
||||
or $this->getUser('role') === self::GROUP_ADMIN)
|
||||
)
|
||||
or (
|
||||
// Groupe
|
||||
// Role
|
||||
($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)
|
||||
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 (
|
||||
// Tout le monde
|
||||
$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']
|
||||
)
|
||||
)
|
||||
): ?>
|
||||
|
@ -185,7 +185,7 @@ class form extends common
|
||||
[
|
||||
'button' => $this->getInput('formOptionButton'),
|
||||
'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)],
|
||||
'mail' => $this->getInput('formOptionMail'),
|
||||
'pageId' => $this->getInput('formOptionPageIdToggle', helper::FILTER_BOOLEAN) === true ? $this->getInput('formOptionPageId', helper::FILTER_ID) : '',
|
||||
@ -454,7 +454,7 @@ class form extends common
|
||||
'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é
|
||||
if (
|
||||
self::$inputNotices === [] && (
|
||||
@ -466,7 +466,7 @@ class form extends common
|
||||
$to = [];
|
||||
if ($group > 0) {
|
||||
foreach ($this->getData(['user']) as $userId => $user) {
|
||||
if ($user['group'] >= $group) {
|
||||
if ($user['role'] >= $group) {
|
||||
$to[] = $user['mail'];
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,7 @@ class init extends form {
|
||||
public static $defaultData = [
|
||||
'button'=> '',
|
||||
'captcha'=> false,
|
||||
'group'=> 0,
|
||||
'role'=> 0,
|
||||
'user'=> '',
|
||||
'mail'=> '',
|
||||
'pageId'=> '',
|
||||
|
@ -80,7 +80,7 @@
|
||||
<div class="block">
|
||||
<h4><?php echo helper::translate('Courriel'); ?></h4>
|
||||
<?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', '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">
|
||||
<?php echo template::select('formOptionGroup', $groupMembers, [
|
||||
'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 class="col4">
|
||||
|
@ -42,7 +42,7 @@
|
||||
$this->isConnected() === true
|
||||
and
|
||||
( // 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); ?>">
|
||||
|
@ -52,7 +52,7 @@
|
||||
$this->isConnected() === true
|
||||
and
|
||||
( // 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; ?>">
|
||||
|
@ -59,7 +59,7 @@ class redirection extends common
|
||||
// Message si l'utilisateur peut éditer la page
|
||||
if (
|
||||
$this->isConnected() === true
|
||||
&& $this->getUser('group') >= self::GROUP_EDITOR
|
||||
&& $this->getUser('role') >= self::GROUP_EDITOR
|
||||
&& $this->getUrl(1) !== 'force'
|
||||
) {
|
||||
// Valeurs en sortie
|
||||
|
@ -208,7 +208,7 @@ class search extends common
|
||||
foreach ($this->getHierarchy(null, false, null) as $parentId => $childIds) {
|
||||
if (
|
||||
$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'
|
||||
) {
|
||||
$url = $parentId;
|
||||
@ -227,7 +227,7 @@ class search extends common
|
||||
// Sous page
|
||||
if (
|
||||
$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'
|
||||
) {
|
||||
$url = $childId;
|
||||
|
Loading…
x
Reference in New Issue
Block a user