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
|
// Affichage de la barre de membre simple
|
||||||
if (
|
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
|
&& $this->getData(['theme', 'footer', 'memberBar']) === true
|
||||||
) {
|
) {
|
||||||
$items .= '<span id="footerDisplayMemberAccount"';
|
$items .= '<span id="footerDisplayMemberAccount"';
|
||||||
@ -508,7 +508,7 @@ class layout extends common
|
|||||||
* Affichage du sélecteur d'espaces
|
* Affichage du sélecteur d'espaces
|
||||||
*/
|
*/
|
||||||
if (
|
if (
|
||||||
$this->getUser('role') === self::GROUP_MEMBER
|
$this->getUser('group') === self::GROUP_MEMBER
|
||||||
&& $this->getData(['theme', 'menu', 'selectSpace']) === true
|
&& $this->getData(['theme', 'menu', 'selectSpace']) === true
|
||||||
) {
|
) {
|
||||||
if ($this->getCoursesByProfil()) {
|
if ($this->getCoursesByProfil()) {
|
||||||
@ -532,7 +532,7 @@ class layout extends common
|
|||||||
&& $this->getData(['course', self::$siteContent, 'enrolment']) >= 1
|
&& $this->getData(['course', self::$siteContent, 'enrolment']) >= 1
|
||||||
) {
|
) {
|
||||||
$href = '';
|
$href = '';
|
||||||
switch ($this->getUser('role')) {
|
switch ($this->getUser('group')) {
|
||||||
case self::GROUP_MEMBER:
|
case self::GROUP_MEMBER:
|
||||||
$href = helper::baseUrl() . 'course/userReport/' . self::$siteContent . '/' . $this->getUser('id');
|
$href = helper::baseUrl() . 'course/userReport/' . self::$siteContent . '/' . $this->getUser('id');
|
||||||
break;
|
break;
|
||||||
@ -565,7 +565,7 @@ class layout extends common
|
|||||||
* Affichage des boutons gestionnaire de fichiers et mon compte
|
* Affichage des boutons gestionnaire de fichiers et mon compte
|
||||||
*/
|
*/
|
||||||
if (
|
if (
|
||||||
$this->getUser('role') === self::GROUP_MEMBER
|
$this->getUser('group') === self::GROUP_MEMBER
|
||||||
&& $this->getData(['theme', 'menu', 'memberBar']) === true
|
&& $this->getData(['theme', 'menu', 'memberBar']) === true
|
||||||
) {
|
) {
|
||||||
|
|
||||||
@ -648,7 +648,7 @@ class layout extends common
|
|||||||
and $this->isConnected() === false
|
and $this->isConnected() === false
|
||||||
) or ($this->getData(['page', $parentPageId, 'disable']) === true
|
) or ($this->getData(['page', $parentPageId, 'disable']) === true
|
||||||
and $this->isConnected() === true
|
and $this->isConnected() === true
|
||||||
and $this->getUser('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);
|
$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
|
and $this->isConnected() === false
|
||||||
) or ($this->getData(['page', $childKey, 'disable']) === true
|
) or ($this->getData(['page', $childKey, 'disable']) === true
|
||||||
and $this->isConnected() === true
|
and $this->isConnected() === true
|
||||||
and $this->getUser('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);
|
$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 admins voient tous les contenus
|
||||||
* Les enseignants les contenus dont ils sont auteurs
|
* 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())) {
|
if (is_array($this->getCoursesByProfil())) {
|
||||||
$leftItems .= '<li><select id="barSelectCourse" >';
|
$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>';
|
$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'
|
'help' => 'Gérer les espaces'
|
||||||
]) . '</li>';
|
]) . '</li>';
|
||||||
}
|
}
|
||||||
if ($this->getUser('role') >= self::GROUP_ADMIN) {
|
if ($this->getUser('group') >= self::GROUP_ADMIN) {
|
||||||
$leftItems .= '<li>' . template::ico('brush', [
|
$leftItems .= '<li>' . template::ico('brush', [
|
||||||
'help' => 'Thème',
|
'help' => 'Thème',
|
||||||
'href' => helper::baseUrl() . 'theme'
|
'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
|
// Liste des pages et bouton de gestion interdit pour l'accueil sauf admin
|
||||||
if (
|
if (
|
||||||
($this->getUser('role') === self::GROUP_EDITOR && self::$siteContent != 'home')
|
($this->getUser('group') === self::GROUP_EDITOR && self::$siteContent != 'home')
|
||||||
|| $this->getUser('role') === self::GROUP_ADMIN
|
|| $this->getUser('group') === self::GROUP_ADMIN
|
||||||
) {
|
) {
|
||||||
$leftItems .= '<li><select id="barSelectPage">';
|
$leftItems .= '<li><select id="barSelectPage">';
|
||||||
$leftItems .= '<option value="">' . helper::translate('Pages du site') . '</option>';
|
$leftItems .= '<option value="">' . helper::translate('Pages du site') . '</option>';
|
||||||
@ -1122,11 +1122,11 @@ class layout extends common
|
|||||||
$rightItems = '';
|
$rightItems = '';
|
||||||
if (
|
if (
|
||||||
(
|
(
|
||||||
$this->getUser('role') === self::GROUP_EDITOR
|
$this->getUser('group') === self::GROUP_EDITOR
|
||||||
&& $this->getUser('permission', 'filemanager') === true
|
&& $this->getUser('permission', 'filemanager') === true
|
||||||
&& $this->getUser('permission', 'folder', (self::$siteContent === 'home' ? 'homePath' : 'coursePath')) !== 'none'
|
&& $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);
|
$folder = '&fldr=/' . (self::$siteContent === 'home' ? '' : self::$siteContent);
|
||||||
$rightItems .= '<li>' . template::ico('folder', [
|
$rightItems .= '<li>' . template::ico('folder', [
|
||||||
@ -1137,7 +1137,7 @@ class layout extends common
|
|||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
self::$siteContent === 'home'
|
self::$siteContent === 'home'
|
||||||
&& $this->getUser('role') >= self::GROUP_ADMIN
|
&& $this->getUser('group') >= self::GROUP_ADMIN
|
||||||
) {
|
) {
|
||||||
$rightItems .= '<li>' . template::ico('flag', [
|
$rightItems .= '<li>' . template::ico('flag', [
|
||||||
'help' => 'Langues',
|
'help' => 'Langues',
|
||||||
@ -1209,9 +1209,9 @@ class layout extends common
|
|||||||
'href' => helper::baseUrl() . 'plugin'
|
'href' => helper::baseUrl() . 'plugin'
|
||||||
]) . '</li>';
|
]) . '</li>';
|
||||||
}
|
}
|
||||||
// Boutons depuis le role éditeur
|
// Boutons depuis le groupe éditeur
|
||||||
if (
|
if (
|
||||||
$this->getUser('role') >= self::GROUP_EDITOR
|
$this->getUser('group') >= self::GROUP_EDITOR
|
||||||
&& $this->getUser('permission', 'user', 'edit')
|
&& $this->getUser('permission', 'user', 'edit')
|
||||||
|
|
||||||
) {
|
) {
|
||||||
@ -1297,7 +1297,7 @@ class layout extends common
|
|||||||
$vars .= 'var baseUrlQs = ' . json_encode(helper::baseUrl()) . ';';
|
$vars .= 'var baseUrlQs = ' . json_encode(helper::baseUrl()) . ';';
|
||||||
if (
|
if (
|
||||||
$this->isConnected() === true
|
$this->isConnected() === true
|
||||||
and $this->getUser('role') >= self::GROUP_EDITOR
|
and $this->getUser('group') >= self::GROUP_EDITOR
|
||||||
) {
|
) {
|
||||||
$vars .= 'var privateKey = ' . json_encode(md5_file(self::DATA_DIR . 'core.json')) . ';';
|
$vars .= 'var privateKey = ' . json_encode(md5_file(self::DATA_DIR . 'core.json')) . ';';
|
||||||
}
|
}
|
||||||
|
@ -446,7 +446,7 @@ class core extends common
|
|||||||
&& $this->getData(['course', self::$siteContent, 'enrolment']) > 0
|
&& $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
|
// 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'])
|
|| $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
|
// Force la déconnexion des membres bannis ou d'une seconde session
|
||||||
if (
|
if (
|
||||||
$this->isConnected() === true
|
$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'])
|
or ($_SESSION['csrf'] !== $this->getData(['user', $this->getUser('id'), 'accessCsrf'])
|
||||||
and $this->getData(['config', 'connect', 'autoDisconnect']) === true)
|
and $this->getData(['config', 'connect', 'autoDisconnect']) === true)
|
||||||
)
|
)
|
||||||
@ -488,7 +488,7 @@ class core extends common
|
|||||||
and $this->getUrl(1) !== 'login'
|
and $this->getUrl(1) !== 'login'
|
||||||
and ($this->isConnected() === false
|
and ($this->isConnected() === false
|
||||||
or ($this->isConnected() === true
|
or ($this->isConnected() === true
|
||||||
and $this->getUser('role') < common::GROUP_ADMIN
|
and $this->getUser('group') < common::GROUP_ADMIN
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
@ -505,11 +505,11 @@ class core extends common
|
|||||||
$access = null;
|
$access = null;
|
||||||
if ($this->getData(['page', $this->getUrl(0)]) !== null) {
|
if ($this->getData(['page', $this->getUrl(0)]) !== null) {
|
||||||
if (
|
if (
|
||||||
$this->getData(['page', $this->getUrl(0), 'role']) === common::GROUP_VISITOR
|
$this->getData(['page', $this->getUrl(0), 'group']) === common::GROUP_VISITOR
|
||||||
or ($this->isConnected() === true
|
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
|
// 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;
|
$access = true;
|
||||||
@ -526,7 +526,7 @@ class core extends common
|
|||||||
and $this->isConnected() === false
|
and $this->isConnected() === false
|
||||||
) or ($this->getData(['page', $this->getUrl(0), 'disable']) === true
|
) or ($this->getData(['page', $this->getUrl(0), 'disable']) === true
|
||||||
and $this->isConnected() === true
|
and $this->isConnected() === true
|
||||||
and $this->getUser('role') < common::GROUP_EDITOR
|
and $this->getUser('group') < common::GROUP_EDITOR
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
$access = false;
|
$access = false;
|
||||||
@ -567,10 +567,7 @@ class core extends common
|
|||||||
*/
|
*/
|
||||||
$accessInfo['userName'] = '';
|
$accessInfo['userName'] = '';
|
||||||
$accessInfo['pageId'] = '';
|
$accessInfo['pageId'] = '';
|
||||||
if (
|
if ($this->getData(['user'])) {
|
||||||
is_array($this->getData(['user']))
|
|
||||||
&& empty($this->getData(['user'])) === false
|
|
||||||
) {
|
|
||||||
foreach ($this->getData(['user']) as $userId => $userIds) {
|
foreach ($this->getData(['user']) as $userId => $userIds) {
|
||||||
if (!is_null($this->getData(['user', $userId, 'accessUrl']))) {
|
if (!is_null($this->getData(['user', $userId, 'accessUrl']))) {
|
||||||
$t = explode('/', $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)) {
|
if (array_key_exists($action, $module::$actions)) {
|
||||||
$module->$action();
|
$module->$action();
|
||||||
$output = $module->output;
|
$output = $module->output;
|
||||||
// Check le role de l'utilisateur
|
// Check le groupe de l'utilisateur
|
||||||
if (
|
if (
|
||||||
($module::$actions[$action] === common::GROUP_VISITOR
|
($module::$actions[$action] === common::GROUP_VISITOR
|
||||||
or ($this->isConnected() === true
|
or ($this->isConnected() === true
|
||||||
and $this->getUser('role') >= $module::$actions[$action]
|
and $this->getUser('group') >= $module::$actions[$action]
|
||||||
and $this->getUser('permission', $moduleId, $action)
|
and $this->getUser('permission', $moduleId, $action)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
@ -28,7 +28,7 @@ class common
|
|||||||
const GROUP_VISITOR = 0;
|
const GROUP_VISITOR = 0;
|
||||||
const GROUP_MEMBER = 1;
|
const GROUP_MEMBER = 1;
|
||||||
const GROUP_EDITOR = 2;
|
const GROUP_EDITOR = 2;
|
||||||
// Role MODERATOR, compatibilité avec les anciens modules :
|
// Groupe MODERATOR, compatibilité avec les anciens modules :
|
||||||
const GROUP_MODERATOR = 2;
|
const GROUP_MODERATOR = 2;
|
||||||
const GROUP_ADMIN = 3;
|
const GROUP_ADMIN = 3;
|
||||||
const SIGNATURE_ID = 1;
|
const SIGNATURE_ID = 1;
|
||||||
@ -821,11 +821,11 @@ class common
|
|||||||
// Page parent
|
// Page parent
|
||||||
$this->getData(['page', $pageId, 'parentPageId']) === ""
|
$this->getData(['page', $pageId, 'parentPageId']) === ""
|
||||||
// Ignore les pages dont l'utilisateur n'a pas accès
|
// Ignore les pages dont l'utilisateur n'a pas accès
|
||||||
and ($this->getData(['page', $pageId, 'role']) === self::GROUP_VISITOR
|
and ($this->getData(['page', $pageId, 'group']) === self::GROUP_VISITOR
|
||||||
or ($this->getUser('authKey') === $this->getInput('ZWII_AUTH_KEY')
|
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
|
// 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
|
// Ignore les pages dont l'utilisateur n'a pas accès
|
||||||
and (
|
and (
|
||||||
(
|
(
|
||||||
$this->getData(['page', $pageId, 'role']) === self::GROUP_VISITOR
|
$this->getData(['page', $pageId, 'group']) === self::GROUP_VISITOR
|
||||||
and
|
and
|
||||||
$this->getData(['page', $parentId, 'role']) === self::GROUP_VISITOR
|
$this->getData(['page', $parentId, 'group']) === self::GROUP_VISITOR
|
||||||
)
|
)
|
||||||
or (
|
or (
|
||||||
$this->getUser('authKey') === $this->getInput('ZWII_AUTH_KEY')
|
$this->getUser('authKey') === $this->getInput('ZWII_AUTH_KEY')
|
||||||
and
|
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é
|
* 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
|
* @return string|null
|
||||||
*/
|
*/
|
||||||
public function getPermission($key1, $key2 = null)
|
public function getPermission($key1, $key2 = null)
|
||||||
{
|
{
|
||||||
// Administrateur, toutes les permissions
|
// Administrateur, toutes les permissions
|
||||||
if ($this->getUser('role') === self::GROUP_ADMIN) {
|
if ($this->getUser('group') === self::GROUP_ADMIN) {
|
||||||
return true;
|
return true;
|
||||||
} elseif ($this->getUser('role') <= self::GROUP_VISITOR) { // Role sans autorisation
|
} elseif ($this->getUser('group') <= self::GROUP_VISITOR) { // Groupe sans autorisation
|
||||||
return false;
|
return false;
|
||||||
} elseif (
|
} elseif (
|
||||||
// Role avec profil, consultation des autorisations sur deux clés
|
// Groupe avec profil, consultation des autorisations sur deux clés
|
||||||
$key1
|
$key1
|
||||||
&& $key2
|
&& $key2
|
||||||
&& $this->user
|
&& $this->user
|
||||||
&& $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['role'], $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]);
|
return $this->getData(['profil', $this->user['group'], $this->user['profil'], $key1, $key2]);
|
||||||
// Role avec profil, consultation des autorisations sur une seule clé
|
// Groupe avec profil, consultation des autorisations sur une seule clé
|
||||||
} elseif (
|
} elseif (
|
||||||
$key1
|
$key1
|
||||||
&& $this->user
|
&& $this->user
|
||||||
&& $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['role'], $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 {
|
} else {
|
||||||
// Une permission non spécifiée dans le profil est autorisée selon la valeur de $actions
|
// Une permission non spécifiée dans le profil est autorisée selon la valeur de $actions
|
||||||
if (class_exists($key1)) {
|
if (class_exists($key1)) {
|
||||||
$module = new $key1;
|
$module = new $key1;
|
||||||
if (array_key_exists($key2, $module::$actions)) {
|
if (array_key_exists($key2, $module::$actions)) {
|
||||||
return $this->getUser('role') >= $module::$actions[$key2];
|
return $this->getUser('group') >= $module::$actions[$key2];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@ -1169,7 +1169,7 @@ class common
|
|||||||
foreach ($this->getHierarchy() as $parentPageId => $childrenPageIds) {
|
foreach ($this->getHierarchy() as $parentPageId => $childrenPageIds) {
|
||||||
// Exclure les barres et les pages non publiques et les pages masquées
|
// Exclure les barres et les pages non publiques et les pages masquées
|
||||||
if (
|
if (
|
||||||
$this->getData(['page', $parentPageId, 'role']) !== 0 ||
|
$this->getData(['page', $parentPageId, 'group']) !== 0 ||
|
||||||
$this->getData(['page', $parentPageId, 'block']) === 'bar'
|
$this->getData(['page', $parentPageId, 'block']) === 'bar'
|
||||||
) {
|
) {
|
||||||
continue;
|
continue;
|
||||||
@ -1197,7 +1197,7 @@ class common
|
|||||||
}
|
}
|
||||||
// Sous-pages
|
// Sous-pages
|
||||||
foreach ($childrenPageIds as $childKey) {
|
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;
|
continue;
|
||||||
}
|
}
|
||||||
// Cas de la page d'accueil ne pas dupliquer l'URL
|
// 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 = $this->getData([('course')]);
|
||||||
$courses = helper::arraycolumn($courses, 'title', 'SORT_ASC');
|
$courses = helper::arraycolumn($courses, 'title', 'SORT_ASC');
|
||||||
$filter = array();
|
$filter = array();
|
||||||
switch ($this->getUser('role')) {
|
switch ($this->getUser('group')) {
|
||||||
case self::GROUP_ADMIN:
|
case self::GROUP_ADMIN:
|
||||||
// Affiche tout
|
// Affiche tout
|
||||||
return $courses;
|
return $courses;
|
||||||
|
@ -9,13 +9,13 @@ if (
|
|||||||
$this->getData(['core', 'dataVersion']) < 1700
|
$this->getData(['core', 'dataVersion']) < 1700
|
||||||
) {
|
) {
|
||||||
// Supprime la variable path des profils, seul l'accès à l'espace et autorisé.
|
// Supprime la variable path des profils, seul l'accès à l'espace et autorisé.
|
||||||
foreach (['1', '2'] as $role) {
|
foreach (['1', '2'] as $group) {
|
||||||
foreach (array_keys($this->getData(['profil', $role])) as $profil) {
|
foreach (array_keys($this->getData(['profil', $group])) as $profil) {
|
||||||
if (is_null($this->getData(['profil', $role, $profil, 'folder', 'path'])) === false) {
|
if (is_null($this->getData(['profil', $group, $profil, 'folder', 'path'])) === false) {
|
||||||
$path = $this->getData(['profil', $role, $profil, 'folder', 'path']);
|
$path = $this->getData(['profil', $group, $profil, 'folder', 'path']);
|
||||||
$this->setData(['profil', $role, $profil, 'folder', 'homePath', $path]);
|
$this->setData(['profil', $group, $profil, 'folder', 'homePath', $path]);
|
||||||
$this->setData(['profil', $role, $profil, 'folder', 'coursePath', $path]);
|
$this->setData(['profil', $group, $profil, 'folder', 'coursePath', $path]);
|
||||||
$this->deleteData(['profil', $role, $profil, 'folder', 'path']);
|
$this->deleteData(['profil', $group, $profil, 'folder', 'path']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -58,15 +58,14 @@ if (
|
|||||||
'theme' =>
|
'theme' =>
|
||||||
['menu' => [
|
['menu' => [
|
||||||
'hidePages' => false
|
'hidePages' => false
|
||||||
]]
|
]]];
|
||||||
];
|
|
||||||
// Parcourir la structure pour écrire dans les fichiers JSON
|
// Parcourir la structure pour écrire dans les fichiers JSON
|
||||||
foreach ($this->getData(['course']) as $courseId => $courseValues) {
|
foreach ($this->getData(['course']) as $courseId => $courseValues) {
|
||||||
$d = json_decode(file_get_contents(self::DATA_DIR . $courseId . '/theme.json'), true);
|
$d = json_decode(file_get_contents(self::DATA_DIR . $courseId . '/theme.json'), true);
|
||||||
// Insérer la variable hidePages si elle n'existe pas
|
// Insérer la variable hidePages si elle n'existe pas
|
||||||
if (isset($d['theme']['menu']['hidePages']) === false) {
|
if (isset($d['theme']['menu']['hidePages']) === false) {
|
||||||
$result = array_replace_recursive($d, $a);
|
$result = array_replace_recursive($d, $a);
|
||||||
file_put_contents(self::DATA_DIR . $courseId . '/theme.json', json_encode($result, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES));
|
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
|
// Forcer la régénération du fichier theme.css
|
||||||
if (file_exists(self::DATA_DIR . $courseId . '/theme.css')) {
|
if (file_exists(self::DATA_DIR . $courseId . '/theme.css')) {
|
||||||
@ -75,30 +74,3 @@ if (
|
|||||||
}
|
}
|
||||||
$this->setData(['core', 'dataVersion', 12002]);
|
$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>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<!-- Barre d'administration -->
|
<!-- Barre d'administration -->
|
||||||
<?php if ($this->getUser('role') > self::GROUP_MEMBER) : ?>
|
<?php if ($this->getUser('group') > self::GROUP_MEMBER) : ?>
|
||||||
<?php $layout->showBar(); ?>
|
<?php $layout->showBar(); ?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<!-- Notifications -->
|
<!-- Notifications -->
|
||||||
@ -48,7 +48,7 @@
|
|||||||
$this->getData(['theme', 'menu', 'position']) === 'top'
|
$this->getData(['theme', 'menu', 'position']) === 'top'
|
||||||
and $this->getData(['theme', 'menu', 'fixed']) === true
|
and $this->getData(['theme', 'menu', 'fixed']) === true
|
||||||
and $this->isConnected() === true
|
and $this->isConnected() === true
|
||||||
and $this->getUser('role') > self::GROUP_MEMBER
|
and $this->getUser('group') > self::GROUP_MEMBER
|
||||||
) {
|
) {
|
||||||
echo '<nav id="navfixedconnected" >';
|
echo '<nav id="navfixedconnected" >';
|
||||||
} else {
|
} else {
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
<?php echo template::select('connectAuthMail', array_merge([0 => 'Aucune'], self::$groupNews), [
|
<?php echo template::select('connectAuthMail', array_merge([0 => 'Aucune'], self::$groupNews), [
|
||||||
'label' => 'Validation par clé ⚠️',
|
'label' => 'Validation par clé ⚠️',
|
||||||
'selected' => $this->getData(['config', 'connect', 'mailAuth']),
|
'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>
|
||||||
<div class="col3 verticalAlignBottom">
|
<div class="col3 verticalAlignBottom">
|
||||||
|
@ -94,7 +94,7 @@ class course extends common
|
|||||||
|
|
||||||
if (
|
if (
|
||||||
$this->getUser('id')
|
$this->getUser('id')
|
||||||
&& $this->getUser('role')
|
&& $this->getUser('group')
|
||||||
) {
|
) {
|
||||||
foreach ($this->getData(['course']) as $courseId => $courseValue) {
|
foreach ($this->getData(['course']) as $courseId => $courseValue) {
|
||||||
/**
|
/**
|
||||||
@ -156,7 +156,7 @@ class course extends common
|
|||||||
|
|
||||||
// Accès limité aux admins
|
// Accès limité aux admins
|
||||||
if (
|
if (
|
||||||
$this->getUser('role') !== self::GROUP_ADMIN
|
$this->getUser('group') !== self::GROUP_ADMIN
|
||||||
) {
|
) {
|
||||||
// Valeurs en sortie
|
// Valeurs en sortie
|
||||||
$this->addOutput([
|
$this->addOutput([
|
||||||
@ -231,7 +231,7 @@ class course extends common
|
|||||||
// Liste des enseignants pour le sélecteur d'auteurs
|
// Liste des enseignants pour le sélecteur d'auteurs
|
||||||
$teachers = $this->getData(['user']);
|
$teachers = $this->getData(['user']);
|
||||||
foreach ($teachers as $teacherId => $teacherInfo) {
|
foreach ($teachers as $teacherId => $teacherInfo) {
|
||||||
if ($teacherInfo["role"] >= 2) {
|
if ($teacherInfo["group"] >= 2) {
|
||||||
self::$courseTeachers[$teacherId] = $teacherInfo["firstname"] . ' ' . $teacherInfo["lastname"];
|
self::$courseTeachers[$teacherId] = $teacherInfo["firstname"] . ' ' . $teacherInfo["lastname"];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -307,7 +307,7 @@ class course extends common
|
|||||||
// Liste des enseignants pour le sélecteur d'auteurs
|
// Liste des enseignants pour le sélecteur d'auteurs
|
||||||
$teachers = $this->getData(['user']);
|
$teachers = $this->getData(['user']);
|
||||||
foreach ($teachers as $teacherId => $teacherInfo) {
|
foreach ($teachers as $teacherId => $teacherInfo) {
|
||||||
if ($teacherInfo["role"] >= 2) {
|
if ($teacherInfo["group"] >= 2) {
|
||||||
self::$courseTeachers[$teacherId] = $teacherInfo["firstname"] . ' ' . $teacherInfo["lastname"];
|
self::$courseTeachers[$teacherId] = $teacherInfo["firstname"] . ' ' . $teacherInfo["lastname"];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -366,7 +366,7 @@ class course extends common
|
|||||||
// Liste des enseignants pour le sélecteur d'auteurs
|
// Liste des enseignants pour le sélecteur d'auteurs
|
||||||
$teachers = $this->getData(['user']);
|
$teachers = $this->getData(['user']);
|
||||||
foreach ($teachers as $teacherId => $teacherInfo) {
|
foreach ($teachers as $teacherId => $teacherInfo) {
|
||||||
if ($teacherInfo["role"] >= 2) {
|
if ($teacherInfo["group"] >= 2) {
|
||||||
self::$courseTeachers[$teacherId] = $teacherInfo["firstname"] . ' ' . $teacherInfo["lastname"];
|
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
|
// Accès limité aux admins, à l'auteur ou éditeurs inscrits
|
||||||
if (
|
if (
|
||||||
$this->getUser('role') !== self::$actions[__FUNCTION__]
|
$this->getUser('group') !== self::$actions[__FUNCTION__]
|
||||||
) {
|
) {
|
||||||
// Valeurs en sortie
|
// Valeurs en sortie
|
||||||
$this->addOutput([
|
$this->addOutput([
|
||||||
@ -447,7 +447,7 @@ class course extends common
|
|||||||
|
|
||||||
if (
|
if (
|
||||||
// Accès limité aux admins
|
// Accès limité aux admins
|
||||||
$this->getUser('role') !== self::$actions[__FUNCTION__]
|
$this->getUser('group') !== self::$actions[__FUNCTION__]
|
||||||
// Le contenu n'existe pas
|
// Le contenu n'existe pas
|
||||||
|| $this->getData(['course', $courseId]) === null
|
|| $this->getData(['course', $courseId]) === null
|
||||||
) {
|
) {
|
||||||
@ -487,7 +487,7 @@ class course extends common
|
|||||||
|
|
||||||
if (
|
if (
|
||||||
// Accès limité aux admins
|
// Accès limité aux admins
|
||||||
$this->getUser('role') !== self::$actions[__FUNCTION__]
|
$this->getUser('group') !== self::$actions[__FUNCTION__]
|
||||||
) {
|
) {
|
||||||
// Valeurs en sortie
|
// Valeurs en sortie
|
||||||
$this->addOutput([
|
$this->addOutput([
|
||||||
@ -526,7 +526,7 @@ class course extends common
|
|||||||
|
|
||||||
if (
|
if (
|
||||||
// Accès limité aux admins
|
// Accès limité aux admins
|
||||||
$this->getUser('role') !== self::$actions[__FUNCTION__]
|
$this->getUser('group') !== self::$actions[__FUNCTION__]
|
||||||
) {
|
) {
|
||||||
// Valeurs en sortie
|
// Valeurs en sortie
|
||||||
$this->addOutput([
|
$this->addOutput([
|
||||||
@ -557,7 +557,7 @@ class course extends common
|
|||||||
{
|
{
|
||||||
if (
|
if (
|
||||||
// Accès limité aux admins
|
// Accès limité aux admins
|
||||||
$this->getUser('role') !== self::$actions[__FUNCTION__]
|
$this->getUser('group') !== self::$actions[__FUNCTION__]
|
||||||
) {
|
) {
|
||||||
// Valeurs en sortie
|
// Valeurs en sortie
|
||||||
$this->addOutput([
|
$this->addOutput([
|
||||||
@ -592,7 +592,7 @@ class course extends common
|
|||||||
|
|
||||||
if (
|
if (
|
||||||
// Accès limité aux admins
|
// Accès limité aux admins
|
||||||
$this->getUser('role') !== self::$actions[__FUNCTION__]
|
$this->getUser('group') !== self::$actions[__FUNCTION__]
|
||||||
) {
|
) {
|
||||||
// Valeurs en sortie
|
// Valeurs en sortie
|
||||||
$this->addOutput([
|
$this->addOutput([
|
||||||
@ -652,7 +652,7 @@ class course extends common
|
|||||||
case "2":
|
case "2":
|
||||||
foreach ($groupValue as $profilId => $profilValue) {
|
foreach ($groupValue as $profilId => $profilValue) {
|
||||||
if ($profilId) {
|
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;
|
$profils[$groupId . $profilId] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -682,20 +682,20 @@ class course extends common
|
|||||||
foreach ($users as $userId => $userValue) {
|
foreach ($users as $userId => $userValue) {
|
||||||
|
|
||||||
// Compte les rôles valides
|
// Compte les rôles valides
|
||||||
if (isset($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, 'role']) . $this->getData(['user', $userId, 'profil'])]++;
|
$profils[$this->getData(['user', $userId, 'group']) . $this->getData(['user', $userId, 'profil'])]++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Filtres
|
// Filtres
|
||||||
if ($this->isPost()) {
|
if ($this->isPost()) {
|
||||||
// Role et profils
|
// Groupe et profils
|
||||||
$role = (string) $this->getData(['user', $userId, 'role']);
|
$group = (string) $this->getData(['user', $userId, 'group']);
|
||||||
$profil = (string) $this->getData(['user', $userId, 'profil']);
|
$profil = (string) $this->getData(['user', $userId, 'profil']);
|
||||||
$firstName = $this->getData(['user', $userId, 'firstname']);
|
$firstName = $this->getData(['user', $userId, 'firstname']);
|
||||||
$lastName = $this->getData(['user', $userId, 'lastname']);
|
$lastName = $this->getData(['user', $userId, 'lastname']);
|
||||||
if (
|
if (
|
||||||
$this->getInput('courseFilterGroup', helper::FILTER_INT) > 0
|
$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;
|
continue;
|
||||||
// Première lettre du prénom
|
// Première lettre du prénom
|
||||||
@ -823,7 +823,7 @@ class course extends common
|
|||||||
case "2":
|
case "2":
|
||||||
foreach ($groupValue as $profilId => $profilValue) {
|
foreach ($groupValue as $profilId => $profilValue) {
|
||||||
if ($profilId) {
|
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;
|
$profils[$groupId . $profilId] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -850,8 +850,8 @@ class course extends common
|
|||||||
foreach ($users as $userId => $userValue) {
|
foreach ($users as $userId => $userValue) {
|
||||||
|
|
||||||
// Compte les rôles
|
// Compte les rôles
|
||||||
if (isset($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, 'role']) . $this->getData(['user', $userId, 'profil'])]++;
|
$profils[$this->getData(['user', $userId, 'group']) . $this->getData(['user', $userId, 'profil'])]++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Filtres
|
// Filtres
|
||||||
@ -861,14 +861,14 @@ class course extends common
|
|||||||
|| isset($_POST['courseFilterLastName'])
|
|| isset($_POST['courseFilterLastName'])
|
||||||
) {
|
) {
|
||||||
|
|
||||||
// Role et profils
|
// Groupe et profils
|
||||||
$role = (string) $this->getData(['user', $userId, 'role']);
|
$group = (string) $this->getData(['user', $userId, 'group']);
|
||||||
$profil = (string) $this->getData(['user', $userId, 'profil']);
|
$profil = (string) $this->getData(['user', $userId, 'profil']);
|
||||||
$firstName = $this->getData(['user', $userId, 'firstname']);
|
$firstName = $this->getData(['user', $userId, 'firstname']);
|
||||||
$lastName = $this->getData(['user', $userId, 'lastname']);
|
$lastName = $this->getData(['user', $userId, 'lastname']);
|
||||||
if (
|
if (
|
||||||
$this->getInput('courseFilterGroup', helper::FILTER_INT) > 0
|
$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;
|
continue;
|
||||||
// Première lettre du prénom
|
// Première lettre du prénom
|
||||||
@ -991,7 +991,7 @@ class course extends common
|
|||||||
case "2":
|
case "2":
|
||||||
foreach ($groupValue as $profilId => $profilValue) {
|
foreach ($groupValue as $profilId => $profilValue) {
|
||||||
if ($profilId) {
|
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;
|
$profils[$groupId . $profilId] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1013,8 +1013,8 @@ class course extends common
|
|||||||
foreach ($users as $userId => $userValue) {
|
foreach ($users as $userId => $userValue) {
|
||||||
|
|
||||||
// Compte les rôles
|
// Compte les rôles
|
||||||
if (isset($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, 'role']) . $this->getData(['user', $userId, 'profil'])]++;
|
$profils[$this->getData(['user', $userId, 'group']) . $this->getData(['user', $userId, 'profil'])]++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Filtres
|
// Filtres
|
||||||
@ -1024,14 +1024,14 @@ class course extends common
|
|||||||
|| isset($_POST['courseFilterLastName'])
|
|| isset($_POST['courseFilterLastName'])
|
||||||
) {
|
) {
|
||||||
|
|
||||||
// Role et profils
|
// Groupe et profils
|
||||||
$role = (string) $this->getData(['user', $userId, 'role']);
|
$group = (string) $this->getData(['user', $userId, 'group']);
|
||||||
$profil = (string) $this->getData(['user', $userId, 'profil']);
|
$profil = (string) $this->getData(['user', $userId, 'profil']);
|
||||||
$firstName = $this->getData(['user', $userId, 'firstname']);
|
$firstName = $this->getData(['user', $userId, 'firstname']);
|
||||||
$lastName = $this->getData(['user', $userId, 'lastname']);
|
$lastName = $this->getData(['user', $userId, 'lastname']);
|
||||||
if (
|
if (
|
||||||
$this->getInput('courseFilterGroup', helper::FILTER_INT) > 0
|
$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;
|
continue;
|
||||||
// Première lettre du prénom
|
// Première lettre du prénom
|
||||||
@ -1892,7 +1892,7 @@ class course extends common
|
|||||||
) {
|
) {
|
||||||
|
|
||||||
// Récupérer le dossier du profil
|
// 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;
|
$userPath = $userPath === '' ? self::$siteContent : $userPath;
|
||||||
// Fichier avec le bon chemin selon le profil
|
// Fichier avec le bon chemin selon le profil
|
||||||
$zipName = self::FILE_DIR . 'source/' . $userPath . '/' . $this->getInput('courseRestoreFile', null, true);
|
$zipName = self::FILE_DIR . 'source/' . $userPath . '/' . $this->getInput('courseRestoreFile', null, true);
|
||||||
@ -2003,13 +2003,13 @@ class course extends common
|
|||||||
*/
|
*/
|
||||||
public function permissionControl($function, $courseId)
|
public function permissionControl($function, $courseId)
|
||||||
{
|
{
|
||||||
switch ($this->getUser('role')) {
|
switch ($this->getUser('group')) {
|
||||||
case self::GROUP_ADMIN:
|
case self::GROUP_ADMIN:
|
||||||
return true;
|
return true;
|
||||||
case self::GROUP_EDITOR:
|
case self::GROUP_EDITOR:
|
||||||
return (
|
return (
|
||||||
$this->getUser('permission', __CLASS__, $function)
|
$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
|
// 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é
|
// Si un utilisateur connecté est admin ou auteur, c'est autorisé
|
||||||
if (
|
if (
|
||||||
$this->isConnected() === true &&
|
$this->isConnected() === true &&
|
||||||
($this->getUser('role') === self::GROUP_ADMIN ||
|
($this->getUser('group') === self::GROUP_ADMIN ||
|
||||||
$this->getUser('id') === $this->getData(['course', $courseId, 'author']))
|
$this->getUser('id') === $this->getData(['course', $courseId, 'author']))
|
||||||
) {
|
) {
|
||||||
return true;
|
return true;
|
||||||
@ -2150,8 +2150,8 @@ class course extends common
|
|||||||
private function courseIsUserEnroled($courseId)
|
private function courseIsUserEnroled($courseId)
|
||||||
{
|
{
|
||||||
$userId = $this->getUser('id');
|
$userId = $this->getUser('id');
|
||||||
$role = $userId ? $this->getData(['user', $userId, 'role']) : null;
|
$group = $userId ? $this->getData(['user', $userId, 'group']) : null;
|
||||||
switch ($role) {
|
switch ($group) {
|
||||||
case self::GROUP_ADMIN:
|
case self::GROUP_ADMIN:
|
||||||
$r = true;
|
$r = true;
|
||||||
break;
|
break;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
<?php echo template::button('courseUserHistoryBack', [
|
<?php echo template::button('courseUserHistoryBack', [
|
||||||
'class' => 'buttonGrey',
|
'class' => 'buttonGrey',
|
||||||
// Le retour est différent selon que c'est un admin ou un tuteur ou l'utilisateur lui-même
|
// 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')
|
'value' => template::ico('left')
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
@ -13,7 +13,7 @@
|
|||||||
'value' => template::ico('download'),
|
'value' => template::ico('download'),
|
||||||
'help' => 'Exporter rapport',
|
'help' => 'Exporter rapport',
|
||||||
// Le memebre ne peut pas exporter
|
// Le memebre ne peut pas exporter
|
||||||
'disabled' => $this->getUser('role') === self::GROUP_MEMBER
|
'disabled' => $this->getUser('group') === self::GROUP_MEMBER
|
||||||
]) ?>
|
]) ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -135,7 +135,7 @@ class install extends common
|
|||||||
[
|
[
|
||||||
'firstname' => $userFirstname,
|
'firstname' => $userFirstname,
|
||||||
'forgot' => 0,
|
'forgot' => 0,
|
||||||
'role' => self::GROUP_ADMIN,
|
'group' => self::GROUP_ADMIN,
|
||||||
'profil' => 0,
|
'profil' => 0,
|
||||||
'lastname' => $userLastname,
|
'lastname' => $userLastname,
|
||||||
'pseudo' => 'Admin',
|
'pseudo' => 'Admin',
|
||||||
|
@ -645,7 +645,7 @@ class init extends common
|
|||||||
'modulePosition' => 'bottom',
|
'modulePosition' => 'bottom',
|
||||||
'parentPageId' => '',
|
'parentPageId' => '',
|
||||||
'position' => 1,
|
'position' => 1,
|
||||||
'role' => self::GROUP_VISITOR,
|
'group' => self::GROUP_VISITOR,
|
||||||
'profil' => 0,
|
'profil' => 0,
|
||||||
'targetBlank' => false,
|
'targetBlank' => false,
|
||||||
'title' => 'Accueil',
|
'title' => 'Accueil',
|
||||||
@ -676,7 +676,7 @@ class init extends common
|
|||||||
'modulePosition' => 'bottom',
|
'modulePosition' => 'bottom',
|
||||||
'parentPageId' => '',
|
'parentPageId' => '',
|
||||||
'position' => 6,
|
'position' => 6,
|
||||||
'role' => self::GROUP_VISITOR,
|
'group' => self::GROUP_VISITOR,
|
||||||
'profil' => 0,
|
'profil' => 0,
|
||||||
'targetBlank' => false,
|
'targetBlank' => false,
|
||||||
'title' => 'Contact',
|
'title' => 'Contact',
|
||||||
@ -707,7 +707,7 @@ class init extends common
|
|||||||
'modulePosition' => 'bottom',
|
'modulePosition' => 'bottom',
|
||||||
'parentPageId' => '',
|
'parentPageId' => '',
|
||||||
'position' => 0,
|
'position' => 0,
|
||||||
'role' => self::GROUP_VISITOR,
|
'group' => self::GROUP_VISITOR,
|
||||||
'profil' => 0,
|
'profil' => 0,
|
||||||
'targetBlank' => false,
|
'targetBlank' => false,
|
||||||
'title' => 'Mentions légales',
|
'title' => 'Mentions légales',
|
||||||
@ -739,7 +739,7 @@ class init extends common
|
|||||||
'modulePosition' => '',
|
'modulePosition' => '',
|
||||||
'parentPageId' => '',
|
'parentPageId' => '',
|
||||||
'position' => 0,
|
'position' => 0,
|
||||||
'role' => self::GROUP_VISITOR,
|
'group' => self::GROUP_VISITOR,
|
||||||
'profil' => 0,
|
'profil' => 0,
|
||||||
'targetBlank' => false,
|
'targetBlank' => false,
|
||||||
'title' => 'Maintenance en cours',
|
'title' => 'Maintenance en cours',
|
||||||
@ -771,7 +771,7 @@ class init extends common
|
|||||||
'modulePosition' => 'bottom',
|
'modulePosition' => 'bottom',
|
||||||
'parentPageId' => '',
|
'parentPageId' => '',
|
||||||
'position' => 0,
|
'position' => 0,
|
||||||
'role' => self::GROUP_VISITOR,
|
'group' => self::GROUP_VISITOR,
|
||||||
'profil' => 0,
|
'profil' => 0,
|
||||||
'targetBlank' => false,
|
'targetBlank' => false,
|
||||||
'title' => 'Erreur 403',
|
'title' => 'Erreur 403',
|
||||||
@ -802,7 +802,7 @@ class init extends common
|
|||||||
'modulePosition' => 'bottom',
|
'modulePosition' => 'bottom',
|
||||||
'parentPageId' => '',
|
'parentPageId' => '',
|
||||||
'position' => 0,
|
'position' => 0,
|
||||||
'role' => self::GROUP_VISITOR,
|
'group' => self::GROUP_VISITOR,
|
||||||
'profil' => 0,
|
'profil' => 0,
|
||||||
'targetBlank' => false,
|
'targetBlank' => false,
|
||||||
'title' => 'Erreur 404',
|
'title' => 'Erreur 404',
|
||||||
@ -938,7 +938,7 @@ class init extends common
|
|||||||
'config' => [
|
'config' => [
|
||||||
'button' => '',
|
'button' => '',
|
||||||
'captcha' => true,
|
'captcha' => true,
|
||||||
'role' => self::GROUP_ADMIN,
|
'group' => self::GROUP_ADMIN,
|
||||||
'pageId' => '',
|
'pageId' => '',
|
||||||
'subject' => ''
|
'subject' => ''
|
||||||
],
|
],
|
||||||
@ -1065,7 +1065,7 @@ class init extends common
|
|||||||
'modulePosition' => 'bottom',
|
'modulePosition' => 'bottom',
|
||||||
'parentPageId' => '',
|
'parentPageId' => '',
|
||||||
'position' => 1,
|
'position' => 1,
|
||||||
'role' => self::GROUP_VISITOR,
|
'group' => self::GROUP_VISITOR,
|
||||||
'profil' => 0,
|
'profil' => 0,
|
||||||
'targetBlank' => false,
|
'targetBlank' => false,
|
||||||
'title' => 'Sommaire',
|
'title' => 'Sommaire',
|
||||||
@ -1096,7 +1096,7 @@ class init extends common
|
|||||||
'modulePosition' => 'bottom',
|
'modulePosition' => 'bottom',
|
||||||
'parentPageId' => '',
|
'parentPageId' => '',
|
||||||
'position' => 1,
|
'position' => 1,
|
||||||
'role' => self::GROUP_VISITOR,
|
'group' => self::GROUP_VISITOR,
|
||||||
'profil' => 0,
|
'profil' => 0,
|
||||||
'targetBlank' => false,
|
'targetBlank' => false,
|
||||||
'title' => 'Première page',
|
'title' => 'Première page',
|
||||||
@ -1127,7 +1127,7 @@ class init extends common
|
|||||||
'modulePosition' => 'bottom',
|
'modulePosition' => 'bottom',
|
||||||
'parentPageId' => '',
|
'parentPageId' => '',
|
||||||
'position' => 1,
|
'position' => 1,
|
||||||
'role' => self::GROUP_VISITOR,
|
'group' => self::GROUP_VISITOR,
|
||||||
'profil' => 0,
|
'profil' => 0,
|
||||||
'targetBlank' => false,
|
'targetBlank' => false,
|
||||||
'title' => 'Seconde page',
|
'title' => 'Seconde page',
|
||||||
@ -1158,7 +1158,7 @@ class init extends common
|
|||||||
'modulePosition' => 'bottom',
|
'modulePosition' => 'bottom',
|
||||||
'parentPageId' => '',
|
'parentPageId' => '',
|
||||||
'position' => 1,
|
'position' => 1,
|
||||||
'role' => self::GROUP_VISITOR,
|
'group' => self::GROUP_VISITOR,
|
||||||
'profil' => 0,
|
'profil' => 0,
|
||||||
'targetBlank' => false,
|
'targetBlank' => false,
|
||||||
'title' => 'Troisième page',
|
'title' => 'Troisième page',
|
||||||
@ -1189,7 +1189,7 @@ class init extends common
|
|||||||
'modulePosition' => 'bottom',
|
'modulePosition' => 'bottom',
|
||||||
'parentPageId' => '',
|
'parentPageId' => '',
|
||||||
'position' => 0,
|
'position' => 0,
|
||||||
'role' => 0,
|
'group' => 0,
|
||||||
'profil' => 0,
|
'profil' => 0,
|
||||||
'targetBlank' => false,
|
'targetBlank' => false,
|
||||||
'title' => 'Menu',
|
'title' => 'Menu',
|
||||||
|
@ -261,9 +261,9 @@
|
|||||||
"Grande (220%)": "Grande (220%)",
|
"Grande (220%)": "Grande (220%)",
|
||||||
"Grande (300px)": "Grande (300px)",
|
"Grande (300px)": "Grande (300px)",
|
||||||
"Gras": "Bold",
|
"Gras": "Bold",
|
||||||
"Role": "role",
|
"Groupe": "Group",
|
||||||
"Role associé": "Associated role",
|
"Groupe associé": "Associated Group",
|
||||||
"Role requis pour accéder à la page :": "role required to access the page:",
|
"Groupe requis pour accéder à la page :": "Group required to access the page:",
|
||||||
"Groupes": "Groups",
|
"Groupes": "Groups",
|
||||||
"Générer sitemap.xml et robots.txt": "Generate sitemap.xml and robots.txt",
|
"Générer sitemap.xml et robots.txt": "Generate sitemap.xml and robots.txt",
|
||||||
"Générer une capture Open Graph": "Generate an Open Graph capture",
|
"Générer une capture Open Graph": "Generate an Open Graph capture",
|
||||||
@ -295,7 +295,7 @@
|
|||||||
"Importer dans": "Import into",
|
"Importer dans": "Import into",
|
||||||
"Importer des utilisateurs en masse": "Import mass users",
|
"Importer des utilisateurs en masse": "Import mass users",
|
||||||
"Impossible d'ouvrir l'archive": "Impossible to open the archive",
|
"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 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 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",
|
"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.",
|
"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",
|
||||||
"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.",
|
"Proportionnelle à la taille définie dans le site.": "Proportional to the size defined in the site.",
|
||||||
"Prénom": "First name",
|
"Prénom": "First name",
|
||||||
"Prénom Nom": "First name Name",
|
"Prénom Nom": "First name Name",
|
||||||
@ -695,7 +695,7 @@
|
|||||||
"Message de test envoyé avec succès": "Test message sent successfully",
|
"Message de test envoyé avec succès": "Test message sent successfully",
|
||||||
"Message non envoyé": "Message not sent",
|
"Message non envoyé": "Message not sent",
|
||||||
"Validation par clé ⚠️": "Key-based validation ⚠️",
|
"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",
|
"Envoi du message d'authentification": "Sending authentication message",
|
||||||
"Connexion réussie": "Login successful",
|
"Connexion réussie": "Login successful",
|
||||||
"Erreur de mot de passe": "Password error",
|
"Erreur de mot de passe": "Password error",
|
||||||
|
@ -261,9 +261,9 @@
|
|||||||
"Grande (220%)": "Grande (220%)",
|
"Grande (220%)": "Grande (220%)",
|
||||||
"Grande (300px)": "Grande (300px)",
|
"Grande (300px)": "Grande (300px)",
|
||||||
"Gras": "Negrita",
|
"Gras": "Negrita",
|
||||||
"Role": "Grupo",
|
"Groupe": "Grupo",
|
||||||
"Role associé": "Grupo asociado",
|
"Groupe associé": "Grupo asociado",
|
||||||
"Role requis pour accéder à la page :": "Grupo necesario para acceder a la página:",
|
"Groupe requis pour accéder à la page :": "Grupo necesario para acceder a la página:",
|
||||||
"Groupes": "Grupos",
|
"Groupes": "Grupos",
|
||||||
"Générer sitemap.xml et robots.txt": "Generar sitemap.xml y robots.txt",
|
"Générer sitemap.xml et robots.txt": "Generar sitemap.xml y robots.txt",
|
||||||
"Générer une capture Open Graph": "Generar una captura de Open Graph",
|
"Générer une capture Open Graph": "Generar una captura de Open Graph",
|
||||||
@ -295,7 +295,7 @@
|
|||||||
"Importer dans": "Importar a",
|
"Importer dans": "Importar a",
|
||||||
"Importer des utilisateurs en masse": "Importar usuarios de forma masiva",
|
"Importer des utilisateurs en masse": "Importar usuarios de forma masiva",
|
||||||
"Impossible d'ouvrir l'archive": "No se puede abrir el archivo",
|
"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 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 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",
|
"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 de test envoyé avec succès": "Mensaje de prueba enviado con éxito",
|
||||||
"Message non envoyé": "Mensaje no enviado",
|
"Message non envoyé": "Mensaje no enviado",
|
||||||
"Validation par clé ⚠️": "Validación por clave ⚠️",
|
"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",
|
"Envoi du message d'authentification": "Envío del mensaje de autenticación",
|
||||||
"Connexion réussie": "Conexión exitosa",
|
"Connexion réussie": "Conexión exitosa",
|
||||||
"Erreur de mot de passe": "Error de contraseña",
|
"Erreur de mot de passe": "Error de contraseña",
|
||||||
|
@ -261,9 +261,9 @@
|
|||||||
"Grande (220%)": "",
|
"Grande (220%)": "",
|
||||||
"Grande (300px)": "",
|
"Grande (300px)": "",
|
||||||
"Gras": "",
|
"Gras": "",
|
||||||
"Role": "",
|
"Groupe": "",
|
||||||
"Role associé": "",
|
"Groupe associé": "",
|
||||||
"Role requis pour accéder à la page :": "",
|
"Groupe requis pour accéder à la page :": "",
|
||||||
"Groupes": "",
|
"Groupes": "",
|
||||||
"Générer sitemap.xml et robots.txt": "",
|
"Générer sitemap.xml et robots.txt": "",
|
||||||
"Générer une capture Open Graph": "",
|
"Générer une capture Open Graph": "",
|
||||||
@ -295,7 +295,7 @@
|
|||||||
"Importer dans": "",
|
"Importer dans": "",
|
||||||
"Importer des utilisateurs en masse": "",
|
"Importer des utilisateurs en masse": "",
|
||||||
"Impossible d'ouvrir l'archive": "",
|
"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 soumettre le formulaire, car il contient des erreurs": "",
|
||||||
"Impossible de supprimer une page contenant des pages enfants": "",
|
"Impossible de supprimer une page contenant des pages enfants": "",
|
||||||
"Impossible de supprimer votre propre compte": "",
|
"Impossible de supprimer votre propre compte": "",
|
||||||
@ -695,7 +695,7 @@
|
|||||||
"Message de test envoyé avec succès": "",
|
"Message de test envoyé avec succès": "",
|
||||||
"Message non envoyé": "",
|
"Message non envoyé": "",
|
||||||
"Validation par clé ⚠️": "",
|
"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": "",
|
"Envoi du message d'authentification": "",
|
||||||
"Connexion réussie": "",
|
"Connexion réussie": "",
|
||||||
"Erreur de mot de passe": "",
|
"Erreur de mot de passe": "",
|
||||||
|
@ -180,7 +180,7 @@ class page extends common
|
|||||||
'parentPageId' => '',
|
'parentPageId' => '',
|
||||||
'modulePosition' => 'bottom',
|
'modulePosition' => 'bottom',
|
||||||
'position' => 0,
|
'position' => 0,
|
||||||
'role' => self::GROUP_VISITOR,
|
'group' => self::GROUP_VISITOR,
|
||||||
'targetBlank' => false,
|
'targetBlank' => false,
|
||||||
'title' => $pageTitle,
|
'title' => $pageTitle,
|
||||||
'shortTitle' => $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
|
// Détermine le groupe selon que la page est une barre ou une page standard
|
||||||
$role = $this->getinput('pageEditBlock') !== 'bar' ? $this->getInput('pageEditGroup', helper::FILTER_INT) : 0;
|
$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;
|
$profil = 0;
|
||||||
if (
|
if (
|
||||||
$this->getinput('pageEditBlock') !== 'bar' ||
|
$this->getinput('pageEditBlock') !== 'bar' ||
|
||||||
$role === 1 ||
|
$group === 1 ||
|
||||||
$role === 2
|
$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é
|
// 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'),
|
'modulePosition' => $this->getInput('pageModulePosition'),
|
||||||
'parentPageId' => $this->getInput('pageEditParentPageId'),
|
'parentPageId' => $this->getInput('pageEditParentPageId'),
|
||||||
'position' => $position,
|
'position' => $position,
|
||||||
'role' => $role,
|
'group' => $group,
|
||||||
'profil' => $profil,
|
'profil' => $profil,
|
||||||
'targetBlank' => $this->getInput('pageEditTargetBlank', helper::FILTER_BOOLEAN),
|
'targetBlank' => $this->getInput('pageEditTargetBlank', helper::FILTER_BOOLEAN),
|
||||||
'title' => $this->getInput('pageEditTitle', helper::FILTER_STRING_SHORT),
|
'title' => $this->getInput('pageEditTitle', helper::FILTER_STRING_SHORT),
|
||||||
|
@ -359,8 +359,8 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class='col6'>
|
<div class='col6'>
|
||||||
<?php echo template::select('pageEditGroup', self::$groupPublics, [
|
<?php echo template::select('pageEditGroup', self::$groupPublics, [
|
||||||
'label' => 'Role minimal pour accéder à la page',
|
'label' => 'Groupe minimal pour accéder à la page',
|
||||||
'selected' => $this->getData(['page', $this->getUrl(2), 'role']),
|
'selected' => $this->getData(['page', $this->getUrl(2), 'group']),
|
||||||
'help' => 'Les groupes de niveau supérieur accèdent à la page.'
|
'help' => 'Les groupes de niveau supérieur accèdent à la page.'
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
|
@ -29,7 +29,7 @@ class sitemap extends common
|
|||||||
$items = '<ul>';
|
$items = '<ul>';
|
||||||
foreach ($this->getHierarchy(null, true, null) as $parentId => $childIds) {
|
foreach ($this->getHierarchy(null, true, null) as $parentId => $childIds) {
|
||||||
$items .= ' <li>';
|
$items .= ' <li>';
|
||||||
if ($this->getData(['page', $parentId, 'disable']) === false && $this->getUser('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);
|
$pageUrl = ($parentId !== $this->homePageId()) ? helper::baseUrl() . $parentId : helper::baseUrl(false);
|
||||||
$items .= '<a href="' . $pageUrl . '">' . $this->getData(['page', $parentId, 'title']) . '</a>';
|
$items .= '<a href="' . $pageUrl . '">' . $this->getData(['page', $parentId, 'title']) . '</a>';
|
||||||
} else {
|
} else {
|
||||||
@ -66,7 +66,7 @@ class sitemap extends common
|
|||||||
$items .= '<ul>';
|
$items .= '<ul>';
|
||||||
// Sous-page
|
// Sous-page
|
||||||
$items .= ' <li>';
|
$items .= ' <li>';
|
||||||
if ($this->getData(['page', $childId, 'disable']) === false && $this->getUser('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);
|
$pageUrl = ($childId !== $this->homePageId()) ? helper::baseUrl() . $childId : helper::baseUrl(false);
|
||||||
$items .= '<a href="' . $pageUrl . '">' . $this->getData(['page', $childId, 'title']) . '</a>';
|
$items .= '<a href="' . $pageUrl . '">' . $this->getData(['page', $childId, 'title']) . '</a>';
|
||||||
} else {
|
} else {
|
||||||
|
@ -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"
|
jm1;Membre1;Jean;jean.membre1@email.fr;1;1;jEan05;"adhérent"
|
||||||
am2;Membre2;Albert;albert.membre2@email.fr;1;1;alBertAG;"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"
|
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);
|
$password = $this->getInput('userAddPassword', helper::FILTER_PASSWORD, true);
|
||||||
|
|
||||||
// Profil
|
// Profil
|
||||||
$role = $this->getInput('userAddGroup', helper::FILTER_INT, true);
|
$group = $this->getInput('userAddGroup', helper::FILTER_INT, true);
|
||||||
$profil = 0;
|
$profil = 0;
|
||||||
if ($role === 1 || $role === 2) {
|
if ($group === 1 || $group === 2) {
|
||||||
$profil = $this->getInput('userAddProfil' . $role, helper::FILTER_INT);
|
$profil = $this->getInput('userAddProfil' . $group, helper::FILTER_INT);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Stockage des données
|
// Stockage des données
|
||||||
@ -124,7 +124,7 @@ class user extends common
|
|||||||
[
|
[
|
||||||
'firstname' => $userFirstname,
|
'firstname' => $userFirstname,
|
||||||
'forgot' => 0,
|
'forgot' => 0,
|
||||||
'role' => $role,
|
'group' => $group,
|
||||||
'profil' => $profil,
|
'profil' => $profil,
|
||||||
'lastname' => $userLastname,
|
'lastname' => $userLastname,
|
||||||
'pseudo' => $pseudo,
|
'pseudo' => $pseudo,
|
||||||
@ -208,8 +208,8 @@ class user extends common
|
|||||||
$this->getUser('permission', __CLASS__, __FUNCTION__) !== true ||
|
$this->getUser('permission', __CLASS__, __FUNCTION__) !== true ||
|
||||||
// L'utilisateur n'existe pas
|
// L'utilisateur n'existe pas
|
||||||
$this->getData(['user', $this->getUrl(2)]) === null
|
$this->getData(['user', $this->getUrl(2)]) === null
|
||||||
// Role insuffisant
|
// Groupe insuffisant
|
||||||
and ($this->getUrl('role') < self::GROUP_EDITOR)
|
and ($this->getUrl('group') < self::GROUP_EDITOR)
|
||||||
) {
|
) {
|
||||||
// Valeurs en sortie
|
// Valeurs en sortie
|
||||||
$this->addOutput([
|
$this->addOutput([
|
||||||
@ -302,7 +302,7 @@ class user extends common
|
|||||||
case "2":
|
case "2":
|
||||||
foreach ($groupValue as $profilId => $profilValue) {
|
foreach ($groupValue as $profilId => $profilValue) {
|
||||||
if ($profilId) {
|
if ($profilId) {
|
||||||
self::$usersGroups[$groupId . $profilId] = sprintf(helper::translate('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;
|
$profils[$groupId . $profilId] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -323,8 +323,8 @@ class user extends common
|
|||||||
foreach ($users as $userId => $userValue) {
|
foreach ($users as $userId => $userValue) {
|
||||||
|
|
||||||
// Compte les rôles
|
// Compte les rôles
|
||||||
if (isset($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, 'role']) . $this->getData(['user', $userId, 'profil'])]++;
|
$profils[$this->getData(['user', $userId, 'group']) . $this->getData(['user', $userId, 'profil'])]++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Filtres
|
// Filtres
|
||||||
@ -334,14 +334,14 @@ class user extends common
|
|||||||
|| isset($_POST['usersFilterLastName'])
|
|| isset($_POST['usersFilterLastName'])
|
||||||
) {
|
) {
|
||||||
|
|
||||||
// Role et profils
|
// Groupe et profils
|
||||||
$role = (string) $this->getData(['user', $userId, 'role']);
|
$group = (string) $this->getData(['user', $userId, 'group']);
|
||||||
$profil = (string) $this->getData(['user', $userId, 'profil']);
|
$profil = (string) $this->getData(['user', $userId, 'profil']);
|
||||||
$firstName = $this->getData(['user', $userId, 'firstname']);
|
$firstName = $this->getData(['user', $userId, 'firstname']);
|
||||||
$lastName = $this->getData(['user', $userId, 'lastname']);
|
$lastName = $this->getData(['user', $userId, 'lastname']);
|
||||||
if (
|
if (
|
||||||
$this->getInput('usersFilterGroup', helper::FILTER_INT) > 0
|
$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;
|
continue;
|
||||||
// Première lettre du prénom
|
// Première lettre du prénom
|
||||||
@ -409,10 +409,10 @@ class user extends common
|
|||||||
and (
|
and (
|
||||||
// Impossible de s'auto-éditer
|
// Impossible de s'auto-éditer
|
||||||
($this->getUser('id') === $this->getUrl(2)
|
($this->getUser('id') === $this->getUrl(2)
|
||||||
and $this->getUrl('role') <= self::GROUP_VISITOR
|
and $this->getUrl('group') <= self::GROUP_VISITOR
|
||||||
)
|
)
|
||||||
// Impossible d'éditer un autre utilisateur
|
// Impossible d'éditer un autre utilisateur
|
||||||
or ($this->getUrl('role') < self::GROUP_EDITOR)
|
or ($this->getUrl('group') < self::GROUP_EDITOR)
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
// Valeurs en sortie
|
// Valeurs en sortie
|
||||||
@ -428,7 +428,7 @@ class user extends common
|
|||||||
) {
|
) {
|
||||||
$oldPassword = $this->getData(['user', $this->getUrl(2), 'password']);
|
$oldPassword = $this->getData(['user', $this->getUrl(2), 'password']);
|
||||||
// Double vérification pour le mot de passe
|
// Double vérification pour le mot de passe
|
||||||
if ($this->getUser('role') < self::GROUP_ADMIN) {
|
if ($this->getUser('group') < self::GROUP_ADMIN) {
|
||||||
if ($this->getInput('userEditNewPassword')) {
|
if ($this->getInput('userEditNewPassword')) {
|
||||||
// L'ancien mot de passe est correct
|
// L'ancien mot de passe est correct
|
||||||
if (
|
if (
|
||||||
@ -463,17 +463,17 @@ class user extends common
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Modification du role
|
// Modification du groupe
|
||||||
if (
|
if (
|
||||||
$this->getUser('role') === self::GROUP_ADMIN
|
$this->getUser('group') === self::GROUP_ADMIN
|
||||||
and $this->getUrl(2) !== $this->getUser('id')
|
and $this->getUrl(2) !== $this->getUser('id')
|
||||||
) {
|
) {
|
||||||
$newGroup = $this->getInput('userEditGroup', helper::FILTER_INT, true);
|
$newGroup = $this->getInput('userEditGroup', helper::FILTER_INT, true);
|
||||||
} else {
|
} else {
|
||||||
$newGroup = $this->getData(['user', $this->getUrl(2), 'role']);
|
$newGroup = $this->getData(['user', $this->getUrl(2), 'group']);
|
||||||
}
|
}
|
||||||
// Modification de nom Prénom
|
// 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);
|
$newfirstname = $this->getInput('userEditFirstname', helper::FILTER_STRING_SHORT, true);
|
||||||
$newlastname = $this->getInput('userEditLastname', helper::FILTER_STRING_SHORT, true);
|
$newlastname = $this->getInput('userEditLastname', helper::FILTER_STRING_SHORT, true);
|
||||||
} else {
|
} else {
|
||||||
@ -492,7 +492,7 @@ class user extends common
|
|||||||
[
|
[
|
||||||
'firstname' => $newfirstname,
|
'firstname' => $newfirstname,
|
||||||
'forgot' => 0,
|
'forgot' => 0,
|
||||||
'role' => $newGroup,
|
'group' => $newGroup,
|
||||||
'profil' => $profil,
|
'profil' => $profil,
|
||||||
'lastname' => $newlastname,
|
'lastname' => $newlastname,
|
||||||
'pseudo' => $this->getInput('userEditPseudo', helper::FILTER_STRING_SHORT, true),
|
'pseudo' => $this->getInput('userEditPseudo', helper::FILTER_STRING_SHORT, true),
|
||||||
@ -515,7 +515,7 @@ class user extends common
|
|||||||
$redirect = helper::baseUrl() . 'user/login/' . str_replace('/', '_', $this->getUrl());
|
$redirect = helper::baseUrl() . 'user/login/' . str_replace('/', '_', $this->getUrl());
|
||||||
}
|
}
|
||||||
// Redirection si retour en arrière possible
|
// Redirection si retour en arrière possible
|
||||||
elseif ($this->getUser('role') === self::GROUP_ADMIN) {
|
elseif ($this->getUser('group') === self::GROUP_ADMIN) {
|
||||||
$redirect = helper::baseUrl() . 'user';
|
$redirect = helper::baseUrl() . 'user';
|
||||||
}
|
}
|
||||||
// Redirection normale
|
// Redirection normale
|
||||||
@ -629,7 +629,7 @@ class user extends common
|
|||||||
case "2":
|
case "2":
|
||||||
foreach ($groupValue as $profilId => $profilValue) {
|
foreach ($groupValue as $profilId => $profilValue) {
|
||||||
if ($profilId) {
|
if ($profilId) {
|
||||||
self::$usersGroups[$groupId . $profilId] = sprintf(helper::translate('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;
|
$profils[$groupId . $profilId] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -646,23 +646,23 @@ class user extends common
|
|||||||
$userIdsLastNames = helper::arrayColumn($this->getData(['user']), 'lastname');
|
$userIdsLastNames = helper::arrayColumn($this->getData(['user']), 'lastname');
|
||||||
ksort($userIdsLastNames);
|
ksort($userIdsLastNames);
|
||||||
foreach ($userIdsLastNames as $userId => $userLastNames) {
|
foreach ($userIdsLastNames as $userId => $userLastNames) {
|
||||||
if ($this->getData(['user', $userId, 'role'])) {
|
if ($this->getData(['user', $userId, 'group'])) {
|
||||||
|
|
||||||
// Compte les rôles
|
// Compte les rôles
|
||||||
if (isset($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, 'role']) . $this->getData(['user', $userId, 'profil'])]++;
|
$profils[$this->getData(['user', $userId, 'group']) . $this->getData(['user', $userId, 'profil'])]++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Filtres
|
// Filtres
|
||||||
if ($this->isPost()) {
|
if ($this->isPost()) {
|
||||||
// Role et profils
|
// Groupe et profils
|
||||||
$role = (string) $this->getData(['user', $userId, 'role']);
|
$group = (string) $this->getData(['user', $userId, 'group']);
|
||||||
$profil = (string) $this->getData(['user', $userId, 'profil']);
|
$profil = (string) $this->getData(['user', $userId, 'profil']);
|
||||||
$firstName = $this->getData(['user', $userId, 'firstname']);
|
$firstName = $this->getData(['user', $userId, 'firstname']);
|
||||||
$lastName = $this->getData(['user', $userId, 'lastname']);
|
$lastName = $this->getData(['user', $userId, 'lastname']);
|
||||||
if (
|
if (
|
||||||
$this->getInput('userFilterGroup', helper::FILTER_INT) > 0
|
$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;
|
continue;
|
||||||
// Première lettre du prénom
|
// Première lettre du prénom
|
||||||
@ -683,10 +683,10 @@ class user extends common
|
|||||||
self::$users[] = [
|
self::$users[] = [
|
||||||
//$userId,
|
//$userId,
|
||||||
sprintf('%s %s', $userLastNames, $this->getData(['user', $userId, 'firstname'])),
|
sprintf('%s %s', $userLastNames, $this->getData(['user', $userId, 'firstname'])),
|
||||||
helper::translate(self::$groups[(int) $this->getData(['user', $userId, 'role'])]),
|
helper::translate(self::$groups[(int) $this->getData(['user', $userId, 'group'])]),
|
||||||
empty($this->getData(['profil', $this->getData(['user', $userId, 'role']), $this->getData(['user', $userId, 'profil']), 'name']))
|
empty($this->getData(['profil', $this->getData(['user', $userId, 'group']), $this->getData(['user', $userId, 'profil']), 'name']))
|
||||||
? helper::translate(self::$groups[(int) $this->getData(['user', $userId, 'role'])])
|
? helper::translate(self::$groups[(int) $this->getData(['user', $userId, 'group'])])
|
||||||
: $this->getData(['profil', $this->getData(['user', $userId, 'role']), $this->getData(['user', $userId, 'profil']), 'name']),
|
: $this->getData(['profil', $this->getData(['user', $userId, 'group']), $this->getData(['user', $userId, 'profil']), 'name']),
|
||||||
$this->getData(['user', $userId, 'tags']),
|
$this->getData(['user', $userId, 'tags']),
|
||||||
is_null($this->getData(['user', $userId, 'accessTimer']))
|
is_null($this->getData(['user', $userId, 'accessTimer']))
|
||||||
? 'Jamais'
|
? 'Jamais'
|
||||||
@ -734,8 +734,8 @@ class user extends common
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Ne pas supprimer un profil utililsé
|
// Ne pas supprimer un profil utililsé
|
||||||
// recherche les membres du role
|
// recherche les membres du groupe
|
||||||
$groups = helper::arrayColumn($this->getData(['user']), 'role');
|
$groups = helper::arrayColumn($this->getData(['user']), 'group');
|
||||||
$groups = array_keys($groups, $this->getUrl(2));
|
$groups = array_keys($groups, $this->getUrl(2));
|
||||||
$profilUsed = true;
|
$profilUsed = true;
|
||||||
// Stoppe si le profil est affecté
|
// Stoppe si le profil est affecté
|
||||||
@ -801,7 +801,7 @@ class user extends common
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Edition d'un role
|
* Edition d'un groupe
|
||||||
*/
|
*/
|
||||||
public function profilEdit()
|
public function profilEdit()
|
||||||
{
|
{
|
||||||
@ -813,7 +813,7 @@ class user extends common
|
|||||||
) {
|
) {
|
||||||
|
|
||||||
// Effacer les données du numéro de profil ancien
|
// 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
|
// Les profils 1 sont désactivés dans le formulaire
|
||||||
$profil = empty($this->getInput('profilEditProfil')) ? '1' : $this->getInput('profilEditProfil');
|
$profil = empty($this->getInput('profilEditProfil')) ? '1' : $this->getInput('profilEditProfil');
|
||||||
$oldProfil = $this->getInput('profilEditOldProfil', helper::FILTER_STRING_SHORT);
|
$oldProfil = $this->getInput('profilEditOldProfil', helper::FILTER_STRING_SHORT);
|
||||||
@ -821,15 +821,15 @@ class user extends common
|
|||||||
$fileManager = $this->getInput('profilEditFileManager', helper::FILTER_BOOLEAN);
|
$fileManager = $this->getInput('profilEditFileManager', helper::FILTER_BOOLEAN);
|
||||||
// Sécurité supplémentaire
|
// Sécurité supplémentaire
|
||||||
if (
|
if (
|
||||||
$role < self::GROUP_MEMBER
|
$group < self::GROUP_MEMBER
|
||||||
) {
|
) {
|
||||||
$fileManager = false;
|
$fileManager = false;
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
$profil !== $oldProfil &&
|
$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
|
// Données du formulaire
|
||||||
$data = [
|
$data = [
|
||||||
@ -932,7 +932,7 @@ class user extends common
|
|||||||
//Sauvegarder le données
|
//Sauvegarder le données
|
||||||
$this->setData([
|
$this->setData([
|
||||||
'profil',
|
'profil',
|
||||||
$role,
|
$group,
|
||||||
$profil,
|
$profil,
|
||||||
$data
|
$data
|
||||||
]);
|
]);
|
||||||
@ -1017,14 +1017,14 @@ class user extends common
|
|||||||
$this->getUser('permission', __CLASS__, __FUNCTION__) === true &&
|
$this->getUser('permission', __CLASS__, __FUNCTION__) === true &&
|
||||||
$this->isPost()
|
$this->isPost()
|
||||||
) {
|
) {
|
||||||
// Nombre de profils de ce role
|
// Nombre de profils de ce groupe
|
||||||
$role = $this->getInput('profilAddGroup');
|
$group = $this->getInput('profilAddGroup');
|
||||||
$profil = count($this->getData(['profil', $role]));
|
$profil = count($this->getData(['profil', $group]));
|
||||||
// Gère le chemin
|
// Gère le chemin
|
||||||
$fileManager = $this->getInput('profilAddFileManager', helper::FILTER_BOOLEAN);
|
$fileManager = $this->getInput('profilAddFileManager', helper::FILTER_BOOLEAN);
|
||||||
// Sécurité supplémentaire
|
// Sécurité supplémentaire
|
||||||
if (
|
if (
|
||||||
$role < self::GROUP_MEMBER
|
$group < self::GROUP_MEMBER
|
||||||
) {
|
) {
|
||||||
$fileManager = false;
|
$fileManager = false;
|
||||||
}
|
}
|
||||||
@ -1129,7 +1129,7 @@ class user extends common
|
|||||||
// Sauvegarder les données
|
// Sauvegarder les données
|
||||||
$this->setData([
|
$this->setData([
|
||||||
'profil',
|
'profil',
|
||||||
$role,
|
$group,
|
||||||
$profil,
|
$profil,
|
||||||
$data
|
$data
|
||||||
]);
|
]);
|
||||||
@ -1198,8 +1198,8 @@ class user extends common
|
|||||||
public function profilDelete()
|
public function profilDelete()
|
||||||
{
|
{
|
||||||
// Ne pas supprimer un profil utililsé
|
// Ne pas supprimer un profil utililsé
|
||||||
// recherche les membres du role
|
// recherche les membres du groupe
|
||||||
$groups = helper::arrayColumn($this->getData(['user']), 'role');
|
$groups = helper::arrayColumn($this->getData(['user']), 'group');
|
||||||
$groups = array_keys($groups, $this->getUrl(2));
|
$groups = array_keys($groups, $this->getUrl(2));
|
||||||
$flag = true;
|
$flag = true;
|
||||||
// Stoppe si le profil est affecté
|
// Stoppe si le profil est affecté
|
||||||
@ -1301,12 +1301,12 @@ class user extends common
|
|||||||
$this->setData(['user', $userId, 'connectTimeout', 0], false);
|
$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
|
// 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 (
|
if (
|
||||||
($this->getData(['user', $userId, 'connectTimeout']) + $this->getData(['config', 'connect', 'timeout'])) < time()
|
($this->getData(['user', $userId, 'connectTimeout']) + $this->getData(['config', 'connect', 'timeout'])) < time()
|
||||||
and $this->getData(['user', $userId, 'connectFail']) < $this->getData(['config', 'connect', 'attempt'])
|
and $this->getData(['user', $userId, 'connectFail']) < $this->getData(['config', 'connect', 'attempt'])
|
||||||
and password_verify(html_entity_decode($this->getInput('userLoginPassword', helper::FILTER_STRING_SHORT, true)), $this->getData(['user', $userId, 'password']))
|
and password_verify(html_entity_decode($this->getInput('userLoginPassword', helper::FILTER_STRING_SHORT, true)), $this->getData(['user', $userId, 'password']))
|
||||||
and $this->getData(['user', $userId, 'role']) >= self::GROUP_MEMBER
|
and $this->getData(['user', $userId, 'group']) >= self::GROUP_MEMBER
|
||||||
and $captcha === true
|
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
|
// Valeurs en sortie lorsque le site est en maintenance et que l'utilisateur n'est pas administrateur
|
||||||
if (
|
if (
|
||||||
$this->getData(['config', 'maintenance'])
|
$this->getData(['config', 'maintenance'])
|
||||||
and $this->getData(['user', $userId, 'role']) < self::GROUP_ADMIN
|
and $this->getData(['user', $userId, 'group']) < self::GROUP_ADMIN
|
||||||
) {
|
) {
|
||||||
$this->addOutput([
|
$this->addOutput([
|
||||||
'notification' => helper::translate('Seul un administrateur peut se connecter lors d\'une maintenance'),
|
'notification' => helper::translate('Seul un administrateur peut se connecter lors d\'une maintenance'),
|
||||||
@ -1340,7 +1340,7 @@ class user extends common
|
|||||||
$authRedirect = '';
|
$authRedirect = '';
|
||||||
if (
|
if (
|
||||||
$this->getData(['config', 'connect', 'mailAuth']) > 0
|
$this->getData(['config', 'connect', 'mailAuth']) > 0
|
||||||
&& $this->getData(['user', $userId, 'role']) >= $this->getData(['config', 'connect', 'mailAuth'])
|
&& $this->getData(['user', $userId, 'group']) >= $this->getData(['config', 'connect', 'mailAuth'])
|
||||||
) {
|
) {
|
||||||
/**
|
/**
|
||||||
* Envoi d'un email contenant une clé
|
* Envoi d'un email contenant une clé
|
||||||
@ -1659,7 +1659,7 @@ class user extends common
|
|||||||
array_key_exists('id', $item)
|
array_key_exists('id', $item)
|
||||||
and array_key_exists('prenom', $item)
|
and array_key_exists('prenom', $item)
|
||||||
and array_key_exists('nom', $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('profil', $item)
|
||||||
and array_key_exists('email', $item)
|
and array_key_exists('email', $item)
|
||||||
and array_key_exists('passe', $item)
|
and array_key_exists('passe', $item)
|
||||||
@ -1668,16 +1668,16 @@ class user extends common
|
|||||||
and isset($item['nom'])
|
and isset($item['nom'])
|
||||||
and isset($item['prenom'])
|
and isset($item['prenom'])
|
||||||
and isset($item['email'])
|
and isset($item['email'])
|
||||||
and isset($item['role'])
|
and isset($item['groupe'])
|
||||||
and isset($item['profil'])
|
and isset($item['profil'])
|
||||||
and isset($item['passe'])
|
and isset($item['passe'])
|
||||||
and isset($item['tags'])
|
and isset($item['tags'])
|
||||||
) {
|
) {
|
||||||
// Validation du role
|
// Validation du groupe
|
||||||
$item['role'] = (int) $item['role'];
|
$item['groupe'] = (int) $item['groupe'];
|
||||||
$item['profil'] = (int) $item['profil'];
|
$item['profil'] = (int) $item['profil'];
|
||||||
$item['role'] = ($item['role'] >= self::GROUP_BANNED and $item['role'] <= self::GROUP_ADMIN)
|
$item['groupe'] = ($item['groupe'] >= self::GROUP_BANNED and $item['groupe'] <= self::GROUP_ADMIN)
|
||||||
? $item['role'] : 1;
|
? $item['groupe'] : 1;
|
||||||
// L'utilisateur existe
|
// L'utilisateur existe
|
||||||
$userId = helper::filter($item['id'], helper::FILTER_ID);
|
$userId = helper::filter($item['id'], helper::FILTER_ID);
|
||||||
if ($this->getData(['user', $userId])) {
|
if ($this->getData(['user', $userId])) {
|
||||||
@ -1688,10 +1688,10 @@ class user extends common
|
|||||||
$userId,
|
$userId,
|
||||||
$item['nom'],
|
$item['nom'],
|
||||||
$item['prenom'],
|
$item['prenom'],
|
||||||
self::$groups[$item['role']],
|
self::$groups[$item['groupe']],
|
||||||
empty($this->getData(['profil', $this->getData(['user', $userId, 'role']), $this->getData(['user', $userId, 'profil']), 'name']))
|
empty($this->getData(['profil', $this->getData(['user', $userId, 'group']), $this->getData(['user', $userId, 'profil']), 'name']))
|
||||||
? helper::translate(self::$groups[(int) $this->getData(['user', $userId, 'role'])])
|
? helper::translate(self::$groups[(int) $this->getData(['user', $userId, 'group'])])
|
||||||
: $this->getData(['profil', $this->getData(['user', $userId, 'role']), $this->getData(['user', $userId, 'profil']), 'name']),
|
: $this->getData(['profil', $this->getData(['user', $userId, 'group']), $this->getData(['user', $userId, 'profil']), 'name']),
|
||||||
$item['prenom'],
|
$item['prenom'],
|
||||||
helper::filter($item['email'], helper::FILTER_MAIL),
|
helper::filter($item['email'], helper::FILTER_MAIL),
|
||||||
$item['tags'],
|
$item['tags'],
|
||||||
@ -1707,7 +1707,7 @@ class user extends common
|
|||||||
[
|
[
|
||||||
'firstname' => $item['prenom'],
|
'firstname' => $item['prenom'],
|
||||||
'forgot' => 0,
|
'forgot' => 0,
|
||||||
'role' => $item['role'],
|
'group' => $item['groupe'],
|
||||||
'profil' => $item['profil'],
|
'profil' => $item['profil'],
|
||||||
'lastname' => $item['nom'],
|
'lastname' => $item['nom'],
|
||||||
'mail' => $item['email'],
|
'mail' => $item['email'],
|
||||||
@ -1751,10 +1751,10 @@ class user extends common
|
|||||||
$userId,
|
$userId,
|
||||||
$item['nom'],
|
$item['nom'],
|
||||||
$item['prenom'],
|
$item['prenom'],
|
||||||
self::$groups[$item['role']],
|
self::$groups[$item['groupe']],
|
||||||
empty($this->getData(['profil', $this->getData(['user', $userId, 'role']), $this->getData(['user', $userId, 'profil']), 'name']))
|
empty($this->getData(['profil', $this->getData(['user', $userId, 'group']), $this->getData(['user', $userId, 'profil']), 'name']))
|
||||||
? helper::translate(self::$groups[(int) $this->getData(['user', $userId, 'role'])])
|
? helper::translate(self::$groups[(int) $this->getData(['user', $userId, 'group'])])
|
||||||
: $this->getData(['profil', $this->getData(['user', $userId, 'role']), $this->getData(['user', $userId, 'profil']), 'name']),
|
: $this->getData(['profil', $this->getData(['user', $userId, 'group']), $this->getData(['user', $userId, 'profil']), 'name']),
|
||||||
$item['prenom'],
|
$item['prenom'],
|
||||||
$item['email'],
|
$item['email'],
|
||||||
$item['tags'],
|
$item['tags'],
|
||||||
@ -1864,7 +1864,7 @@ class user extends common
|
|||||||
case "2":
|
case "2":
|
||||||
foreach ($groupValue as $profilId => $profilValue) {
|
foreach ($groupValue as $profilId => $profilValue) {
|
||||||
if ($profilId) {
|
if ($profilId) {
|
||||||
self::$usersGroups[$groupId . $profilId] = sprintf(helper::translate('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;
|
$profils[$groupId . $profilId] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1885,8 +1885,8 @@ class user extends common
|
|||||||
foreach ($users as $userId => $userValue) {
|
foreach ($users as $userId => $userValue) {
|
||||||
|
|
||||||
// Compte les rôles
|
// Compte les rôles
|
||||||
if (isset($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, 'role']) . $this->getData(['user', $userId, 'profil'])]++;
|
$profils[$this->getData(['user', $userId, 'group']) . $this->getData(['user', $userId, 'profil'])]++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Filtres
|
// Filtres
|
||||||
@ -1896,14 +1896,14 @@ class user extends common
|
|||||||
|| isset($_POST['usersFilterLastName'])
|
|| isset($_POST['usersFilterLastName'])
|
||||||
) {
|
) {
|
||||||
|
|
||||||
// Role et profils
|
// Groupe et profils
|
||||||
$role = (string) $this->getData(['user', $userId, 'role']);
|
$group = (string) $this->getData(['user', $userId, 'group']);
|
||||||
$profil = (string) $this->getData(['user', $userId, 'profil']);
|
$profil = (string) $this->getData(['user', $userId, 'profil']);
|
||||||
$firstName = $this->getData(['user', $userId, 'firstname']);
|
$firstName = $this->getData(['user', $userId, 'firstname']);
|
||||||
$lastName = $this->getData(['user', $userId, 'lastname']);
|
$lastName = $this->getData(['user', $userId, 'lastname']);
|
||||||
if (
|
if (
|
||||||
$this->getInput('usersFilterGroup', helper::FILTER_INT) > 0
|
$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;
|
continue;
|
||||||
// Première lettre du prénom
|
// Première lettre du prénom
|
||||||
|
@ -105,7 +105,7 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col6">
|
<div class="col6">
|
||||||
<?php echo template::select('userAddGroup', self::$groupNews, [
|
<?php echo template::select('userAddGroup', self::$groupNews, [
|
||||||
'label' => 'Role',
|
'label' => 'Groupe',
|
||||||
'selected' => self::GROUP_MEMBER
|
'selected' => self::GROUP_MEMBER
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?php echo template::formOpen('userEditForm'); ?>
|
<?php echo template::formOpen('userEditForm'); ?>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col1">
|
<div class="col1">
|
||||||
<?php if ($this->getUser('role') === self::GROUP_ADMIN): ?>
|
<?php if ($this->getUser('group') === self::GROUP_ADMIN): ?>
|
||||||
<?php echo template::button('userEditBack', [
|
<?php echo template::button('userEditBack', [
|
||||||
'class' => 'buttonGrey',
|
'class' => 'buttonGrey',
|
||||||
'href' => helper::baseUrl() . 'user',
|
'href' => helper::baseUrl() . 'user',
|
||||||
@ -29,7 +29,7 @@
|
|||||||
<div class="col6">
|
<div class="col6">
|
||||||
<?php echo template::text('userEditFirstname', [
|
<?php echo template::text('userEditFirstname', [
|
||||||
'autocomplete' => 'off',
|
'autocomplete' => 'off',
|
||||||
'disabled' => $this->getUser('role') > self::GROUP_EDITOR ? false : true,
|
'disabled' => $this->getUser('group') > self::GROUP_EDITOR ? false : true,
|
||||||
'label' => 'Prénom',
|
'label' => 'Prénom',
|
||||||
'value' => $this->getData(['user', $this->getUrl(2), 'firstname'])
|
'value' => $this->getData(['user', $this->getUrl(2), 'firstname'])
|
||||||
]); ?>
|
]); ?>
|
||||||
@ -37,7 +37,7 @@
|
|||||||
<div class="col6">
|
<div class="col6">
|
||||||
<?php echo template::text('userEditLastname', [
|
<?php echo template::text('userEditLastname', [
|
||||||
'autocomplete' => 'off',
|
'autocomplete' => 'off',
|
||||||
'disabled' => $this->getUser('role') > self::GROUP_EDITOR ? false : true,
|
'disabled' => $this->getUser('group') > self::GROUP_EDITOR ? false : true,
|
||||||
'label' => 'Nom',
|
'label' => 'Nom',
|
||||||
'value' => $this->getData(['user', $this->getUrl(2), 'lastname'])
|
'value' => $this->getData(['user', $this->getUrl(2), 'lastname'])
|
||||||
]); ?>
|
]); ?>
|
||||||
@ -77,7 +77,7 @@
|
|||||||
<div class="col12">
|
<div class="col12">
|
||||||
<?php echo template::text('userEditTags', [
|
<?php echo template::text('userEditTags', [
|
||||||
'label' => 'Étiquettes',
|
'label' => 'Étiquettes',
|
||||||
'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']),
|
'value' => $this->getData(['user', $this->getUrl(2), 'tags']),
|
||||||
'help' => 'Les étiquettes sont séparées par des espaces'
|
'help' => 'Les étiquettes sont séparées par des espaces'
|
||||||
]); ?>
|
]); ?>
|
||||||
@ -99,7 +99,7 @@
|
|||||||
]); ?>
|
]); ?>
|
||||||
<?php
|
<?php
|
||||||
// Les admins ont le pouvoir de forcer le changement de mot de passe
|
// Les admins ont le pouvoir de forcer le changement de mot de passe
|
||||||
if ($this->getUser('role') < self::GROUP_ADMIN): ?>
|
if ($this->getUser('group') < self::GROUP_ADMIN): ?>
|
||||||
<?php echo template::password('userEditOldPassword', [
|
<?php echo template::password('userEditOldPassword', [
|
||||||
'autocomplete' => 'new-password',
|
'autocomplete' => 'new-password',
|
||||||
// remplace 'off' pour éviter le pré remplissage auto
|
// remplace 'off' pour éviter le pré remplissage auto
|
||||||
@ -125,16 +125,16 @@
|
|||||||
</h4>
|
</h4>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col12">
|
<div class="col12">
|
||||||
<?php if ($this->getUser('role') === self::GROUP_ADMIN): ?>
|
<?php if ($this->getUser('group') === self::GROUP_ADMIN): ?>
|
||||||
<?php echo template::select('userEditGroup', self::$groupEdits, [
|
<?php echo template::select('userEditGroup', self::$groupEdits, [
|
||||||
'disabled' => ($this->getUrl(2) === $this->getUser('id')),
|
'disabled' => ($this->getUrl(2) === $this->getUser('id')),
|
||||||
'help' => ($this->getUrl(2) === $this->getUser('id') ? 'Impossible de modifier votre propre role.' : ''),
|
'help' => ($this->getUrl(2) === $this->getUser('id') ? 'Impossible de modifier votre propre groupe.' : ''),
|
||||||
'label' => 'Role',
|
'label' => 'Groupe',
|
||||||
'selected' => $this->getData(['user', $this->getUrl(2), 'role']),
|
'selected' => $this->getData(['user', $this->getUrl(2), 'group']),
|
||||||
]); ?>
|
]); ?>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<?php echo template::hidden('userEditGroup', [
|
<?php echo template::hidden('userEditGroup', [
|
||||||
'value' => $this->getData(['user', $this->getUrl(2), 'role'])
|
'value' => $this->getData(['user', $this->getUrl(2), 'group'])
|
||||||
]); ?>
|
]); ?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
@ -143,14 +143,14 @@
|
|||||||
<?php echo template::select('userEditProfil' . self::GROUP_MEMBER, user::$userProfils[self::GROUP_MEMBER], [
|
<?php echo template::select('userEditProfil' . self::GROUP_MEMBER, user::$userProfils[self::GROUP_MEMBER], [
|
||||||
'label' => 'Profil',
|
'label' => 'Profil',
|
||||||
'selected' => $this->getData(['user', $this->getUrl(2), 'profil']),
|
'selected' => $this->getData(['user', $this->getUrl(2), 'profil']),
|
||||||
'disabled' => $this->getUser('role') !== self::GROUP_ADMIN,
|
'disabled' => $this->getUser('group') !== self::GROUP_ADMIN,
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="userEditGroupProfil" id="userEditGroupProfil<?php echo self::GROUP_EDITOR; ?>">
|
<div class="userEditGroupProfil" id="userEditGroupProfil<?php echo self::GROUP_EDITOR; ?>">
|
||||||
<?php echo template::select('userEditProfil' . self::GROUP_EDITOR, user::$userProfils[self::GROUP_EDITOR], [
|
<?php echo template::select('userEditProfil' . self::GROUP_EDITOR, user::$userProfils[self::GROUP_EDITOR], [
|
||||||
'label' => 'Profil',
|
'label' => 'Profil',
|
||||||
'selected' => $this->getData(['user', $this->getUrl(2), 'profil']),
|
'selected' => $this->getData(['user', $this->getUrl(2), 'profil']),
|
||||||
'disabled' => $this->getUser('role') !== self::GROUP_ADMIN,
|
'disabled' => $this->getUser('group') !== self::GROUP_ADMIN,
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -61,7 +61,7 @@
|
|||||||
<?php if (user::$users): ?>
|
<?php if (user::$users): ?>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col12 textAlignCenter">
|
<div class="col12 textAlignCenter">
|
||||||
<?php echo template::table([1, 2, 2, 1, 1, 1, 2, 1, 1], user::$users, ['Id', 'Nom', 'Prénom', '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('check'); ?> Compte créé |
|
||||||
<?php echo template::ico('mail'); ?> Compte créé et notifié |
|
<?php echo template::ico('mail'); ?> Compte créé et notifié |
|
||||||
<?php echo template::ico('cancel'); ?> Erreur dans le fichier ou le compte existe.
|
<?php echo template::ico('cancel'); ?> Erreur dans le fichier ou le compte existe.
|
||||||
|
@ -68,4 +68,4 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php echo template::formClose(); ?>
|
<?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>
|
||||||
<div class="col12">
|
<div class="col12">
|
||||||
<?php echo template::select('profilAddGroup', user::$groupProfils, [
|
<?php echo template::select('profilAddGroup', user::$groupProfils, [
|
||||||
'label' => 'Role associé',
|
'label' => 'Groupe associé',
|
||||||
'selected' => $this->getUrl(2)
|
'selected' => $this->getUrl(2)
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
|
@ -40,7 +40,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col12">
|
<div class="col12">
|
||||||
<?php echo template::text('profilEditDisplayGroup', [
|
<?php echo template::text('profilEditDisplayGroup', [
|
||||||
'label' => 'Role associé',
|
'label' => 'Groupe associé',
|
||||||
'value' => helper::translate(self::$groups[$this->getUrl(2)]),
|
'value' => helper::translate(self::$groups[$this->getUrl(2)]),
|
||||||
'disabled' => true
|
'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';
|
$lang = isset($_GET['lang']) ? $_GET['lang'] : 'fr_FR';
|
||||||
setlocale(LC_CTYPE, $lang);
|
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'];
|
$userId = $_COOKIE['ZWII_USER_ID'];
|
||||||
$courseId = isset($_GET['fldr']) ? $_GET['fldr'] : '';
|
$courseId = isset($_GET['fldr']) ? $_GET['fldr'] : '';
|
||||||
$u = json_decode(file_get_contents('../../../site/data/user.json'), true);
|
$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
|
// Lecture les droits
|
||||||
if (!is_null($u) && !is_null($g) && !is_null($userId)) {
|
if (!is_null($u) && !is_null($g) && !is_null($userId)) {
|
||||||
$role = $u['user'][$userId]['role'];
|
$group = $u['user'][$userId]['group'];
|
||||||
switch ($role) {
|
switch ($group) {
|
||||||
case 3:
|
case 3:
|
||||||
// Accès admin
|
// Accès admin
|
||||||
$file['delete'] = true;
|
$file['delete'] = true;
|
||||||
@ -52,12 +52,12 @@ if (!is_null($u) && !is_null($g) && !is_null($userId)) {
|
|||||||
case 1:
|
case 1:
|
||||||
// Accès contrôlés par le profil
|
// Accès contrôlés par le profil
|
||||||
$profil = $u['user'][$userId]['profil'];
|
$profil = $u['user'][$userId]['profil'];
|
||||||
$file = $g['profil'][$role][$profil]['file'];
|
$file = $g['profil'][$group][$profil]['file'];
|
||||||
$folder = $g['profil'][$role][$profil]['folder'];
|
$folder = $g['profil'][$group][$profil]['folder'];
|
||||||
// membre sans profil déclaré ou accès interdit, pas d'accès
|
// membre sans profil déclaré ou accès interdit, pas d'accès
|
||||||
if (
|
if (
|
||||||
is_null($profil)
|
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>");
|
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 DATADIRECTORY = ''; // Contenu localisé inclus par défaut (page.json et module.json)
|
||||||
|
|
||||||
const EDIT_OWNER = 'owner';
|
const EDIT_OWNER = 'owner';
|
||||||
const EDIT_GROUP = 'role';
|
const EDIT_GROUP = 'group';
|
||||||
const EDIT_ALL = 'all';
|
const EDIT_ALL = 'all';
|
||||||
|
|
||||||
public static $actions = [
|
public static $actions = [
|
||||||
@ -112,7 +112,7 @@ class blog extends common
|
|||||||
// Permissions d'un article
|
// Permissions d'un article
|
||||||
public static $articleConsent = [
|
public static $articleConsent = [
|
||||||
self::EDIT_ALL => 'Tous les groupes',
|
self::EDIT_ALL => 'Tous les groupes',
|
||||||
self::EDIT_GROUP => 'Role du propriétaire',
|
self::EDIT_GROUP => 'Groupe du propriétaire',
|
||||||
self::EDIT_OWNER => 'Propriétaire'
|
self::EDIT_OWNER => 'Propriétaire'
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -259,7 +259,7 @@ class blog extends common
|
|||||||
$this->isPost()
|
$this->isPost()
|
||||||
) {
|
) {
|
||||||
// Modification de l'userId
|
// Modification de l'userId
|
||||||
if ($this->getUser('role') === self::GROUP_ADMIN) {
|
if ($this->getUser('group') === self::GROUP_ADMIN) {
|
||||||
$newuserid = $this->getInput('blogAddUserId', helper::FILTER_STRING_SHORT, true);
|
$newuserid = $this->getInput('blogAddUserId', helper::FILTER_STRING_SHORT, true);
|
||||||
} else {
|
} else {
|
||||||
$newuserid = $this->getUser('id');
|
$newuserid = $this->getUser('id');
|
||||||
@ -284,7 +284,7 @@ class blog extends common
|
|||||||
'state' => $this->getInput('blogAddState', helper::FILTER_BOOLEAN),
|
'state' => $this->getInput('blogAddState', helper::FILTER_BOOLEAN),
|
||||||
'title' => $this->getInput('blogAddTitle', helper::FILTER_STRING_SHORT, true),
|
'title' => $this->getInput('blogAddTitle', helper::FILTER_STRING_SHORT, true),
|
||||||
'userId' => $newuserid,
|
'userId' => $newuserid,
|
||||||
'editConsent' => $this->getInput('blogAddConsent') === self::EDIT_GROUP ? $this->getUser('role') : $this->getInput('blogAddConsent'),
|
'editConsent' => $this->getInput('blogAddConsent') === self::EDIT_GROUP ? $this->getUser('group') : $this->getInput('blogAddConsent'),
|
||||||
'commentMaxlength' => $this->getInput('blogAddCommentMaxlength'),
|
'commentMaxlength' => $this->getInput('blogAddCommentMaxlength'),
|
||||||
'commentApproved' => $this->getInput('blogAddCommentApproved', helper::FILTER_BOOLEAN),
|
'commentApproved' => $this->getInput('blogAddCommentApproved', helper::FILTER_BOOLEAN),
|
||||||
'commentClose' => $this->getInput('blogAddCommentClose', helper::FILTER_BOOLEAN),
|
'commentClose' => $this->getInput('blogAddCommentClose', helper::FILTER_BOOLEAN),
|
||||||
@ -493,13 +493,13 @@ class blog extends common
|
|||||||
( // Propriétaire
|
( // Propriétaire
|
||||||
$this->getData(['module', $this->getUrl(0), 'posts', $value, 'editConsent']) === self::EDIT_OWNER
|
$this->getData(['module', $this->getUrl(0), 'posts', $value, 'editConsent']) === self::EDIT_OWNER
|
||||||
and ($this->getData(['module', $this->getUrl(0), 'posts', $value, 'userId']) === $this->getUser('id')
|
and ($this->getData(['module', $this->getUrl(0), 'posts', $value, 'userId']) === $this->getUser('id')
|
||||||
or $this->getUser('role') === self::GROUP_ADMIN)
|
or $this->getUser('group') === self::GROUP_ADMIN)
|
||||||
)
|
)
|
||||||
|
|
||||||
or (
|
or (
|
||||||
// Role
|
// Groupe
|
||||||
$this->getData(['module', $this->getUrl(0), 'posts', $value, 'editConsent']) !== self::EDIT_OWNER
|
$this->getData(['module', $this->getUrl(0), 'posts', $value, 'editConsent']) !== self::EDIT_OWNER
|
||||||
and $this->getUser('role') >= $this->getData(['module', $this->getUrl(0), 'posts', $value, 'editConsent'])
|
and $this->getUser('group') >= $this->getData(['module', $this->getUrl(0), 'posts', $value, 'editConsent'])
|
||||||
)
|
)
|
||||||
or (
|
or (
|
||||||
// Tout le monde
|
// Tout le monde
|
||||||
@ -655,7 +655,7 @@ class blog extends common
|
|||||||
$this->getUser('permission', __CLASS__, __FUNCTION__) === true &&
|
$this->getUser('permission', __CLASS__, __FUNCTION__) === true &&
|
||||||
$this->isPost()
|
$this->isPost()
|
||||||
) {
|
) {
|
||||||
if ($this->getUser('role') === self::GROUP_ADMIN) {
|
if ($this->getUser('group') === self::GROUP_ADMIN) {
|
||||||
$newuserid = $this->getInput('blogEditUserId', helper::FILTER_STRING_SHORT, true);
|
$newuserid = $this->getInput('blogEditUserId', helper::FILTER_STRING_SHORT, true);
|
||||||
} else {
|
} else {
|
||||||
$newuserid = $this->getUser('id');
|
$newuserid = $this->getUser('id');
|
||||||
@ -683,7 +683,7 @@ class blog extends common
|
|||||||
'publishedOn' => $this->getInput('blogEditPublishedOn', helper::FILTER_DATETIME, true),
|
'publishedOn' => $this->getInput('blogEditPublishedOn', helper::FILTER_DATETIME, true),
|
||||||
'state' => $this->getInput('blogEditState', helper::FILTER_BOOLEAN),
|
'state' => $this->getInput('blogEditState', helper::FILTER_BOOLEAN),
|
||||||
'userId' => $newuserid,
|
'userId' => $newuserid,
|
||||||
'editConsent' => $this->getInput('blogEditConsent') === self::EDIT_GROUP ? $this->getUser('role') : $this->getInput('blogEditConsent'),
|
'editConsent' => $this->getInput('blogEditConsent') === self::EDIT_GROUP ? $this->getUser('group') : $this->getInput('blogEditConsent'),
|
||||||
'commentMaxlength' => $this->getInput('blogEditCommentMaxlength'),
|
'commentMaxlength' => $this->getInput('blogEditCommentMaxlength'),
|
||||||
'commentApproved' => $this->getInput('blogEditCommentApproved', helper::FILTER_BOOLEAN),
|
'commentApproved' => $this->getInput('blogEditCommentApproved', helper::FILTER_BOOLEAN),
|
||||||
'commentClose' => $this->getInput('blogEditCommentClose', helper::FILTER_BOOLEAN),
|
'commentClose' => $this->getInput('blogEditCommentClose', helper::FILTER_BOOLEAN),
|
||||||
@ -707,10 +707,10 @@ class blog extends common
|
|||||||
ksort(self::$users);
|
ksort(self::$users);
|
||||||
foreach (self::$users as $userId => &$userFirstname) {
|
foreach (self::$users as $userId => &$userFirstname) {
|
||||||
// Les membres ne sont pas éditeurs, les exclure de la liste
|
// Les membres ne sont pas éditeurs, les exclure de la liste
|
||||||
if ($this->getData(['user', $userId, 'role']) < self::GROUP_EDITOR) {
|
if ($this->getData(['user', $userId, 'group']) < self::GROUP_EDITOR) {
|
||||||
unset(self::$users[$userId]);
|
unset(self::$users[$userId]);
|
||||||
}
|
}
|
||||||
$userFirstname = $userFirstname . ' ' . $this->getData(['user', $userId, 'lastname']) . ' (' . self::$groupEdits[$this->getData(['user', $userId, 'role'])] . ')';
|
$userFirstname = $userFirstname . ' ' . $this->getData(['user', $userId, 'lastname']) . ' (' . self::$groupEdits[$this->getData(['user', $userId, 'group'])] . ')';
|
||||||
}
|
}
|
||||||
unset($userFirstname);
|
unset($userFirstname);
|
||||||
// Valeurs en sortie
|
// Valeurs en sortie
|
||||||
@ -783,7 +783,7 @@ class blog extends common
|
|||||||
$to = [];
|
$to = [];
|
||||||
// Liste des destinataires
|
// Liste des destinataires
|
||||||
foreach ($this->getData(['user']) as $userId => $user) {
|
foreach ($this->getData(['user']) as $userId => $user) {
|
||||||
if ($user['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'];
|
$to[] = $user['mail'];
|
||||||
$firstname[] = $user['firstname'];
|
$firstname[] = $user['firstname'];
|
||||||
$lastname[] = $user['lastname'];
|
$lastname[] = $user['lastname'];
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
"Commentaires supprimés": "Gelöschte Kommentare",
|
"Commentaires supprimés": "Gelöschte Kommentare",
|
||||||
"Fermer les commentaires": "Schalten Sie die Kommentare aus",
|
"Fermer les commentaires": "Schalten Sie die Kommentare aus",
|
||||||
"Gestion des commentaires": "Kommentarmanagement",
|
"Gestion des commentaires": "Kommentarmanagement",
|
||||||
"Role du propriétaire": "Besitzergruppe",
|
"Groupe du propriétaire": "Besitzergruppe",
|
||||||
"Image de couverture": "Berichterstattung",
|
"Image de couverture": "Berichterstattung",
|
||||||
"Informations générales": "Allgemeine Informationen",
|
"Informations générales": "Allgemeine Informationen",
|
||||||
"Lien du flux RSS": "Lien du flux RSS",
|
"Lien du flux RSS": "Lien du flux RSS",
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
"Commentaires supprimés": "Deleted comments",
|
"Commentaires supprimés": "Deleted comments",
|
||||||
"Fermer les commentaires": "Turn off the comments",
|
"Fermer les commentaires": "Turn off the comments",
|
||||||
"Gestion des commentaires": "Comment management",
|
"Gestion des commentaires": "Comment management",
|
||||||
"Role du propriétaire": "Owner's role",
|
"Groupe du propriétaire": "Owner's group",
|
||||||
"Image de couverture": "Coverage",
|
"Image de couverture": "Coverage",
|
||||||
"Informations générales": "General informations",
|
"Informations générales": "General informations",
|
||||||
"Lien du flux RSS": "Lien du Flux RSS",
|
"Lien du flux RSS": "Lien du Flux RSS",
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
"Commentaires supprimés": "Comentarios eliminados",
|
"Commentaires supprimés": "Comentarios eliminados",
|
||||||
"Fermer les commentaires": "Cerrar los comentarios",
|
"Fermer les commentaires": "Cerrar los comentarios",
|
||||||
"Gestion des commentaires": "Gestión de comentarios",
|
"Gestion des commentaires": "Gestión de comentarios",
|
||||||
"Role du propriétaire": "Grupo de propietarios",
|
"Groupe du propriétaire": "Grupo de propietarios",
|
||||||
"Image de couverture": "Imagen de portada",
|
"Image de couverture": "Imagen de portada",
|
||||||
"Informations générales": "Información general",
|
"Informations générales": "Información general",
|
||||||
"Lien du flux RSS": "Enlace de fuente RSS",
|
"Lien du flux RSS": "Enlace de fuente RSS",
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
"Commentaires supprimés": "",
|
"Commentaires supprimés": "",
|
||||||
"Fermer les commentaires": "",
|
"Fermer les commentaires": "",
|
||||||
"Gestion des commentaires": "",
|
"Gestion des commentaires": "",
|
||||||
"Role du propriétaire": "",
|
"Groupe du propriétaire": "",
|
||||||
"Image de couverture": "",
|
"Image de couverture": "",
|
||||||
"Informations générales": "",
|
"Informations générales": "",
|
||||||
"Lien du flux RSS": "",
|
"Lien du flux RSS": "",
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
"Commentaires supprimés": "Σχόλια διαγράφονται",
|
"Commentaires supprimés": "Σχόλια διαγράφονται",
|
||||||
"Fermer les commentaires": "Κλείσιμο σχολίων",
|
"Fermer les commentaires": "Κλείσιμο σχολίων",
|
||||||
"Gestion des commentaires": "Διαχείριση σχολίων",
|
"Gestion des commentaires": "Διαχείριση σχολίων",
|
||||||
"Role du propriétaire": "Ομάδα ιδιοκτήτη",
|
"Groupe du propriétaire": "Ομάδα ιδιοκτήτη",
|
||||||
"Image de couverture": "εικόνα εξωφύλλου",
|
"Image de couverture": "εικόνα εξωφύλλου",
|
||||||
"Informations générales": "Γενικές πληροφορίες",
|
"Informations générales": "Γενικές πληροφορίες",
|
||||||
"Lien du flux RSS": "Σύνδεσμος τροφοδοσίας RSS",
|
"Lien du flux RSS": "Σύνδεσμος τροφοδοσίας RSS",
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
"Commentaires supprimés": "Commenti cancellati",
|
"Commentaires supprimés": "Commenti cancellati",
|
||||||
"Fermer les commentaires": "Disattiva i commenti",
|
"Fermer les commentaires": "Disattiva i commenti",
|
||||||
"Gestion des commentaires": "Gestione dei commenti",
|
"Gestion des commentaires": "Gestione dei commenti",
|
||||||
"Role du propriétaire": "Gruppo del proprietario",
|
"Groupe du propriétaire": "Gruppo del proprietario",
|
||||||
"Image de couverture": "Copertura",
|
"Image de couverture": "Copertura",
|
||||||
"Informations générales": "Informazioni generali",
|
"Informations générales": "Informazioni generali",
|
||||||
"Lien du flux RSS": "Lien Du Flux RSS",
|
"Lien du flux RSS": "Lien Du Flux RSS",
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
"Commentaires supprimés": "Comentários excluídos",
|
"Commentaires supprimés": "Comentários excluídos",
|
||||||
"Fermer les commentaires": "Desligue os comentários",
|
"Fermer les commentaires": "Desligue os comentários",
|
||||||
"Gestion des commentaires": "Gerenciamento de comentários",
|
"Gestion des commentaires": "Gerenciamento de comentários",
|
||||||
"Role du propriétaire": "Grupo do proprietário",
|
"Groupe du propriétaire": "Grupo do proprietário",
|
||||||
"Image de couverture": "Cobertura",
|
"Image de couverture": "Cobertura",
|
||||||
"Informations générales": "Informações gerais",
|
"Informations générales": "Informações gerais",
|
||||||
"Lien du flux RSS": "Lien du Flux RSS",
|
"Lien du flux RSS": "Lien du Flux RSS",
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
"Commentaires supprimés": "Silinen yorumlar",
|
"Commentaires supprimés": "Silinen yorumlar",
|
||||||
"Fermer les commentaires": "Yorumları kapat",
|
"Fermer les commentaires": "Yorumları kapat",
|
||||||
"Gestion des commentaires": "Yorum yönetimi",
|
"Gestion des commentaires": "Yorum yönetimi",
|
||||||
"Role du propriétaire": "Sahip grubu",
|
"Groupe du propriétaire": "Sahip grubu",
|
||||||
"Image de couverture": "Kapak resmi",
|
"Image de couverture": "Kapak resmi",
|
||||||
"Informations générales": "Genel bilgiler",
|
"Informations générales": "Genel bilgiler",
|
||||||
"Lien du flux RSS": "RSS dağıtım bağlantısı",
|
"Lien du flux RSS": "RSS dağıtım bağlantısı",
|
||||||
|
@ -82,7 +82,7 @@
|
|||||||
<?php echo template::select('blogAddUserId', blog::$users, [
|
<?php echo template::select('blogAddUserId', blog::$users, [
|
||||||
'label' => 'Auteur',
|
'label' => 'Auteur',
|
||||||
'selected' => $this->getUser('id'),
|
'selected' => $this->getUser('id'),
|
||||||
'disabled' => $this->getUser('role') !== self::GROUP_ADMIN ? true : false
|
'disabled' => $this->getUser('group') !== self::GROUP_ADMIN ? true : false
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="col4">
|
<div class="col4">
|
||||||
|
@ -52,18 +52,18 @@
|
|||||||
( // Propriétaire
|
( // Propriétaire
|
||||||
($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'editConsent']) === blog::EDIT_OWNER
|
($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'editConsent']) === blog::EDIT_OWNER
|
||||||
and ($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'userId']) === $this->getUser('id')
|
and ($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'userId']) === $this->getUser('id')
|
||||||
or $this->getUser('role') === self::GROUP_ADMIN)
|
or $this->getUser('group') === self::GROUP_ADMIN)
|
||||||
)
|
)
|
||||||
or (
|
or (
|
||||||
// Role
|
// Groupe
|
||||||
($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'editConsent']) === self::GROUP_ADMIN
|
($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'editConsent']) === self::GROUP_ADMIN
|
||||||
or $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'editConsent']) === self::GROUP_EDITOR)
|
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 (
|
or (
|
||||||
// Tout le monde
|
// Tout le monde
|
||||||
$this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'editConsent']) === blog::EDIT_ALL
|
$this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'editConsent']) === blog::EDIT_ALL
|
||||||
and $this->getUser('role') >= blog::$actions['config']
|
and $this->getUser('group') >= blog::$actions['config']
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
): ?>
|
): ?>
|
||||||
|
@ -89,7 +89,7 @@
|
|||||||
<?php echo template::select('blogEditUserId', blog::$users, [
|
<?php echo template::select('blogEditUserId', blog::$users, [
|
||||||
'label' => 'Auteur',
|
'label' => 'Auteur',
|
||||||
'selected' => $this->getUser('id'),
|
'selected' => $this->getUser('id'),
|
||||||
'disabled' => $this->getUser('role') !== self::GROUP_ADMIN ? true : false
|
'disabled' => $this->getUser('group') !== self::GROUP_ADMIN ? true : false
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="col4">
|
<div class="col4">
|
||||||
|
@ -77,18 +77,18 @@
|
|||||||
( // Propriétaire
|
( // Propriétaire
|
||||||
($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'editConsent']) === blog::EDIT_OWNER
|
($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'editConsent']) === blog::EDIT_OWNER
|
||||||
and ($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'userId']) === $this->getUser('id')
|
and ($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'userId']) === $this->getUser('id')
|
||||||
or $this->getUser('role') === self::GROUP_ADMIN)
|
or $this->getUser('group') === self::GROUP_ADMIN)
|
||||||
)
|
)
|
||||||
or (
|
or (
|
||||||
// Role
|
// Groupe
|
||||||
($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'editConsent']) === self::GROUP_ADMIN
|
($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'editConsent']) === self::GROUP_ADMIN
|
||||||
or $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'editConsent']) === self::GROUP_EDITOR)
|
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 (
|
or (
|
||||||
// Tout le monde
|
// Tout le monde
|
||||||
$this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'editConsent']) === blog::EDIT_ALL
|
$this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'editConsent']) === blog::EDIT_ALL
|
||||||
and $this->getUser('role') >= blog::$actions['config']
|
and $this->getUser('group') >= blog::$actions['config']
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
): ?>
|
): ?>
|
||||||
|
@ -185,7 +185,7 @@ class form extends common
|
|||||||
[
|
[
|
||||||
'button' => $this->getInput('formOptionButton'),
|
'button' => $this->getInput('formOptionButton'),
|
||||||
'captcha' => $this->getInput('formOptionCaptcha', helper::FILTER_BOOLEAN),
|
'captcha' => $this->getInput('formOptionCaptcha', helper::FILTER_BOOLEAN),
|
||||||
'role' => $this->getInput('formOptionGroup', helper::FILTER_INT),
|
'group' => $this->getInput('formOptionGroup', helper::FILTER_INT),
|
||||||
'user' => self::$listUsers[$this->getInput('formOptionUser', helper::FILTER_INT)],
|
'user' => self::$listUsers[$this->getInput('formOptionUser', helper::FILTER_INT)],
|
||||||
'mail' => $this->getInput('formOptionMail'),
|
'mail' => $this->getInput('formOptionMail'),
|
||||||
'pageId' => $this->getInput('formOptionPageIdToggle', helper::FILTER_BOOLEAN) === true ? $this->getInput('formOptionPageId', helper::FILTER_ID) : '',
|
'pageId' => $this->getInput('formOptionPageIdToggle', helper::FILTER_BOOLEAN) === true ? $this->getInput('formOptionPageId', helper::FILTER_ID) : '',
|
||||||
@ -454,19 +454,19 @@ class form extends common
|
|||||||
'mail'
|
'mail'
|
||||||
]);
|
]);
|
||||||
$singlemail = $this->getData(['module', $this->getUrl(0), 'config', '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é
|
// Verification si le mail peut être envoyé
|
||||||
if (
|
if (
|
||||||
self::$inputNotices === [] && (
|
self::$inputNotices === [] && (
|
||||||
$role > 0 ||
|
$group > 0 ||
|
||||||
$singleuser !== '' ||
|
$singleuser !== '' ||
|
||||||
$singlemail !== '')
|
$singlemail !== '')
|
||||||
) {
|
) {
|
||||||
// Utilisateurs dans le role
|
// Utilisateurs dans le groupe
|
||||||
$to = [];
|
$to = [];
|
||||||
if ($role > 0) {
|
if ($group > 0) {
|
||||||
foreach ($this->getData(['user']) as $userId => $user) {
|
foreach ($this->getData(['user']) as $userId => $user) {
|
||||||
if ($user['role'] >= $role) {
|
if ($user['group'] >= $group) {
|
||||||
$to[] = $user['mail'];
|
$to[] = $user['mail'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
"Supprimer cet enregistrement ?": "Diese Aufnahme löschen?",
|
"Supprimer cet enregistrement ?": "Diese Aufnahme löschen?",
|
||||||
"Supprimer tous les enregistrements ?": "Alle Aufnahmen löschen?",
|
"Supprimer tous les enregistrements ?": "Alle Aufnahmen löschen?",
|
||||||
"Sélection": "Auswahl",
|
"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",
|
"Type de signature": "Typ de Signature",
|
||||||
"Une colonne": "Eine Kolumne",
|
"Une colonne": "Eine Kolumne",
|
||||||
"Validation du formulaire": "Validierung des Formulars",
|
"Validation du formulaire": "Validierung des Formulars",
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
"Supprimer cet enregistrement ?": "Delete this recording?",
|
"Supprimer cet enregistrement ?": "Delete this recording?",
|
||||||
"Supprimer tous les enregistrements ?": "Delete all recordings?",
|
"Supprimer tous les enregistrements ?": "Delete all recordings?",
|
||||||
"Sélection": "Select",
|
"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",
|
"Type de signature": "Type de signature",
|
||||||
"Une colonne": "A column",
|
"Une colonne": "A column",
|
||||||
"Validation du formulaire": "Form validation",
|
"Validation du formulaire": "Form validation",
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
"Supprimer cet enregistrement ?": "¿Borrar este registro?",
|
"Supprimer cet enregistrement ?": "¿Borrar este registro?",
|
||||||
"Supprimer tous les enregistrements ?": "¿Borrar todos los registros?",
|
"Supprimer tous les enregistrements ?": "¿Borrar todos los registros?",
|
||||||
"Sélection": "Selección",
|
"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",
|
"Type de signature": "Tipo de firma",
|
||||||
"Une colonne": "Una columna",
|
"Une colonne": "Una columna",
|
||||||
"Validation du formulaire": "Validación del formulario",
|
"Validation du formulaire": "Validación del formulario",
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
"Supprimer cet enregistrement ?": "",
|
"Supprimer cet enregistrement ?": "",
|
||||||
"Supprimer tous les enregistrements ?": "",
|
"Supprimer tous les enregistrements ?": "",
|
||||||
"Sélection": "",
|
"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": "",
|
"Type de signature": "",
|
||||||
"Une colonne": "",
|
"Une colonne": "",
|
||||||
"Validation du formulaire": "",
|
"Validation du formulaire": "",
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
"Supprimer cet enregistrement ?": "Να διαγράψω αυτό το αρχείο;",
|
"Supprimer cet enregistrement ?": "Να διαγράψω αυτό το αρχείο;",
|
||||||
"Supprimer tous les enregistrements ?": "Διαγραφή όλων των εγγραφών;",
|
"Supprimer tous les enregistrements ?": "Διαγραφή όλων των εγγραφών;",
|
||||||
"Sélection": "Επιλογή",
|
"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": "Τύπος υπογραφής",
|
"Type de signature": "Τύπος υπογραφής",
|
||||||
"Une colonne": "1 στήλη",
|
"Une colonne": "1 στήλη",
|
||||||
"Validation du formulaire": "Επικύρωση της φόρμας",
|
"Validation du formulaire": "Επικύρωση της φόρμας",
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
"Supprimer cet enregistrement ?": "Elimina questa registrazione?",
|
"Supprimer cet enregistrement ?": "Elimina questa registrazione?",
|
||||||
"Supprimer tous les enregistrements ?": "Elimina tutte le registrazioni?",
|
"Supprimer tous les enregistrements ?": "Elimina tutte le registrazioni?",
|
||||||
"Sélection": "Selezione",
|
"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",
|
"Type de signature": "Tipo di firma",
|
||||||
"Une colonne": "Una colonna",
|
"Une colonne": "Una colonna",
|
||||||
"Validation du formulaire": "Convalida del modulo",
|
"Validation du formulaire": "Convalida del modulo",
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
"Supprimer cet enregistrement ?": "Excluir esta gravação?",
|
"Supprimer cet enregistrement ?": "Excluir esta gravação?",
|
||||||
"Supprimer tous les enregistrements ?": "Excluir todas as gravações?",
|
"Supprimer tous les enregistrements ?": "Excluir todas as gravações?",
|
||||||
"Sélection": "Seleção",
|
"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",
|
"Type de signature": "Tipo de assinatura",
|
||||||
"Une colonne": "Uma coluna",
|
"Une colonne": "Uma coluna",
|
||||||
"Validation du formulaire": "Validação do formulário",
|
"Validation du formulaire": "Validação do formulário",
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
"Supprimer cet enregistrement ?": "Bu kayıt silinsin mi?",
|
"Supprimer cet enregistrement ?": "Bu kayıt silinsin mi?",
|
||||||
"Supprimer tous les enregistrements ?": "Tüm kayıtlar silinsin mi?",
|
"Supprimer tous les enregistrements ?": "Tüm kayıtlar silinsin mi?",
|
||||||
"Sélection": "Seçim",
|
"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ü",
|
"Type de signature": "İmza türü",
|
||||||
"Une colonne": "Bir sütun",
|
"Une colonne": "Bir sütun",
|
||||||
"Validation du formulaire": "Form doğrulama",
|
"Validation du formulaire": "Form doğrulama",
|
||||||
|
@ -3,7 +3,7 @@ class init extends form {
|
|||||||
public static $defaultData = [
|
public static $defaultData = [
|
||||||
'button'=> '',
|
'button'=> '',
|
||||||
'captcha'=> false,
|
'captcha'=> false,
|
||||||
'role'=> 0,
|
'group'=> 0,
|
||||||
'user'=> '',
|
'user'=> '',
|
||||||
'mail'=> '',
|
'mail'=> '',
|
||||||
'pageId'=> '',
|
'pageId'=> '',
|
||||||
|
@ -80,10 +80,10 @@
|
|||||||
<div class="block">
|
<div class="block">
|
||||||
<h4><?php echo helper::translate('Courriel'); ?></h4>
|
<h4><?php echo helper::translate('Courriel'); ?></h4>
|
||||||
<?php echo template::checkbox('formOptionMailOptionsToggle', true, 'Envoyer par mail les données saisies :', [
|
<?php echo template::checkbox('formOptionMailOptionsToggle', true, 'Envoyer par mail les données saisies :', [
|
||||||
'checked' => (bool) $this->getData(['module', $this->getUrl(0), 'config', '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', 'user'])) ||
|
||||||
!empty($this->getData(['module', $this->getUrl(0), 'config', 'mail'])),
|
!empty($this->getData(['module', $this->getUrl(0), 'config', 'mail'])),
|
||||||
'help' => 'Sélectionnez au moins un 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 id="formOptionMailOptions" class="displayNone">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@ -103,7 +103,7 @@
|
|||||||
<div class="col4">
|
<div class="col4">
|
||||||
<?php echo template::select('formOptionGroup', $groupMembers, [
|
<?php echo template::select('formOptionGroup', $groupMembers, [
|
||||||
'label' => 'A tous les groupes depuis',
|
'label' => 'A tous les groupes depuis',
|
||||||
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'role']),
|
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'group']),
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="col4">
|
<div class="col4">
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
$this->isConnected() === true
|
$this->isConnected() === true
|
||||||
and
|
and
|
||||||
( // Propriétaire
|
( // 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); ?>">
|
<a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/edit/' . $this->getUrl(1); ?>">
|
||||||
|
@ -52,7 +52,7 @@
|
|||||||
$this->isConnected() === true
|
$this->isConnected() === true
|
||||||
and
|
and
|
||||||
( // Propriétaire
|
( // 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; ?>">
|
<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
|
// Message si l'utilisateur peut éditer la page
|
||||||
if (
|
if (
|
||||||
$this->isConnected() === true
|
$this->isConnected() === true
|
||||||
&& $this->getUser('role') >= self::GROUP_EDITOR
|
&& $this->getUser('group') >= self::GROUP_EDITOR
|
||||||
&& $this->getUrl(1) !== 'force'
|
&& $this->getUrl(1) !== 'force'
|
||||||
) {
|
) {
|
||||||
// Valeurs en sortie
|
// Valeurs en sortie
|
||||||
|
@ -208,7 +208,7 @@ class search extends common
|
|||||||
foreach ($this->getHierarchy(null, false, null) as $parentId => $childIds) {
|
foreach ($this->getHierarchy(null, false, null) as $parentId => $childIds) {
|
||||||
if (
|
if (
|
||||||
$this->getData(['page', $parentId, 'disable']) === false &&
|
$this->getData(['page', $parentId, 'disable']) === false &&
|
||||||
$this->getUser('role') >= $this->getData(['page', $parentId, 'role']) &&
|
$this->getUser('group') >= $this->getData(['page', $parentId, 'group']) &&
|
||||||
$this->getData(['page', $parentId, 'block']) !== 'bar'
|
$this->getData(['page', $parentId, 'block']) !== 'bar'
|
||||||
) {
|
) {
|
||||||
$url = $parentId;
|
$url = $parentId;
|
||||||
@ -227,7 +227,7 @@ class search extends common
|
|||||||
// Sous page
|
// Sous page
|
||||||
if (
|
if (
|
||||||
$this->getData(['page', $childId, 'disable']) === false &&
|
$this->getData(['page', $childId, 'disable']) === false &&
|
||||||
$this->getUser('role') >= $this->getData(['page', $parentId, 'role']) &&
|
$this->getUser('group') >= $this->getData(['page', $parentId, 'group']) &&
|
||||||
$this->getData(['page', $parentId, 'block']) !== 'bar'
|
$this->getData(['page', $parentId, 'block']) !== 'bar'
|
||||||
) {
|
) {
|
||||||
$url = $childId;
|
$url = $childId;
|
||||||
|
@ -113,10 +113,10 @@ class suscribe extends common
|
|||||||
// Impossible de s'auto-éditer
|
// Impossible de s'auto-éditer
|
||||||
(
|
(
|
||||||
$this->getUser('id') === 'user'
|
$this->getUser('id') === 'user'
|
||||||
and $this->getUrl('role') <= self::GROUP_VISITOR
|
and $this->getUrl('group') <= self::GROUP_VISITOR
|
||||||
)
|
)
|
||||||
// Impossible d'éditer un autre utilisateur
|
// Impossible d'éditer un autre utilisateur
|
||||||
or ($this->getUrl('role') < self::GROUP_EDITOR)
|
or ($this->getUrl('group') < self::GROUP_EDITOR)
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
// Valeurs en sortie
|
// Valeurs en sortie
|
||||||
@ -138,7 +138,7 @@ class suscribe extends common
|
|||||||
[
|
[
|
||||||
'firstname' => $this->getData(['module', $this->getUrl(0), 'users', $this->getUrl(2), 'firstname']),
|
'firstname' => $this->getData(['module', $this->getUrl(0), 'users', $this->getUrl(2), 'firstname']),
|
||||||
'forgot' => 0,
|
'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.
|
// 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
|
'profil' => $this->getInput('registrationUserEditGroup', helper::FILTER_INT) === self::GROUP_ADMIN
|
||||||
? 0 : 1,
|
? 0 : 1,
|
||||||
@ -165,7 +165,7 @@ class suscribe extends common
|
|||||||
'state' => true
|
'state' => true
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
// Changement temporaire de libellé du role 0
|
// Changement temporaire de libellé du groupe 0
|
||||||
self::$groups = self::$groupEdits;
|
self::$groups = self::$groupEdits;
|
||||||
self::$groups[self::GROUP_BANNED] = 'En attente d\'approbation';
|
self::$groups[self::GROUP_BANNED] = 'En attente d\'approbation';
|
||||||
|
|
||||||
@ -203,7 +203,7 @@ class suscribe extends common
|
|||||||
if (
|
if (
|
||||||
// L'utilisateur n'existe pas
|
// L'utilisateur n'existe pas
|
||||||
$this->getData(['module', $this->getUrl(0), 'users', $this->getUrl(2)]) === null
|
$this->getData(['module', $this->getUrl(0), 'users', $this->getUrl(2)]) === null
|
||||||
// Role insuffisant
|
// Groupe insuffisant
|
||||||
&& $this->getUser('permission', __CLASS__, __FUNCTION__) !== true
|
&& $this->getUser('permission', __CLASS__, __FUNCTION__) !== true
|
||||||
) {
|
) {
|
||||||
// Valeurs en sortie
|
// Valeurs en sortie
|
||||||
@ -303,7 +303,7 @@ class suscribe extends common
|
|||||||
'lastname' => $userLastname,
|
'lastname' => $userLastname,
|
||||||
'mail' => $userMail,
|
'mail' => $userMail,
|
||||||
'password' => '',
|
'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(),
|
'timer' => time(),
|
||||||
'pseudo' => $userId,
|
'pseudo' => $userId,
|
||||||
'auth' => $auth,
|
'auth' => $auth,
|
||||||
@ -311,10 +311,10 @@ class suscribe extends common
|
|||||||
]
|
]
|
||||||
]);
|
]);
|
||||||
// Mail d'avertissement aux administrateurs
|
// Mail d'avertissement aux administrateurs
|
||||||
// Utilisateurs dans le role admin
|
// Utilisateurs dans le groupe admin
|
||||||
$to = [];
|
$to = [];
|
||||||
foreach ($this->getData(['user']) as $key => $user) {
|
foreach ($this->getData(['user']) as $key => $user) {
|
||||||
if ($user['role'] == self::GROUP_ADMIN) {
|
if ($user['group'] == self::GROUP_ADMIN) {
|
||||||
$to[] = $user['mail'];
|
$to[] = $user['mail'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -418,7 +418,7 @@ class suscribe extends common
|
|||||||
'lastname' => $this->getData(['module', $this->getUrl(0), 'users', $userId, 'lastname']),
|
'lastname' => $this->getData(['module', $this->getUrl(0), 'users', $userId, 'lastname']),
|
||||||
'mail' => $this->getData(['module', $this->getUrl(0), 'users', $userId, 'mail']),
|
'mail' => $this->getData(['module', $this->getUrl(0), 'users', $userId, 'mail']),
|
||||||
'password' => $this->getInput('registrationValidPassword', helper::FILTER_PASSWORD, true),
|
'password' => $this->getInput('registrationValidPassword', helper::FILTER_PASSWORD, true),
|
||||||
'role' => self::GROUP_MEMBER,
|
'group' => self::GROUP_MEMBER,
|
||||||
'profil' => 1,
|
'profil' => 1,
|
||||||
'forgot' => 0,
|
'forgot' => 0,
|
||||||
'pseudo' => $userId,
|
'pseudo' => $userId,
|
||||||
|
@ -25,11 +25,11 @@
|
|||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="col4">
|
<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, [
|
<?php echo template::select('registrationUserEditGroup', suscribe::$groups, [
|
||||||
'disabled' => ($this->getUrl(2) === $this->getUser('id')),
|
'disabled' => ($this->getUrl(2) === $this->getUser('id')),
|
||||||
'help' => ($this->getUrl(2) === $this->getUser('id') ? 'Impossible de modifier votre propre role.' : ''),
|
'help' => ($this->getUrl(2) === $this->getUser('id') ? 'Impossible de modifier votre propre groupe.' : ''),
|
||||||
'label' => 'Role',
|
'label' => 'Groupe',
|
||||||
'selected' => $this->getData(['module', $this->getUrl(0), 'registrationUsers', $this->getUrl(2), 'status'])
|
'selected' => $this->getData(['module', $this->getUrl(0), 'registrationUsers', $this->getUrl(2), 'status'])
|
||||||
]); ?>
|
]); ?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
@ -40,7 +40,7 @@
|
|||||||
<?php echo template::select('registrationUserEditProfil' . self::GROUP_MEMBER, suscribe::$userProfils[self::GROUP_MEMBER], [
|
<?php echo template::select('registrationUserEditProfil' . self::GROUP_MEMBER, suscribe::$userProfils[self::GROUP_MEMBER], [
|
||||||
'label' => 'Profil',
|
'label' => 'Profil',
|
||||||
'selected' => $this->getData(['user', $this->getUrl(2), 'profil']),
|
'selected' => $this->getData(['user', $this->getUrl(2), 'profil']),
|
||||||
'disabled' => $this->getUser('role') !== self::GROUP_ADMIN,
|
'disabled' => $this->getUser('group') !== self::GROUP_ADMIN,
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="registrationUserEditGroupProfil"
|
<div class="registrationUserEditGroupProfil"
|
||||||
@ -48,7 +48,7 @@
|
|||||||
<?php echo template::select('registrationUserEditProfil' . self::GROUP_EDITOR, suscribe::$userProfils[self::GROUP_EDITOR], [
|
<?php echo template::select('registrationUserEditProfil' . self::GROUP_EDITOR, suscribe::$userProfils[self::GROUP_EDITOR], [
|
||||||
'label' => 'Profil',
|
'label' => 'Profil',
|
||||||
'selected' => $this->getData(['user', $this->getUrl(2), 'profil']),
|
'selected' => $this->getData(['user', $this->getUrl(2), 'profil']),
|
||||||
'disabled' => $this->getUser('role') !== self::GROUP_ADMIN,
|
'disabled' => $this->getUser('group') !== self::GROUP_ADMIN,
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user