Revert "1.21 renomme group en role"
This reverts commit 07e390d818e63f873af1d5b154dd316609c8a269.
This commit is contained in:
parent
eceed6b233
commit
90fee81365
@ -353,7 +353,7 @@ class layout extends common
|
||||
}
|
||||
// Affichage de la barre de membre simple
|
||||
if (
|
||||
$this->getUser('role') >= self::GROUP_MEMBER && $this->getUser('role') < self::GROUP_ADMIN
|
||||
$this->getUser('group') >= self::GROUP_MEMBER && $this->getUser('group') < self::GROUP_ADMIN
|
||||
&& $this->getData(['theme', 'footer', 'memberBar']) === true
|
||||
) {
|
||||
$items .= '<span id="footerDisplayMemberAccount"';
|
||||
@ -508,7 +508,7 @@ class layout extends common
|
||||
* Affichage du sélecteur d'espaces
|
||||
*/
|
||||
if (
|
||||
$this->getUser('role') === self::GROUP_MEMBER
|
||||
$this->getUser('group') === self::GROUP_MEMBER
|
||||
&& $this->getData(['theme', 'menu', 'selectSpace']) === true
|
||||
) {
|
||||
if ($this->getCoursesByProfil()) {
|
||||
@ -532,7 +532,7 @@ class layout extends common
|
||||
&& $this->getData(['course', self::$siteContent, 'enrolment']) >= 1
|
||||
) {
|
||||
$href = '';
|
||||
switch ($this->getUser('role')) {
|
||||
switch ($this->getUser('group')) {
|
||||
case self::GROUP_MEMBER:
|
||||
$href = helper::baseUrl() . 'course/userReport/' . self::$siteContent . '/' . $this->getUser('id');
|
||||
break;
|
||||
@ -565,7 +565,7 @@ class layout extends common
|
||||
* Affichage des boutons gestionnaire de fichiers et mon compte
|
||||
*/
|
||||
if (
|
||||
$this->getUser('role') === self::GROUP_MEMBER
|
||||
$this->getUser('group') === self::GROUP_MEMBER
|
||||
&& $this->getData(['theme', 'menu', 'memberBar']) === true
|
||||
) {
|
||||
|
||||
@ -648,7 +648,7 @@ class layout extends common
|
||||
and $this->isConnected() === false
|
||||
) or ($this->getData(['page', $parentPageId, 'disable']) === true
|
||||
and $this->isConnected() === true
|
||||
and $this->getUser('role') < self::GROUP_EDITOR
|
||||
and $this->getUser('group') < self::GROUP_EDITOR
|
||||
)
|
||||
) {
|
||||
$pageUrl = ($this->getData(['config', 'homePageId']) === $this->getUrl(0)) ? helper::baseUrl(false) : helper::baseUrl() . $this->getUrl(0);
|
||||
@ -714,7 +714,7 @@ class layout extends common
|
||||
and $this->isConnected() === false
|
||||
) or ($this->getData(['page', $childKey, 'disable']) === true
|
||||
and $this->isConnected() === true
|
||||
and $this->getUser('role') < self::GROUP_EDITOR
|
||||
and $this->getUser('group') < self::GROUP_EDITOR
|
||||
)
|
||||
) {
|
||||
$pageUrl = ($this->getData(['config', 'homePageId']) === $this->getUrl(0)) ? helper::baseUrl(false) : helper::baseUrl() . $this->getUrl(0);
|
||||
@ -975,7 +975,7 @@ class layout extends common
|
||||
* Les admins voient tous les contenus
|
||||
* Les enseignants les contenus dont ils sont auteurs
|
||||
*/
|
||||
if ($this->getUser('role') >= self::GROUP_EDITOR) {
|
||||
if ($this->getUser('group') >= self::GROUP_EDITOR) {
|
||||
if (is_array($this->getCoursesByProfil())) {
|
||||
$leftItems .= '<li><select id="barSelectCourse" >';
|
||||
$leftItems .= '<option name="' . helper::translate('Accueil') . '" value="' . helper::baseUrl(true) . 'course/swap/home" ' . ('home' === self::$siteContent ? 'selected' : '') . '>' . helper::translate('Accueil') . '</option>';
|
||||
@ -990,7 +990,7 @@ class layout extends common
|
||||
'help' => 'Gérer les espaces'
|
||||
]) . '</li>';
|
||||
}
|
||||
if ($this->getUser('role') >= self::GROUP_ADMIN) {
|
||||
if ($this->getUser('group') >= self::GROUP_ADMIN) {
|
||||
$leftItems .= '<li>' . template::ico('brush', [
|
||||
'help' => 'Thème',
|
||||
'href' => helper::baseUrl() . 'theme'
|
||||
@ -998,8 +998,8 @@ class layout extends common
|
||||
}
|
||||
// Liste des pages et bouton de gestion interdit pour l'accueil sauf admin
|
||||
if (
|
||||
($this->getUser('role') === self::GROUP_EDITOR && self::$siteContent != 'home')
|
||||
|| $this->getUser('role') === self::GROUP_ADMIN
|
||||
($this->getUser('group') === self::GROUP_EDITOR && self::$siteContent != 'home')
|
||||
|| $this->getUser('group') === self::GROUP_ADMIN
|
||||
) {
|
||||
$leftItems .= '<li><select id="barSelectPage">';
|
||||
$leftItems .= '<option value="">' . helper::translate('Pages du site') . '</option>';
|
||||
@ -1122,11 +1122,11 @@ class layout extends common
|
||||
$rightItems = '';
|
||||
if (
|
||||
(
|
||||
$this->getUser('role') === self::GROUP_EDITOR
|
||||
$this->getUser('group') === self::GROUP_EDITOR
|
||||
&& $this->getUser('permission', 'filemanager') === true
|
||||
&& $this->getUser('permission', 'folder', (self::$siteContent === 'home' ? 'homePath' : 'coursePath')) !== 'none'
|
||||
)
|
||||
|| $this->getUser('role') === self::GROUP_ADMIN
|
||||
|| $this->getUser('group') === self::GROUP_ADMIN
|
||||
) {
|
||||
$folder = '&fldr=/' . (self::$siteContent === 'home' ? '' : self::$siteContent);
|
||||
$rightItems .= '<li>' . template::ico('folder', [
|
||||
@ -1137,7 +1137,7 @@ class layout extends common
|
||||
}
|
||||
if (
|
||||
self::$siteContent === 'home'
|
||||
&& $this->getUser('role') >= self::GROUP_ADMIN
|
||||
&& $this->getUser('group') >= self::GROUP_ADMIN
|
||||
) {
|
||||
$rightItems .= '<li>' . template::ico('flag', [
|
||||
'help' => 'Langues',
|
||||
@ -1209,9 +1209,9 @@ class layout extends common
|
||||
'href' => helper::baseUrl() . 'plugin'
|
||||
]) . '</li>';
|
||||
}
|
||||
// Boutons depuis le role éditeur
|
||||
// Boutons depuis le groupe éditeur
|
||||
if (
|
||||
$this->getUser('role') >= self::GROUP_EDITOR
|
||||
$this->getUser('group') >= self::GROUP_EDITOR
|
||||
&& $this->getUser('permission', 'user', 'edit')
|
||||
|
||||
) {
|
||||
@ -1297,7 +1297,7 @@ class layout extends common
|
||||
$vars .= 'var baseUrlQs = ' . json_encode(helper::baseUrl()) . ';';
|
||||
if (
|
||||
$this->isConnected() === true
|
||||
and $this->getUser('role') >= self::GROUP_EDITOR
|
||||
and $this->getUser('group') >= self::GROUP_EDITOR
|
||||
) {
|
||||
$vars .= 'var privateKey = ' . json_encode(md5_file(self::DATA_DIR . 'core.json')) . ';';
|
||||
}
|
||||
|
@ -446,7 +446,7 @@ class core extends common
|
||||
&& $this->getData(['course', self::$siteContent, 'enrolment']) > 0
|
||||
// Le userId n'est pas celui d'un admis ni le compte d'un gestionnaire de cet espace
|
||||
&& (
|
||||
$this->getUser('role') < common::GROUP_ADMIN
|
||||
$this->getUser('group') < common::GROUP_ADMIN
|
||||
|| $this->getUser('id') !== $this->getData(['course', common::$siteContent, 'author'])
|
||||
)
|
||||
) {
|
||||
@ -473,7 +473,7 @@ class core extends common
|
||||
// Force la déconnexion des membres bannis ou d'une seconde session
|
||||
if (
|
||||
$this->isConnected() === true
|
||||
and ($this->getUser('role') === common::GROUP_BANNED
|
||||
and ($this->getUser('group') === common::GROUP_BANNED
|
||||
or ($_SESSION['csrf'] !== $this->getData(['user', $this->getUser('id'), 'accessCsrf'])
|
||||
and $this->getData(['config', 'connect', 'autoDisconnect']) === true)
|
||||
)
|
||||
@ -488,7 +488,7 @@ class core extends common
|
||||
and $this->getUrl(1) !== 'login'
|
||||
and ($this->isConnected() === false
|
||||
or ($this->isConnected() === true
|
||||
and $this->getUser('role') < common::GROUP_ADMIN
|
||||
and $this->getUser('group') < common::GROUP_ADMIN
|
||||
)
|
||||
)
|
||||
) {
|
||||
@ -505,11 +505,11 @@ class core extends common
|
||||
$access = null;
|
||||
if ($this->getData(['page', $this->getUrl(0)]) !== null) {
|
||||
if (
|
||||
$this->getData(['page', $this->getUrl(0), 'role']) === common::GROUP_VISITOR
|
||||
$this->getData(['page', $this->getUrl(0), 'group']) === common::GROUP_VISITOR
|
||||
or ($this->isConnected() === true
|
||||
// and $this->getUser('role') >= $this->getData(['page', $this->getUrl(0), 'role'])
|
||||
// and $this->getUser('group') >= $this->getData(['page', $this->getUrl(0), 'group'])
|
||||
// Modification qui tient compte du profil de la page
|
||||
and ($this->getUser('role') * 10 + $this->getUser('profil')) >= ($this->getData(['page', $this->getUrl(0), 'role']) * 10 + $this->getData(['page', $this->getUrl(0), 'profil']))
|
||||
and ($this->getUser('group') * 10 + $this->getUser('profil')) >= ($this->getData(['page', $this->getUrl(0), 'group']) * 10 + $this->getData(['page', $this->getUrl(0), 'profil']))
|
||||
)
|
||||
) {
|
||||
$access = true;
|
||||
@ -526,7 +526,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('role') < common::GROUP_EDITOR
|
||||
and $this->getUser('group') < common::GROUP_EDITOR
|
||||
)
|
||||
) {
|
||||
$access = false;
|
||||
@ -567,10 +567,7 @@ class core extends common
|
||||
*/
|
||||
$accessInfo['userName'] = '';
|
||||
$accessInfo['pageId'] = '';
|
||||
if (
|
||||
is_array($this->getData(['user']))
|
||||
&& empty($this->getData(['user'])) === false
|
||||
) {
|
||||
if ($this->getData(['user'])) {
|
||||
foreach ($this->getData(['user']) as $userId => $userIds) {
|
||||
if (!is_null($this->getData(['user', $userId, 'accessUrl']))) {
|
||||
$t = explode('/', $this->getData(['user', $userId, 'accessUrl']));
|
||||
@ -708,11 +705,11 @@ class core extends common
|
||||
if (array_key_exists($action, $module::$actions)) {
|
||||
$module->$action();
|
||||
$output = $module->output;
|
||||
// Check le role de l'utilisateur
|
||||
// Check le groupe de l'utilisateur
|
||||
if (
|
||||
($module::$actions[$action] === common::GROUP_VISITOR
|
||||
or ($this->isConnected() === true
|
||||
and $this->getUser('role') >= $module::$actions[$action]
|
||||
and $this->getUser('group') >= $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;
|
||||
// Role MODERATOR, compatibilité avec les anciens modules :
|
||||
// Groupe MODERATOR, compatibilité avec les anciens modules :
|
||||
const GROUP_MODERATOR = 2;
|
||||
const GROUP_ADMIN = 3;
|
||||
const SIGNATURE_ID = 1;
|
||||
@ -821,11 +821,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, 'role']) === self::GROUP_VISITOR
|
||||
and ($this->getData(['page', $pageId, 'group']) === self::GROUP_VISITOR
|
||||
or ($this->getUser('authKey') === $this->getInput('ZWII_AUTH_KEY')
|
||||
//and $this->getUser('role') >= $this->getData(['page', $pageId, 'role'])
|
||||
//and $this->getUser('group') >= $this->getData(['page', $pageId, 'group'])
|
||||
// Modification qui tient compte du profil de la page
|
||||
and ($this->getUser('role') * self::MAX_PROFILS + $this->getUser('profil')) >= ($this->getData(['page', $pageId, 'role']) * self::MAX_PROFILS + $this->getData(['page', $pageId, 'profil']))
|
||||
and ($this->getUser('group') * self::MAX_PROFILS + $this->getUser('profil')) >= ($this->getData(['page', $pageId, 'group']) * self::MAX_PROFILS + $this->getData(['page', $pageId, 'profil']))
|
||||
|
||||
)
|
||||
)
|
||||
@ -848,14 +848,14 @@ class common
|
||||
// Ignore les pages dont l'utilisateur n'a pas accès
|
||||
and (
|
||||
(
|
||||
$this->getData(['page', $pageId, 'role']) === self::GROUP_VISITOR
|
||||
$this->getData(['page', $pageId, 'group']) === self::GROUP_VISITOR
|
||||
and
|
||||
$this->getData(['page', $parentId, 'role']) === self::GROUP_VISITOR
|
||||
$this->getData(['page', $parentId, 'group']) === self::GROUP_VISITOR
|
||||
)
|
||||
or (
|
||||
$this->getUser('authKey') === $this->getInput('ZWII_AUTH_KEY')
|
||||
and
|
||||
$this->getUser('role') * self::MAX_PROFILS + $this->getUser('profil')) >= ($this->getData(['page', $pageId, 'role']) * self::MAX_PROFILS + $this->getData(['page', $pageId, 'profil'])
|
||||
$this->getUser('group') * self::MAX_PROFILS + $this->getUser('profil')) >= ($this->getData(['page', $pageId, 'group']) * self::MAX_PROFILS + $this->getData(['page', $pageId, 'profil'])
|
||||
|
||||
)
|
||||
)
|
||||
@ -1042,39 +1042,39 @@ class common
|
||||
|
||||
/**
|
||||
* Retourne les permissions de l'utilisateur connecté
|
||||
* @param int $key Clé de la valeur du role
|
||||
* @param int $key Clé de la valeur du groupe
|
||||
* @return string|null
|
||||
*/
|
||||
public function getPermission($key1, $key2 = null)
|
||||
{
|
||||
// Administrateur, toutes les permissions
|
||||
if ($this->getUser('role') === self::GROUP_ADMIN) {
|
||||
if ($this->getUser('group') === self::GROUP_ADMIN) {
|
||||
return true;
|
||||
} elseif ($this->getUser('role') <= self::GROUP_VISITOR) { // Role sans autorisation
|
||||
} elseif ($this->getUser('group') <= self::GROUP_VISITOR) { // Groupe sans autorisation
|
||||
return false;
|
||||
} elseif (
|
||||
// Role avec profil, consultation des autorisations sur deux clés
|
||||
// Groupe avec profil, consultation des autorisations sur deux clés
|
||||
$key1
|
||||
&& $key2
|
||||
&& $this->user
|
||||
&& $this->getData(['profil', $this->user['role'], $this->user['profil'], $key1])
|
||||
&& array_key_exists($key2, $this->getData(['profil', $this->user['role'], $this->user['profil'], $key1]))
|
||||
&& $this->getData(['profil', $this->user['group'], $this->user['profil'], $key1])
|
||||
&& array_key_exists($key2, $this->getData(['profil', $this->user['group'], $this->user['profil'], $key1]))
|
||||
) {
|
||||
return $this->getData(['profil', $this->user['role'], $this->user['profil'], $key1, $key2]);
|
||||
// Role avec profil, consultation des autorisations sur une seule clé
|
||||
return $this->getData(['profil', $this->user['group'], $this->user['profil'], $key1, $key2]);
|
||||
// Groupe avec profil, consultation des autorisations sur une seule clé
|
||||
} elseif (
|
||||
$key1
|
||||
&& $this->user
|
||||
&& $this->getData(['profil', $this->user['role'], $this->user['profil']])
|
||||
&& array_key_exists($key1, $this->getData(['profil', $this->user['role'], $this->user['profil']]))
|
||||
&& $this->getData(['profil', $this->user['group'], $this->user['profil']])
|
||||
&& array_key_exists($key1, $this->getData(['profil', $this->user['group'], $this->user['profil']]))
|
||||
) {
|
||||
return $this->getData(['profil', $this->user['role'], $this->user['profil'], $key1]);
|
||||
return $this->getData(['profil', $this->user['group'], $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('role') >= $module::$actions[$key2];
|
||||
return $this->getUser('group') >= $module::$actions[$key2];
|
||||
}
|
||||
}
|
||||
return false;
|
||||
@ -1169,7 +1169,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, 'role']) !== 0 ||
|
||||
$this->getData(['page', $parentPageId, 'group']) !== 0 ||
|
||||
$this->getData(['page', $parentPageId, 'block']) === 'bar'
|
||||
) {
|
||||
continue;
|
||||
@ -1197,7 +1197,7 @@ class common
|
||||
}
|
||||
// Sous-pages
|
||||
foreach ($childrenPageIds as $childKey) {
|
||||
if ($this->getData(['page', $childKey, 'role']) !== 0 || $this->getData(['page', $childKey, 'disable']) === true) {
|
||||
if ($this->getData(['page', $childKey, 'group']) !== 0 || $this->getData(['page', $childKey, 'disable']) === true) {
|
||||
continue;
|
||||
}
|
||||
// Cas de la page d'accueil ne pas dupliquer l'URL
|
||||
@ -1624,7 +1624,7 @@ function makeThumb($src, $dest, $desired_width)
|
||||
$courses = $this->getData([('course')]);
|
||||
$courses = helper::arraycolumn($courses, 'title', 'SORT_ASC');
|
||||
$filter = array();
|
||||
switch ($this->getUser('role')) {
|
||||
switch ($this->getUser('group')) {
|
||||
case self::GROUP_ADMIN:
|
||||
// Affiche tout
|
||||
return $courses;
|
||||
|
@ -9,13 +9,13 @@ if (
|
||||
$this->getData(['core', 'dataVersion']) < 1700
|
||||
) {
|
||||
// Supprime la variable path des profils, seul l'accès à l'espace et autorisé.
|
||||
foreach (['1', '2'] as $role) {
|
||||
foreach (array_keys($this->getData(['profil', $role])) as $profil) {
|
||||
if (is_null($this->getData(['profil', $role, $profil, 'folder', 'path'])) === false) {
|
||||
$path = $this->getData(['profil', $role, $profil, 'folder', 'path']);
|
||||
$this->setData(['profil', $role, $profil, 'folder', 'homePath', $path]);
|
||||
$this->setData(['profil', $role, $profil, 'folder', 'coursePath', $path]);
|
||||
$this->deleteData(['profil', $role, $profil, 'folder', 'path']);
|
||||
foreach (['1', '2'] as $group) {
|
||||
foreach (array_keys($this->getData(['profil', $group])) as $profil) {
|
||||
if (is_null($this->getData(['profil', $group, $profil, 'folder', 'path'])) === false) {
|
||||
$path = $this->getData(['profil', $group, $profil, 'folder', 'path']);
|
||||
$this->setData(['profil', $group, $profil, 'folder', 'homePath', $path]);
|
||||
$this->setData(['profil', $group, $profil, 'folder', 'coursePath', $path]);
|
||||
$this->deleteData(['profil', $group, $profil, 'folder', 'path']);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -58,15 +58,14 @@ if (
|
||||
'theme' =>
|
||||
['menu' => [
|
||||
'hidePages' => false
|
||||
]]
|
||||
];
|
||||
]]];
|
||||
// Parcourir la structure pour écrire dans les fichiers JSON
|
||||
foreach ($this->getData(['course']) as $courseId => $courseValues) {
|
||||
$d = json_decode(file_get_contents(self::DATA_DIR . $courseId . '/theme.json'), true);
|
||||
// Insérer la variable hidePages si elle n'existe pas
|
||||
if (isset($d['theme']['menu']['hidePages']) === false) {
|
||||
$result = array_replace_recursive($d, $a);
|
||||
file_put_contents(self::DATA_DIR . $courseId . '/theme.json', json_encode($result, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES));
|
||||
$result = array_replace_recursive($d, $a);
|
||||
file_put_contents(self::DATA_DIR . $courseId . '/theme.json', json_encode($result,JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES));
|
||||
}
|
||||
// Forcer la régénération du fichier theme.css
|
||||
if (file_exists(self::DATA_DIR . $courseId . '/theme.css')) {
|
||||
@ -75,30 +74,3 @@ if (
|
||||
}
|
||||
$this->setData(['core', 'dataVersion', 12002]);
|
||||
}
|
||||
|
||||
if (
|
||||
$this->getData(['core', 'dataVersion']) < 12100
|
||||
) {
|
||||
// Renommer Group en Role
|
||||
if (
|
||||
is_array($this->getData(['user']))
|
||||
&& empty($this->getData(['user'])) === false
|
||||
) {
|
||||
$t = $this->getData(['user']);
|
||||
foreach ($t 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');
|
||||
//$this->setData(['core', 'dataVersion', 12100]);
|
||||
}
|
||||
|
@ -35,7 +35,7 @@
|
||||
</head>
|
||||
<body>
|
||||
<!-- Barre d'administration -->
|
||||
<?php if ($this->getUser('role') > self::GROUP_MEMBER) : ?>
|
||||
<?php if ($this->getUser('group') > self::GROUP_MEMBER) : ?>
|
||||
<?php $layout->showBar(); ?>
|
||||
<?php endif; ?>
|
||||
<!-- Notifications -->
|
||||
@ -48,7 +48,7 @@
|
||||
$this->getData(['theme', 'menu', 'position']) === 'top'
|
||||
and $this->getData(['theme', 'menu', 'fixed']) === true
|
||||
and $this->isConnected() === true
|
||||
and $this->getUser('role') > self::GROUP_MEMBER
|
||||
and $this->getUser('group') > self::GROUP_MEMBER
|
||||
) {
|
||||
echo '<nav id="navfixedconnected" >';
|
||||
} else {
|
||||
|
@ -41,7 +41,7 @@
|
||||
<?php echo template::select('connectAuthMail', array_merge([0 => 'Aucune'], self::$groupNews), [
|
||||
'label' => 'Validation par clé ⚠️',
|
||||
'selected' => $this->getData(['config', 'connect', 'mailAuth']),
|
||||
'help' => 'La connexion est confirmée à l\'aide d\'une clé transmise par messagerie. Depuis le role sélectionné et les groupes supérieurs.'
|
||||
'help' => 'La connexion est confirmée à l\'aide d\'une clé transmise par messagerie. Depuis le groupe sélectionné et les groupes supérieurs.'
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col3 verticalAlignBottom">
|
||||
|
@ -94,7 +94,7 @@ class course extends common
|
||||
|
||||
if (
|
||||
$this->getUser('id')
|
||||
&& $this->getUser('role')
|
||||
&& $this->getUser('group')
|
||||
) {
|
||||
foreach ($this->getData(['course']) as $courseId => $courseValue) {
|
||||
/**
|
||||
@ -156,7 +156,7 @@ class course extends common
|
||||
|
||||
// Accès limité aux admins
|
||||
if (
|
||||
$this->getUser('role') !== self::GROUP_ADMIN
|
||||
$this->getUser('group') !== self::GROUP_ADMIN
|
||||
) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
@ -231,7 +231,7 @@ class course extends common
|
||||
// Liste des enseignants pour le sélecteur d'auteurs
|
||||
$teachers = $this->getData(['user']);
|
||||
foreach ($teachers as $teacherId => $teacherInfo) {
|
||||
if ($teacherInfo["role"] >= 2) {
|
||||
if ($teacherInfo["group"] >= 2) {
|
||||
self::$courseTeachers[$teacherId] = $teacherInfo["firstname"] . ' ' . $teacherInfo["lastname"];
|
||||
}
|
||||
}
|
||||
@ -307,7 +307,7 @@ class course extends common
|
||||
// Liste des enseignants pour le sélecteur d'auteurs
|
||||
$teachers = $this->getData(['user']);
|
||||
foreach ($teachers as $teacherId => $teacherInfo) {
|
||||
if ($teacherInfo["role"] >= 2) {
|
||||
if ($teacherInfo["group"] >= 2) {
|
||||
self::$courseTeachers[$teacherId] = $teacherInfo["firstname"] . ' ' . $teacherInfo["lastname"];
|
||||
}
|
||||
}
|
||||
@ -366,7 +366,7 @@ class course extends common
|
||||
// Liste des enseignants pour le sélecteur d'auteurs
|
||||
$teachers = $this->getData(['user']);
|
||||
foreach ($teachers as $teacherId => $teacherInfo) {
|
||||
if ($teacherInfo["role"] >= 2) {
|
||||
if ($teacherInfo["group"] >= 2) {
|
||||
self::$courseTeachers[$teacherId] = $teacherInfo["firstname"] . ' ' . $teacherInfo["lastname"];
|
||||
}
|
||||
}
|
||||
@ -414,7 +414,7 @@ class course extends common
|
||||
|
||||
// Accès limité aux admins, à l'auteur ou éditeurs inscrits
|
||||
if (
|
||||
$this->getUser('role') !== self::$actions[__FUNCTION__]
|
||||
$this->getUser('group') !== self::$actions[__FUNCTION__]
|
||||
) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
@ -447,7 +447,7 @@ class course extends common
|
||||
|
||||
if (
|
||||
// Accès limité aux admins
|
||||
$this->getUser('role') !== self::$actions[__FUNCTION__]
|
||||
$this->getUser('group') !== self::$actions[__FUNCTION__]
|
||||
// Le contenu n'existe pas
|
||||
|| $this->getData(['course', $courseId]) === null
|
||||
) {
|
||||
@ -487,7 +487,7 @@ class course extends common
|
||||
|
||||
if (
|
||||
// Accès limité aux admins
|
||||
$this->getUser('role') !== self::$actions[__FUNCTION__]
|
||||
$this->getUser('group') !== self::$actions[__FUNCTION__]
|
||||
) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
@ -526,7 +526,7 @@ class course extends common
|
||||
|
||||
if (
|
||||
// Accès limité aux admins
|
||||
$this->getUser('role') !== self::$actions[__FUNCTION__]
|
||||
$this->getUser('group') !== self::$actions[__FUNCTION__]
|
||||
) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
@ -557,7 +557,7 @@ class course extends common
|
||||
{
|
||||
if (
|
||||
// Accès limité aux admins
|
||||
$this->getUser('role') !== self::$actions[__FUNCTION__]
|
||||
$this->getUser('group') !== self::$actions[__FUNCTION__]
|
||||
) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
@ -592,7 +592,7 @@ class course extends common
|
||||
|
||||
if (
|
||||
// Accès limité aux admins
|
||||
$this->getUser('role') !== self::$actions[__FUNCTION__]
|
||||
$this->getUser('group') !== self::$actions[__FUNCTION__]
|
||||
) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
@ -652,7 +652,7 @@ class course extends common
|
||||
case "2":
|
||||
foreach ($groupValue as $profilId => $profilValue) {
|
||||
if ($profilId) {
|
||||
self::$courseGroups[$groupId . $profilId] = sprintf(helper::translate('Role %s - Profil %s'), self::$groupPublics[$groupId], $profilValue['name']);
|
||||
self::$courseGroups[$groupId . $profilId] = sprintf(helper::translate('Groupe %s - Profil %s'), self::$groupPublics[$groupId], $profilValue['name']);
|
||||
$profils[$groupId . $profilId] = 0;
|
||||
}
|
||||
}
|
||||
@ -682,20 +682,20 @@ class course extends common
|
||||
foreach ($users as $userId => $userValue) {
|
||||
|
||||
// Compte les rôles valides
|
||||
if (isset($profils[$this->getData(['user', $userId, 'role']) . $this->getData(['user', $userId, 'profil'])])) {
|
||||
$profils[$this->getData(['user', $userId, 'role']) . $this->getData(['user', $userId, 'profil'])]++;
|
||||
if (isset($profils[$this->getData(['user', $userId, 'group']) . $this->getData(['user', $userId, 'profil'])])) {
|
||||
$profils[$this->getData(['user', $userId, 'group']) . $this->getData(['user', $userId, 'profil'])]++;
|
||||
}
|
||||
|
||||
// Filtres
|
||||
if ($this->isPost()) {
|
||||
// Role et profils
|
||||
$role = (string) $this->getData(['user', $userId, 'role']);
|
||||
// Groupe et profils
|
||||
$group = (string) $this->getData(['user', $userId, 'group']);
|
||||
$profil = (string) $this->getData(['user', $userId, 'profil']);
|
||||
$firstName = $this->getData(['user', $userId, 'firstname']);
|
||||
$lastName = $this->getData(['user', $userId, 'lastname']);
|
||||
if (
|
||||
$this->getInput('courseFilterGroup', helper::FILTER_INT) > 0
|
||||
&& $this->getInput('courseFilterGroup', helper::FILTER_STRING_SHORT) !== $role . $profil
|
||||
&& $this->getInput('courseFilterGroup', helper::FILTER_STRING_SHORT) !== $group . $profil
|
||||
)
|
||||
continue;
|
||||
// Première lettre du prénom
|
||||
@ -823,7 +823,7 @@ class course extends common
|
||||
case "2":
|
||||
foreach ($groupValue as $profilId => $profilValue) {
|
||||
if ($profilId) {
|
||||
self::$courseGroups[$groupId . $profilId] = sprintf(helper::translate('Role %s - Profil %s'), self::$groupPublics[$groupId], $profilValue['name']);
|
||||
self::$courseGroups[$groupId . $profilId] = sprintf(helper::translate('Groupe %s - Profil %s'), self::$groupPublics[$groupId], $profilValue['name']);
|
||||
$profils[$groupId . $profilId] = 0;
|
||||
}
|
||||
}
|
||||
@ -850,8 +850,8 @@ class course extends common
|
||||
foreach ($users as $userId => $userValue) {
|
||||
|
||||
// Compte les rôles
|
||||
if (isset($profils[$this->getData(['user', $userId, 'role']) . $this->getData(['user', $userId, 'profil'])])) {
|
||||
$profils[$this->getData(['user', $userId, 'role']) . $this->getData(['user', $userId, 'profil'])]++;
|
||||
if (isset($profils[$this->getData(['user', $userId, 'group']) . $this->getData(['user', $userId, 'profil'])])) {
|
||||
$profils[$this->getData(['user', $userId, 'group']) . $this->getData(['user', $userId, 'profil'])]++;
|
||||
}
|
||||
|
||||
// Filtres
|
||||
@ -861,14 +861,14 @@ class course extends common
|
||||
|| isset($_POST['courseFilterLastName'])
|
||||
) {
|
||||
|
||||
// Role et profils
|
||||
$role = (string) $this->getData(['user', $userId, 'role']);
|
||||
// Groupe et profils
|
||||
$group = (string) $this->getData(['user', $userId, 'group']);
|
||||
$profil = (string) $this->getData(['user', $userId, 'profil']);
|
||||
$firstName = $this->getData(['user', $userId, 'firstname']);
|
||||
$lastName = $this->getData(['user', $userId, 'lastname']);
|
||||
if (
|
||||
$this->getInput('courseFilterGroup', helper::FILTER_INT) > 0
|
||||
&& $this->getInput('courseFilterGroup', helper::FILTER_STRING_SHORT) !== $role . $profil
|
||||
&& $this->getInput('courseFilterGroup', helper::FILTER_STRING_SHORT) !== $group . $profil
|
||||
)
|
||||
continue;
|
||||
// Première lettre du prénom
|
||||
@ -991,7 +991,7 @@ class course extends common
|
||||
case "2":
|
||||
foreach ($groupValue as $profilId => $profilValue) {
|
||||
if ($profilId) {
|
||||
self::$courseGroups[$groupId . $profilId] = sprintf(helper::translate('Role %s - Profil %s'), self::$groupPublics[$groupId], $profilValue['name']);
|
||||
self::$courseGroups[$groupId . $profilId] = sprintf(helper::translate('Groupe %s - Profil %s'), self::$groupPublics[$groupId], $profilValue['name']);
|
||||
$profils[$groupId . $profilId] = 0;
|
||||
}
|
||||
}
|
||||
@ -1013,8 +1013,8 @@ class course extends common
|
||||
foreach ($users as $userId => $userValue) {
|
||||
|
||||
// Compte les rôles
|
||||
if (isset($profils[$this->getData(['user', $userId, 'role']) . $this->getData(['user', $userId, 'profil'])])) {
|
||||
$profils[$this->getData(['user', $userId, 'role']) . $this->getData(['user', $userId, 'profil'])]++;
|
||||
if (isset($profils[$this->getData(['user', $userId, 'group']) . $this->getData(['user', $userId, 'profil'])])) {
|
||||
$profils[$this->getData(['user', $userId, 'group']) . $this->getData(['user', $userId, 'profil'])]++;
|
||||
}
|
||||
|
||||
// Filtres
|
||||
@ -1024,14 +1024,14 @@ class course extends common
|
||||
|| isset($_POST['courseFilterLastName'])
|
||||
) {
|
||||
|
||||
// Role et profils
|
||||
$role = (string) $this->getData(['user', $userId, 'role']);
|
||||
// Groupe et profils
|
||||
$group = (string) $this->getData(['user', $userId, 'group']);
|
||||
$profil = (string) $this->getData(['user', $userId, 'profil']);
|
||||
$firstName = $this->getData(['user', $userId, 'firstname']);
|
||||
$lastName = $this->getData(['user', $userId, 'lastname']);
|
||||
if (
|
||||
$this->getInput('courseFilterGroup', helper::FILTER_INT) > 0
|
||||
&& $this->getInput('courseFilterGroup', helper::FILTER_STRING_SHORT) !== $role . $profil
|
||||
&& $this->getInput('courseFilterGroup', helper::FILTER_STRING_SHORT) !== $group . $profil
|
||||
)
|
||||
continue;
|
||||
// Première lettre du prénom
|
||||
@ -1892,7 +1892,7 @@ class course extends common
|
||||
) {
|
||||
|
||||
// Récupérer le dossier du profil
|
||||
$userPath = $this->getData(['profil', $this->getuser('role'), $this->getuser('profil'), 'folder', 'path']);
|
||||
$userPath = $this->getData(['profil', $this->getuser('group'), $this->getuser('profil'), 'folder', 'path']);
|
||||
$userPath = $userPath === '' ? self::$siteContent : $userPath;
|
||||
// Fichier avec le bon chemin selon le profil
|
||||
$zipName = self::FILE_DIR . 'source/' . $userPath . '/' . $this->getInput('courseRestoreFile', null, true);
|
||||
@ -2003,13 +2003,13 @@ class course extends common
|
||||
*/
|
||||
public function permissionControl($function, $courseId)
|
||||
{
|
||||
switch ($this->getUser('role')) {
|
||||
switch ($this->getUser('group')) {
|
||||
case self::GROUP_ADMIN:
|
||||
return true;
|
||||
case self::GROUP_EDITOR:
|
||||
return (
|
||||
$this->getUser('permission', __CLASS__, $function)
|
||||
&& $this->getUser('role') === self::$actions[$function]
|
||||
&& $this->getUser('group') === self::$actions[$function]
|
||||
&&
|
||||
// Permission d'accéder aux espaces dans lesquels le membre auteur
|
||||
(
|
||||
@ -2043,7 +2043,7 @@ class course extends common
|
||||
// Si un utilisateur connecté est admin ou auteur, c'est autorisé
|
||||
if (
|
||||
$this->isConnected() === true &&
|
||||
($this->getUser('role') === self::GROUP_ADMIN ||
|
||||
($this->getUser('group') === self::GROUP_ADMIN ||
|
||||
$this->getUser('id') === $this->getData(['course', $courseId, 'author']))
|
||||
) {
|
||||
return true;
|
||||
@ -2150,8 +2150,8 @@ class course extends common
|
||||
private function courseIsUserEnroled($courseId)
|
||||
{
|
||||
$userId = $this->getUser('id');
|
||||
$role = $userId ? $this->getData(['user', $userId, 'role']) : null;
|
||||
switch ($role) {
|
||||
$group = $userId ? $this->getData(['user', $userId, 'group']) : null;
|
||||
switch ($group) {
|
||||
case self::GROUP_ADMIN:
|
||||
$r = true;
|
||||
break;
|
||||
|
@ -3,7 +3,7 @@
|
||||
<?php echo template::button('courseUserHistoryBack', [
|
||||
'class' => 'buttonGrey',
|
||||
// Le retour est différent selon que c'est un admin ou un tuteur ou l'utilisateur lui-même
|
||||
'href' => $this->getUser('role') === self::GROUP_MEMBER ? helper::baseUrl(false) : helper::baseUrl() . 'course/users/' . $this->getUrl(2),
|
||||
'href' => $this->getUser('group') === self::GROUP_MEMBER ? helper::baseUrl(false) : helper::baseUrl() . 'course/users/' . $this->getUrl(2),
|
||||
'value' => template::ico('left')
|
||||
]); ?>
|
||||
</div>
|
||||
@ -13,7 +13,7 @@
|
||||
'value' => template::ico('download'),
|
||||
'help' => 'Exporter rapport',
|
||||
// Le memebre ne peut pas exporter
|
||||
'disabled' => $this->getUser('role') === self::GROUP_MEMBER
|
||||
'disabled' => $this->getUser('group') === self::GROUP_MEMBER
|
||||
]) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -135,7 +135,7 @@ class install extends common
|
||||
[
|
||||
'firstname' => $userFirstname,
|
||||
'forgot' => 0,
|
||||
'role' => self::GROUP_ADMIN,
|
||||
'group' => self::GROUP_ADMIN,
|
||||
'profil' => 0,
|
||||
'lastname' => $userLastname,
|
||||
'pseudo' => 'Admin',
|
||||
|
@ -645,7 +645,7 @@ class init extends common
|
||||
'modulePosition' => 'bottom',
|
||||
'parentPageId' => '',
|
||||
'position' => 1,
|
||||
'role' => self::GROUP_VISITOR,
|
||||
'group' => self::GROUP_VISITOR,
|
||||
'profil' => 0,
|
||||
'targetBlank' => false,
|
||||
'title' => 'Accueil',
|
||||
@ -676,7 +676,7 @@ class init extends common
|
||||
'modulePosition' => 'bottom',
|
||||
'parentPageId' => '',
|
||||
'position' => 6,
|
||||
'role' => self::GROUP_VISITOR,
|
||||
'group' => self::GROUP_VISITOR,
|
||||
'profil' => 0,
|
||||
'targetBlank' => false,
|
||||
'title' => 'Contact',
|
||||
@ -707,7 +707,7 @@ class init extends common
|
||||
'modulePosition' => 'bottom',
|
||||
'parentPageId' => '',
|
||||
'position' => 0,
|
||||
'role' => self::GROUP_VISITOR,
|
||||
'group' => self::GROUP_VISITOR,
|
||||
'profil' => 0,
|
||||
'targetBlank' => false,
|
||||
'title' => 'Mentions légales',
|
||||
@ -739,7 +739,7 @@ class init extends common
|
||||
'modulePosition' => '',
|
||||
'parentPageId' => '',
|
||||
'position' => 0,
|
||||
'role' => self::GROUP_VISITOR,
|
||||
'group' => self::GROUP_VISITOR,
|
||||
'profil' => 0,
|
||||
'targetBlank' => false,
|
||||
'title' => 'Maintenance en cours',
|
||||
@ -771,7 +771,7 @@ class init extends common
|
||||
'modulePosition' => 'bottom',
|
||||
'parentPageId' => '',
|
||||
'position' => 0,
|
||||
'role' => self::GROUP_VISITOR,
|
||||
'group' => self::GROUP_VISITOR,
|
||||
'profil' => 0,
|
||||
'targetBlank' => false,
|
||||
'title' => 'Erreur 403',
|
||||
@ -802,7 +802,7 @@ class init extends common
|
||||
'modulePosition' => 'bottom',
|
||||
'parentPageId' => '',
|
||||
'position' => 0,
|
||||
'role' => self::GROUP_VISITOR,
|
||||
'group' => self::GROUP_VISITOR,
|
||||
'profil' => 0,
|
||||
'targetBlank' => false,
|
||||
'title' => 'Erreur 404',
|
||||
@ -938,7 +938,7 @@ class init extends common
|
||||
'config' => [
|
||||
'button' => '',
|
||||
'captcha' => true,
|
||||
'role' => self::GROUP_ADMIN,
|
||||
'group' => self::GROUP_ADMIN,
|
||||
'pageId' => '',
|
||||
'subject' => ''
|
||||
],
|
||||
@ -1065,7 +1065,7 @@ class init extends common
|
||||
'modulePosition' => 'bottom',
|
||||
'parentPageId' => '',
|
||||
'position' => 1,
|
||||
'role' => self::GROUP_VISITOR,
|
||||
'group' => self::GROUP_VISITOR,
|
||||
'profil' => 0,
|
||||
'targetBlank' => false,
|
||||
'title' => 'Sommaire',
|
||||
@ -1096,7 +1096,7 @@ class init extends common
|
||||
'modulePosition' => 'bottom',
|
||||
'parentPageId' => '',
|
||||
'position' => 1,
|
||||
'role' => self::GROUP_VISITOR,
|
||||
'group' => self::GROUP_VISITOR,
|
||||
'profil' => 0,
|
||||
'targetBlank' => false,
|
||||
'title' => 'Première page',
|
||||
@ -1127,7 +1127,7 @@ class init extends common
|
||||
'modulePosition' => 'bottom',
|
||||
'parentPageId' => '',
|
||||
'position' => 1,
|
||||
'role' => self::GROUP_VISITOR,
|
||||
'group' => self::GROUP_VISITOR,
|
||||
'profil' => 0,
|
||||
'targetBlank' => false,
|
||||
'title' => 'Seconde page',
|
||||
@ -1158,7 +1158,7 @@ class init extends common
|
||||
'modulePosition' => 'bottom',
|
||||
'parentPageId' => '',
|
||||
'position' => 1,
|
||||
'role' => self::GROUP_VISITOR,
|
||||
'group' => self::GROUP_VISITOR,
|
||||
'profil' => 0,
|
||||
'targetBlank' => false,
|
||||
'title' => 'Troisième page',
|
||||
@ -1189,7 +1189,7 @@ class init extends common
|
||||
'modulePosition' => 'bottom',
|
||||
'parentPageId' => '',
|
||||
'position' => 0,
|
||||
'role' => 0,
|
||||
'group' => 0,
|
||||
'profil' => 0,
|
||||
'targetBlank' => false,
|
||||
'title' => 'Menu',
|
||||
|
@ -261,9 +261,9 @@
|
||||
"Grande (220%)": "Grande (220%)",
|
||||
"Grande (300px)": "Grande (300px)",
|
||||
"Gras": "Bold",
|
||||
"Role": "role",
|
||||
"Role associé": "Associated role",
|
||||
"Role requis pour accéder à la page :": "role required to access the page:",
|
||||
"Groupe": "Group",
|
||||
"Groupe associé": "Associated Group",
|
||||
"Groupe 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",
|
||||
@ -295,7 +295,7 @@
|
||||
"Importer dans": "Import into",
|
||||
"Importer des utilisateurs en masse": "Import mass users",
|
||||
"Impossible d'ouvrir l'archive": "Impossible to open the archive",
|
||||
"Impossible de modifier votre propre role.": "Unable to modify your own role.",
|
||||
"Impossible de modifier votre propre groupe.": "Unable to modify your own group.",
|
||||
"Impossible de soumettre le formulaire, car il contient des erreurs": "Unable to submit the form, as it contains errors",
|
||||
"Impossible de supprimer une page contenant des pages enfants": "Unable to delete a page containing children's pages",
|
||||
"Impossible de supprimer votre propre compte": "Unable to delete your own account",
|
||||
@ -489,7 +489,7 @@
|
||||
"Pour définir la page comme barre latérale, choisissez l'option dans la liste.": "To define the page as a sidebar, choose the option from the list.",
|
||||
"Presse Papier": "Clipboard",
|
||||
"Presse papier": "Clipboard",
|
||||
"Profils des groupes": "role Profiles",
|
||||
"Profils des groupes": "Group Profiles",
|
||||
"Proportionnelle à la taille définie dans le site.": "Proportional to the size defined in the site.",
|
||||
"Prénom": "First name",
|
||||
"Prénom Nom": "First name Name",
|
||||
@ -695,7 +695,7 @@
|
||||
"Message de test envoyé avec succès": "Test message sent successfully",
|
||||
"Message non envoyé": "Message not sent",
|
||||
"Validation par clé ⚠️": "Key-based validation ⚠️",
|
||||
"La connexion est confirmée à l'aide d'une clé transmise par messagerie. Depuis le role sélectionné et les groupes supérieurs.": "The connection is confirmed using a key sent via messaging. From the selected role and the higher groups.",
|
||||
"La connexion est confirmée à l'aide d'une clé transmise par messagerie. Depuis le groupe sélectionné et les groupes supérieurs.": "The connection is confirmed using a key sent via messaging. From the selected group and the higher groups.",
|
||||
"Envoi du message d'authentification": "Sending authentication message",
|
||||
"Connexion réussie": "Login successful",
|
||||
"Erreur de mot de passe": "Password error",
|
||||
|
@ -261,9 +261,9 @@
|
||||
"Grande (220%)": "Grande (220%)",
|
||||
"Grande (300px)": "Grande (300px)",
|
||||
"Gras": "Negrita",
|
||||
"Role": "Grupo",
|
||||
"Role associé": "Grupo asociado",
|
||||
"Role requis pour accéder à la page :": "Grupo necesario para acceder a la página:",
|
||||
"Groupe": "Grupo",
|
||||
"Groupe associé": "Grupo asociado",
|
||||
"Groupe 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",
|
||||
@ -295,7 +295,7 @@
|
||||
"Importer dans": "Importar a",
|
||||
"Importer des utilisateurs en masse": "Importar usuarios de forma masiva",
|
||||
"Impossible d'ouvrir l'archive": "No se puede abrir el archivo",
|
||||
"Impossible de modifier votre propre role.": "No puede editar su propio grupo.",
|
||||
"Impossible de modifier votre propre groupe.": "No puede editar su propio grupo.",
|
||||
"Impossible de soumettre le formulaire, car il contient des erreurs": "No se puede enviar el formulario porque contiene errores",
|
||||
"Impossible de supprimer une page contenant des pages enfants": "No se puede eliminar una página que contiene páginas secundarias",
|
||||
"Impossible de supprimer votre propre compte": "No puede eliminar su propia cuenta",
|
||||
@ -695,7 +695,7 @@
|
||||
"Message de test envoyé avec succès": "Mensaje de prueba enviado con éxito",
|
||||
"Message non envoyé": "Mensaje no enviado",
|
||||
"Validation par clé ⚠️": "Validación por clave ⚠️",
|
||||
"La connexion est confirmée à l'aide d'une clé transmise par messagerie. Depuis le role sélectionné et les groupes supérieurs.": "La conexión se confirma con una clave enviada por mensajería. Desde el grupo seleccionado y los grupos superiores.",
|
||||
"La connexion est confirmée à l'aide d'une clé transmise par messagerie. Depuis le groupe sélectionné et les groupes supérieurs.": "La conexión se confirma con una clave enviada por mensajería. Desde el grupo seleccionado y los grupos superiores.",
|
||||
"Envoi du message d'authentification": "Envío del mensaje de autenticación",
|
||||
"Connexion réussie": "Conexión exitosa",
|
||||
"Erreur de mot de passe": "Error de contraseña",
|
||||
|
@ -261,9 +261,9 @@
|
||||
"Grande (220%)": "",
|
||||
"Grande (300px)": "",
|
||||
"Gras": "",
|
||||
"Role": "",
|
||||
"Role associé": "",
|
||||
"Role requis pour accéder à la page :": "",
|
||||
"Groupe": "",
|
||||
"Groupe associé": "",
|
||||
"Groupe requis pour accéder à la page :": "",
|
||||
"Groupes": "",
|
||||
"Générer sitemap.xml et robots.txt": "",
|
||||
"Générer une capture Open Graph": "",
|
||||
@ -295,7 +295,7 @@
|
||||
"Importer dans": "",
|
||||
"Importer des utilisateurs en masse": "",
|
||||
"Impossible d'ouvrir l'archive": "",
|
||||
"Impossible de modifier votre propre role.": "",
|
||||
"Impossible de modifier votre propre groupe.": "",
|
||||
"Impossible de soumettre le formulaire, car il contient des erreurs": "",
|
||||
"Impossible de supprimer une page contenant des pages enfants": "",
|
||||
"Impossible de supprimer votre propre compte": "",
|
||||
@ -695,7 +695,7 @@
|
||||
"Message de test envoyé avec succès": "",
|
||||
"Message non envoyé": "",
|
||||
"Validation par clé ⚠️": "",
|
||||
"La connexion est confirmée à l'aide d'une clé transmise par messagerie. Depuis le role sélectionné et les groupes supérieurs.": "",
|
||||
"La connexion est confirmée à l'aide d'une clé transmise par messagerie. Depuis le groupe sélectionné et les groupes supérieurs.": "",
|
||||
"Envoi du message d'authentification": "",
|
||||
"Connexion réussie": "",
|
||||
"Erreur de mot de passe": "",
|
||||
|
@ -180,7 +180,7 @@ class page extends common
|
||||
'parentPageId' => '',
|
||||
'modulePosition' => 'bottom',
|
||||
'position' => 0,
|
||||
'role' => self::GROUP_VISITOR,
|
||||
'group' => self::GROUP_VISITOR,
|
||||
'targetBlank' => false,
|
||||
'title' => $pageTitle,
|
||||
'shortTitle' => $pageTitle,
|
||||
@ -542,17 +542,17 @@ class page extends common
|
||||
}
|
||||
}
|
||||
}
|
||||
// Détermine le role selon que la page est une barre ou une page standard
|
||||
$role = $this->getinput('pageEditBlock') !== 'bar' ? $this->getInput('pageEditGroup', helper::FILTER_INT) : 0;
|
||||
// Détermine le groupe selon que la page est une barre ou une page standard
|
||||
$group = $this->getinput('pageEditBlock') !== 'bar' ? $this->getInput('pageEditGroup', helper::FILTER_INT) : 0;
|
||||
|
||||
//Détermine le profil d'utilisateur en fonction du role sinon le role vaut 0
|
||||
//Détermine le profil d'utilisateur en fonction du groupe sinon le groupe vaut 0
|
||||
$profil = 0;
|
||||
if (
|
||||
$this->getinput('pageEditBlock') !== 'bar' ||
|
||||
$role === 1 ||
|
||||
$role === 2
|
||||
$group === 1 ||
|
||||
$group === 2
|
||||
) {
|
||||
$profil = $this->getInput('pageEditProfil' . $role, helper::FILTER_INT);
|
||||
$profil = $this->getInput('pageEditProfil' . $group, helper::FILTER_INT);
|
||||
}
|
||||
|
||||
// Modifie la page ou en crée une nouvelle si l'id a changé
|
||||
@ -572,7 +572,7 @@ class page extends common
|
||||
'modulePosition' => $this->getInput('pageModulePosition'),
|
||||
'parentPageId' => $this->getInput('pageEditParentPageId'),
|
||||
'position' => $position,
|
||||
'role' => $role,
|
||||
'group' => $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' => 'Role minimal pour accéder à la page',
|
||||
'selected' => $this->getData(['page', $this->getUrl(2), 'role']),
|
||||
'label' => 'Groupe minimal pour accéder à la page',
|
||||
'selected' => $this->getData(['page', $this->getUrl(2), 'group']),
|
||||
'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('role') >= $this->getData(['page', $parentId, 'role'])) {
|
||||
if ($this->getData(['page', $parentId, 'disable']) === false && $this->getUser('group') >= $this->getData(['page', $parentId, 'group'])) {
|
||||
$pageUrl = ($parentId !== $this->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('role') >= $this->getData(['page', $parentId, 'role'])) {
|
||||
if ($this->getData(['page', $childId, 'disable']) === false && $this->getUser('group') >= $this->getData(['page', $parentId, 'group'])) {
|
||||
$pageUrl = ($childId !== $this->homePageId()) ? helper::baseUrl() . $childId : helper::baseUrl(false);
|
||||
$items .= '<a href="' . $pageUrl . '">' . $this->getData(['page', $childId, 'title']) . '</a>';
|
||||
} else {
|
||||
|
@ -1,4 +1,4 @@
|
||||
id;nom;prenom;email;role;profil;passe;tags
|
||||
id;nom;prenom;email;groupe;profil;passe;tags
|
||||
jm1;Membre1;Jean;jean.membre1@email.fr;1;1;jEan05;"adhérent"
|
||||
am2;Membre2;Albert;albert.membre2@email.fr;1;1;alBertAG;"adhérent"
|
||||
jrediteur;Editeur;Robert;robert.editeur@email.fr;2;1;roBert54;"trésorier"
|
||||
|
|
@ -111,10 +111,10 @@ class user extends common
|
||||
$password = $this->getInput('userAddPassword', helper::FILTER_PASSWORD, true);
|
||||
|
||||
// Profil
|
||||
$role = $this->getInput('userAddGroup', helper::FILTER_INT, true);
|
||||
$group = $this->getInput('userAddGroup', helper::FILTER_INT, true);
|
||||
$profil = 0;
|
||||
if ($role === 1 || $role === 2) {
|
||||
$profil = $this->getInput('userAddProfil' . $role, helper::FILTER_INT);
|
||||
if ($group === 1 || $group === 2) {
|
||||
$profil = $this->getInput('userAddProfil' . $group, helper::FILTER_INT);
|
||||
}
|
||||
|
||||
// Stockage des données
|
||||
@ -124,7 +124,7 @@ class user extends common
|
||||
[
|
||||
'firstname' => $userFirstname,
|
||||
'forgot' => 0,
|
||||
'role' => $role,
|
||||
'group' => $group,
|
||||
'profil' => $profil,
|
||||
'lastname' => $userLastname,
|
||||
'pseudo' => $pseudo,
|
||||
@ -208,8 +208,8 @@ class user extends common
|
||||
$this->getUser('permission', __CLASS__, __FUNCTION__) !== true ||
|
||||
// L'utilisateur n'existe pas
|
||||
$this->getData(['user', $this->getUrl(2)]) === null
|
||||
// Role insuffisant
|
||||
and ($this->getUrl('role') < self::GROUP_EDITOR)
|
||||
// Groupe insuffisant
|
||||
and ($this->getUrl('group') < self::GROUP_EDITOR)
|
||||
) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
@ -302,7 +302,7 @@ class user extends common
|
||||
case "2":
|
||||
foreach ($groupValue as $profilId => $profilValue) {
|
||||
if ($profilId) {
|
||||
self::$usersGroups[$groupId . $profilId] = sprintf(helper::translate('Role %s - Profil %s'), self::$groupPublics[$groupId], $profilValue['name']);
|
||||
self::$usersGroups[$groupId . $profilId] = sprintf(helper::translate('Groupe %s - Profil %s'), self::$groupPublics[$groupId], $profilValue['name']);
|
||||
$profils[$groupId . $profilId] = 0;
|
||||
}
|
||||
}
|
||||
@ -323,8 +323,8 @@ class user extends common
|
||||
foreach ($users as $userId => $userValue) {
|
||||
|
||||
// Compte les rôles
|
||||
if (isset($profils[$this->getData(['user', $userId, 'role']) . $this->getData(['user', $userId, 'profil'])])) {
|
||||
$profils[$this->getData(['user', $userId, 'role']) . $this->getData(['user', $userId, 'profil'])]++;
|
||||
if (isset($profils[$this->getData(['user', $userId, 'group']) . $this->getData(['user', $userId, 'profil'])])) {
|
||||
$profils[$this->getData(['user', $userId, 'group']) . $this->getData(['user', $userId, 'profil'])]++;
|
||||
}
|
||||
|
||||
// Filtres
|
||||
@ -334,14 +334,14 @@ class user extends common
|
||||
|| isset($_POST['usersFilterLastName'])
|
||||
) {
|
||||
|
||||
// Role et profils
|
||||
$role = (string) $this->getData(['user', $userId, 'role']);
|
||||
// Groupe et profils
|
||||
$group = (string) $this->getData(['user', $userId, 'group']);
|
||||
$profil = (string) $this->getData(['user', $userId, 'profil']);
|
||||
$firstName = $this->getData(['user', $userId, 'firstname']);
|
||||
$lastName = $this->getData(['user', $userId, 'lastname']);
|
||||
if (
|
||||
$this->getInput('usersFilterGroup', helper::FILTER_INT) > 0
|
||||
&& $this->getInput('usersFilterGroup', helper::FILTER_STRING_SHORT) !== $role . $profil
|
||||
&& $this->getInput('usersFilterGroup', helper::FILTER_STRING_SHORT) !== $group . $profil
|
||||
)
|
||||
continue;
|
||||
// Première lettre du prénom
|
||||
@ -409,10 +409,10 @@ class user extends common
|
||||
and (
|
||||
// Impossible de s'auto-éditer
|
||||
($this->getUser('id') === $this->getUrl(2)
|
||||
and $this->getUrl('role') <= self::GROUP_VISITOR
|
||||
and $this->getUrl('group') <= self::GROUP_VISITOR
|
||||
)
|
||||
// Impossible d'éditer un autre utilisateur
|
||||
or ($this->getUrl('role') < self::GROUP_EDITOR)
|
||||
or ($this->getUrl('group') < self::GROUP_EDITOR)
|
||||
)
|
||||
) {
|
||||
// Valeurs en sortie
|
||||
@ -428,7 +428,7 @@ class user extends common
|
||||
) {
|
||||
$oldPassword = $this->getData(['user', $this->getUrl(2), 'password']);
|
||||
// Double vérification pour le mot de passe
|
||||
if ($this->getUser('role') < self::GROUP_ADMIN) {
|
||||
if ($this->getUser('group') < self::GROUP_ADMIN) {
|
||||
if ($this->getInput('userEditNewPassword')) {
|
||||
// L'ancien mot de passe est correct
|
||||
if (
|
||||
@ -463,17 +463,17 @@ class user extends common
|
||||
}
|
||||
}
|
||||
|
||||
// Modification du role
|
||||
// Modification du groupe
|
||||
if (
|
||||
$this->getUser('role') === self::GROUP_ADMIN
|
||||
$this->getUser('group') === 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), 'role']);
|
||||
$newGroup = $this->getData(['user', $this->getUrl(2), 'group']);
|
||||
}
|
||||
// Modification de nom Prénom
|
||||
if ($this->getUser('role') === self::GROUP_ADMIN) {
|
||||
if ($this->getUser('group') === self::GROUP_ADMIN) {
|
||||
$newfirstname = $this->getInput('userEditFirstname', helper::FILTER_STRING_SHORT, true);
|
||||
$newlastname = $this->getInput('userEditLastname', helper::FILTER_STRING_SHORT, true);
|
||||
} else {
|
||||
@ -492,7 +492,7 @@ class user extends common
|
||||
[
|
||||
'firstname' => $newfirstname,
|
||||
'forgot' => 0,
|
||||
'role' => $newGroup,
|
||||
'group' => $newGroup,
|
||||
'profil' => $profil,
|
||||
'lastname' => $newlastname,
|
||||
'pseudo' => $this->getInput('userEditPseudo', helper::FILTER_STRING_SHORT, true),
|
||||
@ -515,7 +515,7 @@ class user extends common
|
||||
$redirect = helper::baseUrl() . 'user/login/' . str_replace('/', '_', $this->getUrl());
|
||||
}
|
||||
// Redirection si retour en arrière possible
|
||||
elseif ($this->getUser('role') === self::GROUP_ADMIN) {
|
||||
elseif ($this->getUser('group') === self::GROUP_ADMIN) {
|
||||
$redirect = helper::baseUrl() . 'user';
|
||||
}
|
||||
// Redirection normale
|
||||
@ -629,7 +629,7 @@ class user extends common
|
||||
case "2":
|
||||
foreach ($groupValue as $profilId => $profilValue) {
|
||||
if ($profilId) {
|
||||
self::$usersGroups[$groupId . $profilId] = sprintf(helper::translate('Role %s - Profil %s'), self::$groupPublics[$groupId], $profilValue['name']);
|
||||
self::$usersGroups[$groupId . $profilId] = sprintf(helper::translate('Groupe %s - Profil %s'), self::$groupPublics[$groupId], $profilValue['name']);
|
||||
$profils[$groupId . $profilId] = 0;
|
||||
}
|
||||
}
|
||||
@ -646,23 +646,23 @@ class user extends common
|
||||
$userIdsLastNames = helper::arrayColumn($this->getData(['user']), 'lastname');
|
||||
ksort($userIdsLastNames);
|
||||
foreach ($userIdsLastNames as $userId => $userLastNames) {
|
||||
if ($this->getData(['user', $userId, 'role'])) {
|
||||
if ($this->getData(['user', $userId, 'group'])) {
|
||||
|
||||
// Compte les rôles
|
||||
if (isset($profils[$this->getData(['user', $userId, 'role']) . $this->getData(['user', $userId, 'profil'])])) {
|
||||
$profils[$this->getData(['user', $userId, 'role']) . $this->getData(['user', $userId, 'profil'])]++;
|
||||
if (isset($profils[$this->getData(['user', $userId, 'group']) . $this->getData(['user', $userId, 'profil'])])) {
|
||||
$profils[$this->getData(['user', $userId, 'group']) . $this->getData(['user', $userId, 'profil'])]++;
|
||||
}
|
||||
|
||||
// Filtres
|
||||
if ($this->isPost()) {
|
||||
// Role et profils
|
||||
$role = (string) $this->getData(['user', $userId, 'role']);
|
||||
// Groupe et profils
|
||||
$group = (string) $this->getData(['user', $userId, 'group']);
|
||||
$profil = (string) $this->getData(['user', $userId, 'profil']);
|
||||
$firstName = $this->getData(['user', $userId, 'firstname']);
|
||||
$lastName = $this->getData(['user', $userId, 'lastname']);
|
||||
if (
|
||||
$this->getInput('userFilterGroup', helper::FILTER_INT) > 0
|
||||
&& $this->getInput('userFilterGroup', helper::FILTER_STRING_SHORT) !== $role . $profil
|
||||
&& $this->getInput('userFilterGroup', helper::FILTER_STRING_SHORT) !== $group . $profil
|
||||
)
|
||||
continue;
|
||||
// Première lettre du prénom
|
||||
@ -683,10 +683,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, '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']),
|
||||
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']),
|
||||
$this->getData(['user', $userId, 'tags']),
|
||||
is_null($this->getData(['user', $userId, 'accessTimer']))
|
||||
? 'Jamais'
|
||||
@ -734,8 +734,8 @@ class user extends common
|
||||
{
|
||||
|
||||
// Ne pas supprimer un profil utililsé
|
||||
// recherche les membres du role
|
||||
$groups = helper::arrayColumn($this->getData(['user']), 'role');
|
||||
// recherche les membres du groupe
|
||||
$groups = helper::arrayColumn($this->getData(['user']), 'group');
|
||||
$groups = array_keys($groups, $this->getUrl(2));
|
||||
$profilUsed = true;
|
||||
// Stoppe si le profil est affecté
|
||||
@ -801,7 +801,7 @@ class user extends common
|
||||
}
|
||||
|
||||
/**
|
||||
* Edition d'un role
|
||||
* Edition d'un groupe
|
||||
*/
|
||||
public function profilEdit()
|
||||
{
|
||||
@ -813,7 +813,7 @@ class user extends common
|
||||
) {
|
||||
|
||||
// Effacer les données du numéro de profil ancien
|
||||
$role = $this->getInput('profilEditGroup', helper::FILTER_STRING_SHORT, true);
|
||||
$group = $this->getInput('profilEditGroup', helper::FILTER_STRING_SHORT, true);
|
||||
// Les profils 1 sont désactivés dans le formulaire
|
||||
$profil = empty($this->getInput('profilEditProfil')) ? '1' : $this->getInput('profilEditProfil');
|
||||
$oldProfil = $this->getInput('profilEditOldProfil', helper::FILTER_STRING_SHORT);
|
||||
@ -821,15 +821,15 @@ class user extends common
|
||||
$fileManager = $this->getInput('profilEditFileManager', helper::FILTER_BOOLEAN);
|
||||
// Sécurité supplémentaire
|
||||
if (
|
||||
$role < self::GROUP_MEMBER
|
||||
$group < self::GROUP_MEMBER
|
||||
) {
|
||||
$fileManager = false;
|
||||
}
|
||||
if (
|
||||
$profil !== $oldProfil &&
|
||||
$this->deleteData(['profil', $role, $oldProfil])
|
||||
$this->deleteData(['profil', $group, $oldProfil])
|
||||
) {
|
||||
$this->deleteData(['profil', $role, $oldProfil]);
|
||||
$this->deleteData(['profil', $group, $oldProfil]);
|
||||
}
|
||||
// Données du formulaire
|
||||
$data = [
|
||||
@ -932,7 +932,7 @@ class user extends common
|
||||
//Sauvegarder le données
|
||||
$this->setData([
|
||||
'profil',
|
||||
$role,
|
||||
$group,
|
||||
$profil,
|
||||
$data
|
||||
]);
|
||||
@ -1017,14 +1017,14 @@ class user extends common
|
||||
$this->getUser('permission', __CLASS__, __FUNCTION__) === true &&
|
||||
$this->isPost()
|
||||
) {
|
||||
// Nombre de profils de ce role
|
||||
$role = $this->getInput('profilAddGroup');
|
||||
$profil = count($this->getData(['profil', $role]));
|
||||
// Nombre de profils de ce groupe
|
||||
$group = $this->getInput('profilAddGroup');
|
||||
$profil = count($this->getData(['profil', $group]));
|
||||
// Gère le chemin
|
||||
$fileManager = $this->getInput('profilAddFileManager', helper::FILTER_BOOLEAN);
|
||||
// Sécurité supplémentaire
|
||||
if (
|
||||
$role < self::GROUP_MEMBER
|
||||
$group < self::GROUP_MEMBER
|
||||
) {
|
||||
$fileManager = false;
|
||||
}
|
||||
@ -1129,7 +1129,7 @@ class user extends common
|
||||
// Sauvegarder les données
|
||||
$this->setData([
|
||||
'profil',
|
||||
$role,
|
||||
$group,
|
||||
$profil,
|
||||
$data
|
||||
]);
|
||||
@ -1198,8 +1198,8 @@ class user extends common
|
||||
public function profilDelete()
|
||||
{
|
||||
// Ne pas supprimer un profil utililsé
|
||||
// recherche les membres du role
|
||||
$groups = helper::arrayColumn($this->getData(['user']), 'role');
|
||||
// recherche les membres du groupe
|
||||
$groups = helper::arrayColumn($this->getData(['user']), 'group');
|
||||
$groups = array_keys($groups, $this->getUrl(2));
|
||||
$flag = true;
|
||||
// Stoppe si le profil est affecté
|
||||
@ -1301,12 +1301,12 @@ class user extends common
|
||||
$this->setData(['user', $userId, 'connectTimeout', 0], false);
|
||||
}
|
||||
// Check la présence des variables et contrôle du blocage du compte si valeurs dépassées
|
||||
// Vérification du mot de passe et du role
|
||||
// Vérification du mot de passe et du groupe
|
||||
if (
|
||||
($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, 'role']) >= self::GROUP_MEMBER
|
||||
and $this->getData(['user', $userId, 'group']) >= self::GROUP_MEMBER
|
||||
and $captcha === true
|
||||
) {
|
||||
|
||||
@ -1320,7 +1320,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, 'role']) < self::GROUP_ADMIN
|
||||
and $this->getData(['user', $userId, 'group']) < self::GROUP_ADMIN
|
||||
) {
|
||||
$this->addOutput([
|
||||
'notification' => helper::translate('Seul un administrateur peut se connecter lors d\'une maintenance'),
|
||||
@ -1340,7 +1340,7 @@ class user extends common
|
||||
$authRedirect = '';
|
||||
if (
|
||||
$this->getData(['config', 'connect', 'mailAuth']) > 0
|
||||
&& $this->getData(['user', $userId, 'role']) >= $this->getData(['config', 'connect', 'mailAuth'])
|
||||
&& $this->getData(['user', $userId, 'group']) >= $this->getData(['config', 'connect', 'mailAuth'])
|
||||
) {
|
||||
/**
|
||||
* Envoi d'un email contenant une clé
|
||||
@ -1659,7 +1659,7 @@ class user extends common
|
||||
array_key_exists('id', $item)
|
||||
and array_key_exists('prenom', $item)
|
||||
and array_key_exists('nom', $item)
|
||||
and array_key_exists('role', $item)
|
||||
and array_key_exists('groupe', $item)
|
||||
and array_key_exists('profil', $item)
|
||||
and array_key_exists('email', $item)
|
||||
and array_key_exists('passe', $item)
|
||||
@ -1668,16 +1668,16 @@ class user extends common
|
||||
and isset($item['nom'])
|
||||
and isset($item['prenom'])
|
||||
and isset($item['email'])
|
||||
and isset($item['role'])
|
||||
and isset($item['groupe'])
|
||||
and isset($item['profil'])
|
||||
and isset($item['passe'])
|
||||
and isset($item['tags'])
|
||||
) {
|
||||
// Validation du role
|
||||
$item['role'] = (int) $item['role'];
|
||||
// Validation du groupe
|
||||
$item['groupe'] = (int) $item['groupe'];
|
||||
$item['profil'] = (int) $item['profil'];
|
||||
$item['role'] = ($item['role'] >= self::GROUP_BANNED and $item['role'] <= self::GROUP_ADMIN)
|
||||
? $item['role'] : 1;
|
||||
$item['groupe'] = ($item['groupe'] >= self::GROUP_BANNED and $item['groupe'] <= self::GROUP_ADMIN)
|
||||
? $item['groupe'] : 1;
|
||||
// L'utilisateur existe
|
||||
$userId = helper::filter($item['id'], helper::FILTER_ID);
|
||||
if ($this->getData(['user', $userId])) {
|
||||
@ -1688,10 +1688,10 @@ class user extends common
|
||||
$userId,
|
||||
$item['nom'],
|
||||
$item['prenom'],
|
||||
self::$groups[$item['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']),
|
||||
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']),
|
||||
$item['prenom'],
|
||||
helper::filter($item['email'], helper::FILTER_MAIL),
|
||||
$item['tags'],
|
||||
@ -1707,7 +1707,7 @@ class user extends common
|
||||
[
|
||||
'firstname' => $item['prenom'],
|
||||
'forgot' => 0,
|
||||
'role' => $item['role'],
|
||||
'group' => $item['groupe'],
|
||||
'profil' => $item['profil'],
|
||||
'lastname' => $item['nom'],
|
||||
'mail' => $item['email'],
|
||||
@ -1751,10 +1751,10 @@ class user extends common
|
||||
$userId,
|
||||
$item['nom'],
|
||||
$item['prenom'],
|
||||
self::$groups[$item['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']),
|
||||
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']),
|
||||
$item['prenom'],
|
||||
$item['email'],
|
||||
$item['tags'],
|
||||
@ -1864,7 +1864,7 @@ class user extends common
|
||||
case "2":
|
||||
foreach ($groupValue as $profilId => $profilValue) {
|
||||
if ($profilId) {
|
||||
self::$usersGroups[$groupId . $profilId] = sprintf(helper::translate('Role %s - Profil %s'), self::$groupPublics[$groupId], $profilValue['name']);
|
||||
self::$usersGroups[$groupId . $profilId] = sprintf(helper::translate('Groupe %s - Profil %s'), self::$groupPublics[$groupId], $profilValue['name']);
|
||||
$profils[$groupId . $profilId] = 0;
|
||||
}
|
||||
}
|
||||
@ -1885,8 +1885,8 @@ class user extends common
|
||||
foreach ($users as $userId => $userValue) {
|
||||
|
||||
// Compte les rôles
|
||||
if (isset($profils[$this->getData(['user', $userId, 'role']) . $this->getData(['user', $userId, 'profil'])])) {
|
||||
$profils[$this->getData(['user', $userId, 'role']) . $this->getData(['user', $userId, 'profil'])]++;
|
||||
if (isset($profils[$this->getData(['user', $userId, 'group']) . $this->getData(['user', $userId, 'profil'])])) {
|
||||
$profils[$this->getData(['user', $userId, 'group']) . $this->getData(['user', $userId, 'profil'])]++;
|
||||
}
|
||||
|
||||
// Filtres
|
||||
@ -1896,14 +1896,14 @@ class user extends common
|
||||
|| isset($_POST['usersFilterLastName'])
|
||||
) {
|
||||
|
||||
// Role et profils
|
||||
$role = (string) $this->getData(['user', $userId, 'role']);
|
||||
// Groupe et profils
|
||||
$group = (string) $this->getData(['user', $userId, 'group']);
|
||||
$profil = (string) $this->getData(['user', $userId, 'profil']);
|
||||
$firstName = $this->getData(['user', $userId, 'firstname']);
|
||||
$lastName = $this->getData(['user', $userId, 'lastname']);
|
||||
if (
|
||||
$this->getInput('usersFilterGroup', helper::FILTER_INT) > 0
|
||||
&& $this->getInput('usersFilterGroup', helper::FILTER_STRING_SHORT) !== $role . $profil
|
||||
&& $this->getInput('usersFilterGroup', helper::FILTER_STRING_SHORT) !== $group . $profil
|
||||
)
|
||||
continue;
|
||||
// Première lettre du prénom
|
||||
|
@ -105,7 +105,7 @@
|
||||
<div class="row">
|
||||
<div class="col6">
|
||||
<?php echo template::select('userAddGroup', self::$groupNews, [
|
||||
'label' => 'Role',
|
||||
'label' => 'Groupe',
|
||||
'selected' => self::GROUP_MEMBER
|
||||
]); ?>
|
||||
</div>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php echo template::formOpen('userEditForm'); ?>
|
||||
<div class="row">
|
||||
<div class="col1">
|
||||
<?php if ($this->getUser('role') === self::GROUP_ADMIN): ?>
|
||||
<?php if ($this->getUser('group') === 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('role') > self::GROUP_EDITOR ? false : true,
|
||||
'disabled' => $this->getUser('group') > 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('role') > self::GROUP_EDITOR ? false : true,
|
||||
'disabled' => $this->getUser('group') > 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',
|
||||
'readonly' => $this->getUser('role') > self::GROUP_EDITOR ? false : true,
|
||||
'readonly' => $this->getUser('group') > 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('role') < self::GROUP_ADMIN): ?>
|
||||
if ($this->getUser('group') < 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('role') === self::GROUP_ADMIN): ?>
|
||||
<?php if ($this->getUser('group') === 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 role.' : ''),
|
||||
'label' => 'Role',
|
||||
'selected' => $this->getData(['user', $this->getUrl(2), 'role']),
|
||||
'help' => ($this->getUrl(2) === $this->getUser('id') ? 'Impossible de modifier votre propre groupe.' : ''),
|
||||
'label' => 'Groupe',
|
||||
'selected' => $this->getData(['user', $this->getUrl(2), 'group']),
|
||||
]); ?>
|
||||
<?php else: ?>
|
||||
<?php echo template::hidden('userEditGroup', [
|
||||
'value' => $this->getData(['user', $this->getUrl(2), 'role'])
|
||||
'value' => $this->getData(['user', $this->getUrl(2), 'group'])
|
||||
]); ?>
|
||||
<?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('role') !== self::GROUP_ADMIN,
|
||||
'disabled' => $this->getUser('group') !== 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('role') !== self::GROUP_ADMIN,
|
||||
'disabled' => $this->getUser('group') !== 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', 'Role', 'Profil', 'Pseudo', 'eMail', 'Étiquettes', '']); ?>
|
||||
<?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::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.
|
||||
|
@ -68,4 +68,4 @@
|
||||
</div>
|
||||
</div>
|
||||
<?php echo template::formClose(); ?>
|
||||
<?php echo template::table([3, 2, 2, 1, 3, 1, 1], user::$users, ['Nom', 'Role', 'Profil', 'Étiquettes', 'Dernière connexion', '', ''], ['id' => 'dataTables'], ['name','role','profile','tag','data-timestamp','edit','delete']); ?>
|
||||
<?php echo template::table([3, 2, 2, 1, 3, 1, 1], user::$users, ['Nom', 'Groupe', 'Profil', 'Étiquettes', 'Dernière connexion', '', ''], ['id' => 'dataTables'], ['name','group','profile','tag','data-timestamp','edit','delete']); ?>
|
@ -28,7 +28,7 @@
|
||||
</div>
|
||||
<div class="col12">
|
||||
<?php echo template::select('profilAddGroup', user::$groupProfils, [
|
||||
'label' => 'Role associé',
|
||||
'label' => 'Groupe associé',
|
||||
'selected' => $this->getUrl(2)
|
||||
]); ?>
|
||||
</div>
|
||||
|
@ -40,7 +40,7 @@
|
||||
</div>
|
||||
<div class="col12">
|
||||
<?php echo template::text('profilEditDisplayGroup', [
|
||||
'label' => 'Role associé',
|
||||
'label' => 'Groupe associé',
|
||||
'value' => helper::translate(self::$groups[$this->getUrl(2)]),
|
||||
'disabled' => true
|
||||
]); ?>
|
||||
|
14
core/vendor/filemanager/config/config.php
vendored
14
core/vendor/filemanager/config/config.php
vendored
@ -17,7 +17,7 @@ date_default_timezone_set('Europe/Paris');
|
||||
$lang = isset($_GET['lang']) ? $_GET['lang'] : 'fr_FR';
|
||||
setlocale(LC_CTYPE, $lang);
|
||||
|
||||
/* Lecture du role de l'utilisateur connecté pour attribuer les droits et les dossiers */
|
||||
/* Lecture du groupe de l'utilisateur connecté pour attribuer les droits et les dossiers */
|
||||
$userId = $_COOKIE['ZWII_USER_ID'];
|
||||
$courseId = isset($_GET['fldr']) ? $_GET['fldr'] : '';
|
||||
$u = json_decode(file_get_contents('../../../site/data/user.json'), true);
|
||||
@ -25,8 +25,8 @@ $g = json_decode(file_get_contents('../../../site/data/profil.json'), true);
|
||||
|
||||
// Lecture les droits
|
||||
if (!is_null($u) && !is_null($g) && !is_null($userId)) {
|
||||
$role = $u['user'][$userId]['role'];
|
||||
switch ($role) {
|
||||
$group = $u['user'][$userId]['group'];
|
||||
switch ($group) {
|
||||
case 3:
|
||||
// Accès admin
|
||||
$file['delete'] = true;
|
||||
@ -52,12 +52,12 @@ if (!is_null($u) && !is_null($g) && !is_null($userId)) {
|
||||
case 1:
|
||||
// Accès contrôlés par le profil
|
||||
$profil = $u['user'][$userId]['profil'];
|
||||
$file = $g['profil'][$role][$profil]['file'];
|
||||
$folder = $g['profil'][$role][$profil]['folder'];
|
||||
$file = $g['profil'][$group][$profil]['file'];
|
||||
$folder = $g['profil'][$group][$profil]['folder'];
|
||||
// membre sans profil déclaré ou accès interdit, pas d'accès
|
||||
if (
|
||||
is_null($profil)
|
||||
|| $g['profil'][$role][$profil]['filemanager'] === false
|
||||
|| $g['profil'][$group][$profil]['filemanager'] === false
|
||||
) {
|
||||
exit("<h1 style='color: red'>Accès interdit au gestionnaire de fichiers !</h1>");
|
||||
}
|
||||
@ -88,7 +88,7 @@ if (!is_null($u) && !is_null($g) && !is_null($userId)) {
|
||||
}
|
||||
}
|
||||
|
||||
/* Fin lecture du role de l'utilisateur connecté pour attribuer les droits et les dossiers */
|
||||
/* Fin lecture du groupe de l'utilisateur connecté pour attribuer les droits et les dossiers */
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
@ -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 = 'role';
|
||||
const EDIT_GROUP = 'group';
|
||||
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 => 'Role du propriétaire',
|
||||
self::EDIT_GROUP => 'Groupe 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('role') === self::GROUP_ADMIN) {
|
||||
if ($this->getUser('group') === 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('role') : $this->getInput('blogAddConsent'),
|
||||
'editConsent' => $this->getInput('blogAddConsent') === self::EDIT_GROUP ? $this->getUser('group') : $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('role') === self::GROUP_ADMIN)
|
||||
or $this->getUser('group') === self::GROUP_ADMIN)
|
||||
)
|
||||
|
||||
or (
|
||||
// Role
|
||||
// Groupe
|
||||
$this->getData(['module', $this->getUrl(0), 'posts', $value, 'editConsent']) !== self::EDIT_OWNER
|
||||
and $this->getUser('role') >= $this->getData(['module', $this->getUrl(0), 'posts', $value, 'editConsent'])
|
||||
and $this->getUser('group') >= $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('role') === self::GROUP_ADMIN) {
|
||||
if ($this->getUser('group') === 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('role') : $this->getInput('blogEditConsent'),
|
||||
'editConsent' => $this->getInput('blogEditConsent') === self::EDIT_GROUP ? $this->getUser('group') : $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, 'role']) < self::GROUP_EDITOR) {
|
||||
if ($this->getData(['user', $userId, 'group']) < self::GROUP_EDITOR) {
|
||||
unset(self::$users[$userId]);
|
||||
}
|
||||
$userFirstname = $userFirstname . ' ' . $this->getData(['user', $userId, 'lastname']) . ' (' . self::$groupEdits[$this->getData(['user', $userId, 'role'])] . ')';
|
||||
$userFirstname = $userFirstname . ' ' . $this->getData(['user', $userId, 'lastname']) . ' (' . self::$groupEdits[$this->getData(['user', $userId, 'group'])] . ')';
|
||||
}
|
||||
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['role'] >= $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'commentGroupNotification'])) {
|
||||
if ($user['group'] >= $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",
|
||||
"Role du propriétaire": "Besitzergruppe",
|
||||
"Groupe 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",
|
||||
"Role du propriétaire": "Owner's role",
|
||||
"Groupe 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",
|
||||
"Role du propriétaire": "Grupo de propietarios",
|
||||
"Groupe 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": "",
|
||||
"Role du propriétaire": "",
|
||||
"Groupe 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": "Διαχείριση σχολίων",
|
||||
"Role du propriétaire": "Ομάδα ιδιοκτήτη",
|
||||
"Groupe 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",
|
||||
"Role du propriétaire": "Gruppo del proprietario",
|
||||
"Groupe 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",
|
||||
"Role du propriétaire": "Grupo do proprietário",
|
||||
"Groupe 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",
|
||||
"Role du propriétaire": "Sahip grubu",
|
||||
"Groupe 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('role') !== self::GROUP_ADMIN ? true : false
|
||||
'disabled' => $this->getUser('group') !== 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('role') === self::GROUP_ADMIN)
|
||||
or $this->getUser('group') === self::GROUP_ADMIN)
|
||||
)
|
||||
or (
|
||||
// Role
|
||||
// Groupe
|
||||
($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('role') >= $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'editConsent'])
|
||||
and $this->getUser('group') >= $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'editConsent'])
|
||||
)
|
||||
or (
|
||||
// Tout le monde
|
||||
$this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'editConsent']) === blog::EDIT_ALL
|
||||
and $this->getUser('role') >= blog::$actions['config']
|
||||
and $this->getUser('group') >= blog::$actions['config']
|
||||
)
|
||||
)
|
||||
): ?>
|
||||
|
@ -89,7 +89,7 @@
|
||||
<?php echo template::select('blogEditUserId', blog::$users, [
|
||||
'label' => 'Auteur',
|
||||
'selected' => $this->getUser('id'),
|
||||
'disabled' => $this->getUser('role') !== self::GROUP_ADMIN ? true : false
|
||||
'disabled' => $this->getUser('group') !== 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('role') === self::GROUP_ADMIN)
|
||||
or $this->getUser('group') === self::GROUP_ADMIN)
|
||||
)
|
||||
or (
|
||||
// Role
|
||||
// Groupe
|
||||
($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('role') >= $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'editConsent'])
|
||||
and $this->getUser('group') >= $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('role') >= blog::$actions['config']
|
||||
and $this->getUser('group') >= blog::$actions['config']
|
||||
)
|
||||
)
|
||||
): ?>
|
||||
|
@ -185,7 +185,7 @@ class form extends common
|
||||
[
|
||||
'button' => $this->getInput('formOptionButton'),
|
||||
'captcha' => $this->getInput('formOptionCaptcha', helper::FILTER_BOOLEAN),
|
||||
'role' => $this->getInput('formOptionGroup', helper::FILTER_INT),
|
||||
'group' => $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,19 +454,19 @@ class form extends common
|
||||
'mail'
|
||||
]);
|
||||
$singlemail = $this->getData(['module', $this->getUrl(0), 'config', 'mail']);
|
||||
$role = $this->getData(['module', $this->getUrl(0), 'config', 'role']);
|
||||
$group = $this->getData(['module', $this->getUrl(0), 'config', 'group']);
|
||||
// Verification si le mail peut être envoyé
|
||||
if (
|
||||
self::$inputNotices === [] && (
|
||||
$role > 0 ||
|
||||
$group > 0 ||
|
||||
$singleuser !== '' ||
|
||||
$singlemail !== '')
|
||||
) {
|
||||
// Utilisateurs dans le role
|
||||
// Utilisateurs dans le groupe
|
||||
$to = [];
|
||||
if ($role > 0) {
|
||||
if ($group > 0) {
|
||||
foreach ($this->getData(['user']) as $userId => $user) {
|
||||
if ($user['role'] >= $role) {
|
||||
if ($user['group'] >= $group) {
|
||||
$to[] = $user['mail'];
|
||||
}
|
||||
}
|
||||
|
@ -41,7 +41,7 @@
|
||||
"Supprimer cet enregistrement ?": "Diese Aufnahme löschen?",
|
||||
"Supprimer tous les enregistrements ?": "Alle Aufnahmen löschen?",
|
||||
"Sélection": "Auswahl",
|
||||
"Sélectionnez au moins un role, un utilisateur ou saisissez un email. Votre serveur doit autoriser les envois de mail.": "Wählen Sie mindestens eine Gruppe, einen Benutzer, ein Benutzer oder geben Sie eine E -Mail ein. Ihr Server muss E -Mail -Sendungen zulassen.",
|
||||
"Sélectionnez au moins un groupe, un utilisateur ou saisissez un email. Votre serveur doit autoriser les envois de mail.": "Wählen Sie mindestens eine Gruppe, einen Benutzer, ein Benutzer oder geben Sie eine E -Mail ein. Ihr Server muss E -Mail -Sendungen zulassen.",
|
||||
"Type de signature": "Typ de Signature",
|
||||
"Une colonne": "Eine Kolumne",
|
||||
"Validation du formulaire": "Validierung des Formulars",
|
||||
|
@ -41,7 +41,7 @@
|
||||
"Supprimer cet enregistrement ?": "Delete this recording?",
|
||||
"Supprimer tous les enregistrements ?": "Delete all recordings?",
|
||||
"Sélection": "Select",
|
||||
"Sélectionnez au moins un role, un utilisateur ou saisissez un email. Votre serveur doit autoriser les envois de mail.": "Select at least one role, a user or enter an email. Your server must allow email shipments.",
|
||||
"Sélectionnez au moins un groupe, un utilisateur ou saisissez un email. Votre serveur doit autoriser les envois de mail.": "Select at least one group, a user or enter an email. Your server must allow email shipments.",
|
||||
"Type de signature": "Type de signature",
|
||||
"Une colonne": "A column",
|
||||
"Validation du formulaire": "Form validation",
|
||||
|
@ -41,7 +41,7 @@
|
||||
"Supprimer cet enregistrement ?": "¿Borrar este registro?",
|
||||
"Supprimer tous les enregistrements ?": "¿Borrar todos los registros?",
|
||||
"Sélection": "Selección",
|
||||
"Sélectionnez au moins un role, un utilisateur ou saisissez un email. Votre serveur doit autoriser les envois de mail.": "Seleccione al menos un grupo, un usuario o ingrese un correo electrónico. Su servidor debe permitir el envío de correo.",
|
||||
"Sélectionnez au moins un groupe, un utilisateur ou saisissez un email. Votre serveur doit autoriser les envois de mail.": "Seleccione al menos un grupo, un usuario o ingrese un correo electrónico. Su servidor debe permitir el envío de correo.",
|
||||
"Type de signature": "Tipo de firma",
|
||||
"Une colonne": "Una columna",
|
||||
"Validation du formulaire": "Validación del formulario",
|
||||
|
@ -41,7 +41,7 @@
|
||||
"Supprimer cet enregistrement ?": "",
|
||||
"Supprimer tous les enregistrements ?": "",
|
||||
"Sélection": "",
|
||||
"Sélectionnez au moins un role, un utilisateur ou saisissez un email. Votre serveur doit autoriser les envois de mail.": "",
|
||||
"Sélectionnez au moins un groupe, un utilisateur ou saisissez un email. Votre serveur doit autoriser les envois de mail.": "",
|
||||
"Type de signature": "",
|
||||
"Une colonne": "",
|
||||
"Validation du formulaire": "",
|
||||
|
@ -41,7 +41,7 @@
|
||||
"Supprimer cet enregistrement ?": "Να διαγράψω αυτό το αρχείο;",
|
||||
"Supprimer tous les enregistrements ?": "Διαγραφή όλων των εγγραφών;",
|
||||
"Sélection": "Επιλογή",
|
||||
"Sélectionnez au moins un role, un utilisateur ou saisissez un email. Votre serveur doit autoriser les envois de mail.": "Επιλέξτε τουλάχιστον μία ομάδα, έναν χρήστη ή εισαγάγετε ένα email. Ο διακομιστής σας πρέπει να επιτρέπει την αποστολή αλληλογραφίας",
|
||||
"Sélectionnez au moins un groupe, un utilisateur ou saisissez un email. Votre serveur doit autoriser les envois de mail.": "Επιλέξτε τουλάχιστον μία ομάδα, έναν χρήστη ή εισαγάγετε ένα email. Ο διακομιστής σας πρέπει να επιτρέπει την αποστολή αλληλογραφίας",
|
||||
"Type de signature": "Τύπος υπογραφής",
|
||||
"Une colonne": "1 στήλη",
|
||||
"Validation du formulaire": "Επικύρωση της φόρμας",
|
||||
|
@ -41,7 +41,7 @@
|
||||
"Supprimer cet enregistrement ?": "Elimina questa registrazione?",
|
||||
"Supprimer tous les enregistrements ?": "Elimina tutte le registrazioni?",
|
||||
"Sélection": "Selezione",
|
||||
"Sélectionnez au moins un role, un utilisateur ou saisissez un email. Votre serveur doit autoriser les envois de mail.": "Seleziona almeno un gruppo, un utente o inserisci un'e -mail. Il tuo server deve consentire le spedizioni e -mail.",
|
||||
"Sélectionnez au moins un groupe, un utilisateur ou saisissez un email. Votre serveur doit autoriser les envois de mail.": "Seleziona almeno un gruppo, un utente o inserisci un'e -mail. Il tuo server deve consentire le spedizioni e -mail.",
|
||||
"Type de signature": "Tipo di firma",
|
||||
"Une colonne": "Una colonna",
|
||||
"Validation du formulaire": "Convalida del modulo",
|
||||
|
@ -41,7 +41,7 @@
|
||||
"Supprimer cet enregistrement ?": "Excluir esta gravação?",
|
||||
"Supprimer tous les enregistrements ?": "Excluir todas as gravações?",
|
||||
"Sélection": "Seleção",
|
||||
"Sélectionnez au moins un role, un utilisateur ou saisissez un email. Votre serveur doit autoriser les envois de mail.": "Selecione pelo menos um grupo, um usuário ou digite um email. Seu servidor deve permitir remessas por e -mail.",
|
||||
"Sélectionnez au moins un groupe, un utilisateur ou saisissez un email. Votre serveur doit autoriser les envois de mail.": "Selecione pelo menos um grupo, um usuário ou digite um email. Seu servidor deve permitir remessas por e -mail.",
|
||||
"Type de signature": "Tipo de assinatura",
|
||||
"Une colonne": "Uma coluna",
|
||||
"Validation du formulaire": "Validação do formulário",
|
||||
|
@ -41,7 +41,7 @@
|
||||
"Supprimer cet enregistrement ?": "Bu kayıt silinsin mi?",
|
||||
"Supprimer tous les enregistrements ?": "Tüm kayıtlar silinsin mi?",
|
||||
"Sélection": "Seçim",
|
||||
"Sélectionnez au moins un role, un utilisateur ou saisissez un email. Votre serveur doit autoriser les envois de mail.": "En az bir grup, bir kullanıcı seçin veya bir e-posta girin. Sunucunuz posta göndermeye izin vermelidir.",
|
||||
"Sélectionnez au moins un groupe, un utilisateur ou saisissez un email. Votre serveur doit autoriser les envois de mail.": "En az bir grup, bir kullanıcı seçin veya bir e-posta girin. Sunucunuz posta göndermeye izin vermelidir.",
|
||||
"Type de signature": "İmza türü",
|
||||
"Une colonne": "Bir sütun",
|
||||
"Validation du formulaire": "Form doğrulama",
|
||||
|
@ -3,7 +3,7 @@ class init extends form {
|
||||
public static $defaultData = [
|
||||
'button'=> '',
|
||||
'captcha'=> false,
|
||||
'role'=> 0,
|
||||
'group'=> 0,
|
||||
'user'=> '',
|
||||
'mail'=> '',
|
||||
'pageId'=> '',
|
||||
|
@ -80,10 +80,10 @@
|
||||
<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', 'role']) ||
|
||||
'checked' => (bool) $this->getData(['module', $this->getUrl(0), 'config', 'group']) ||
|
||||
!empty($this->getData(['module', $this->getUrl(0), 'config', 'user'])) ||
|
||||
!empty($this->getData(['module', $this->getUrl(0), 'config', 'mail'])),
|
||||
'help' => 'Sélectionnez au moins un role, 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.'
|
||||
]); ?>
|
||||
<div id="formOptionMailOptions" class="displayNone">
|
||||
<div class="row">
|
||||
@ -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', 'role']),
|
||||
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'group']),
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
|
@ -42,7 +42,7 @@
|
||||
$this->isConnected() === true
|
||||
and
|
||||
( // Propriétaire
|
||||
($this->getUser('role') === self::GROUP_ADMIN)
|
||||
($this->getUser('group') === 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('role') === self::GROUP_ADMIN)
|
||||
($this->getUser('group') === 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('role') >= self::GROUP_EDITOR
|
||||
&& $this->getUser('group') >= 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('role') >= $this->getData(['page', $parentId, 'role']) &&
|
||||
$this->getUser('group') >= $this->getData(['page', $parentId, 'group']) &&
|
||||
$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('role') >= $this->getData(['page', $parentId, 'role']) &&
|
||||
$this->getUser('group') >= $this->getData(['page', $parentId, 'group']) &&
|
||||
$this->getData(['page', $parentId, 'block']) !== 'bar'
|
||||
) {
|
||||
$url = $childId;
|
||||
|
@ -113,10 +113,10 @@ class suscribe extends common
|
||||
// Impossible de s'auto-éditer
|
||||
(
|
||||
$this->getUser('id') === 'user'
|
||||
and $this->getUrl('role') <= self::GROUP_VISITOR
|
||||
and $this->getUrl('group') <= self::GROUP_VISITOR
|
||||
)
|
||||
// Impossible d'éditer un autre utilisateur
|
||||
or ($this->getUrl('role') < self::GROUP_EDITOR)
|
||||
or ($this->getUrl('group') < self::GROUP_EDITOR)
|
||||
)
|
||||
) {
|
||||
// Valeurs en sortie
|
||||
@ -138,7 +138,7 @@ class suscribe extends common
|
||||
[
|
||||
'firstname' => $this->getData(['module', $this->getUrl(0), 'users', $this->getUrl(2), 'firstname']),
|
||||
'forgot' => 0,
|
||||
'role' => $this->getInput('registrationUserEditGroup', helper::FILTER_INT),
|
||||
'group' => $this->getInput('registrationUserEditGroup', helper::FILTER_INT),
|
||||
// Le profil vaut 0 pour les amdins et 1 pour les autres membres, profil par défaut.
|
||||
'profil' => $this->getInput('registrationUserEditGroup', helper::FILTER_INT) === self::GROUP_ADMIN
|
||||
? 0 : 1,
|
||||
@ -165,7 +165,7 @@ class suscribe extends common
|
||||
'state' => true
|
||||
]);
|
||||
}
|
||||
// Changement temporaire de libellé du role 0
|
||||
// Changement temporaire de libellé du groupe 0
|
||||
self::$groups = self::$groupEdits;
|
||||
self::$groups[self::GROUP_BANNED] = 'En attente d\'approbation';
|
||||
|
||||
@ -203,7 +203,7 @@ class suscribe extends common
|
||||
if (
|
||||
// L'utilisateur n'existe pas
|
||||
$this->getData(['module', $this->getUrl(0), 'users', $this->getUrl(2)]) === null
|
||||
// Role insuffisant
|
||||
// Groupe insuffisant
|
||||
&& $this->getUser('permission', __CLASS__, __FUNCTION__) !== true
|
||||
) {
|
||||
// Valeurs en sortie
|
||||
@ -303,7 +303,7 @@ class suscribe extends common
|
||||
'lastname' => $userLastname,
|
||||
'mail' => $userMail,
|
||||
'password' => '',
|
||||
// pas de role afin de le différencier dans la liste des users
|
||||
// pas de groupe afin de le différencier dans la liste des users
|
||||
'timer' => time(),
|
||||
'pseudo' => $userId,
|
||||
'auth' => $auth,
|
||||
@ -311,10 +311,10 @@ class suscribe extends common
|
||||
]
|
||||
]);
|
||||
// Mail d'avertissement aux administrateurs
|
||||
// Utilisateurs dans le role admin
|
||||
// Utilisateurs dans le groupe admin
|
||||
$to = [];
|
||||
foreach ($this->getData(['user']) as $key => $user) {
|
||||
if ($user['role'] == self::GROUP_ADMIN) {
|
||||
if ($user['group'] == self::GROUP_ADMIN) {
|
||||
$to[] = $user['mail'];
|
||||
}
|
||||
}
|
||||
@ -418,7 +418,7 @@ class suscribe extends common
|
||||
'lastname' => $this->getData(['module', $this->getUrl(0), 'users', $userId, 'lastname']),
|
||||
'mail' => $this->getData(['module', $this->getUrl(0), 'users', $userId, 'mail']),
|
||||
'password' => $this->getInput('registrationValidPassword', helper::FILTER_PASSWORD, true),
|
||||
'role' => self::GROUP_MEMBER,
|
||||
'group' => self::GROUP_MEMBER,
|
||||
'profil' => 1,
|
||||
'forgot' => 0,
|
||||
'pseudo' => $userId,
|
||||
|
@ -25,11 +25,11 @@
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
<?php if ($this->getUser('role') === self::GROUP_ADMIN): ?>
|
||||
<?php if ($this->getUser('group') === self::GROUP_ADMIN): ?>
|
||||
<?php echo template::select('registrationUserEditGroup', suscribe::$groups, [
|
||||
'disabled' => ($this->getUrl(2) === $this->getUser('id')),
|
||||
'help' => ($this->getUrl(2) === $this->getUser('id') ? 'Impossible de modifier votre propre role.' : ''),
|
||||
'label' => 'Role',
|
||||
'help' => ($this->getUrl(2) === $this->getUser('id') ? 'Impossible de modifier votre propre groupe.' : ''),
|
||||
'label' => 'Groupe',
|
||||
'selected' => $this->getData(['module', $this->getUrl(0), 'registrationUsers', $this->getUrl(2), 'status'])
|
||||
]); ?>
|
||||
<?php endif; ?>
|
||||
@ -40,7 +40,7 @@
|
||||
<?php echo template::select('registrationUserEditProfil' . self::GROUP_MEMBER, suscribe::$userProfils[self::GROUP_MEMBER], [
|
||||
'label' => 'Profil',
|
||||
'selected' => $this->getData(['user', $this->getUrl(2), 'profil']),
|
||||
'disabled' => $this->getUser('role') !== self::GROUP_ADMIN,
|
||||
'disabled' => $this->getUser('group') !== self::GROUP_ADMIN,
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="registrationUserEditGroupProfil"
|
||||
@ -48,7 +48,7 @@
|
||||
<?php echo template::select('registrationUserEditProfil' . self::GROUP_EDITOR, suscribe::$userProfils[self::GROUP_EDITOR], [
|
||||
'label' => 'Profil',
|
||||
'selected' => $this->getData(['user', $this->getUrl(2), 'profil']),
|
||||
'disabled' => $this->getUser('role') !== self::GROUP_ADMIN,
|
||||
'disabled' => $this->getUser('group') !== self::GROUP_ADMIN,
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user