EDITOR devient MODERATOR
This commit is contained in:
parent
f9eb28f6f3
commit
d4321076fc
@ -23,7 +23,7 @@ class common {
|
||||
const GROUP_BANNED = -1;
|
||||
const GROUP_VISITOR = 0;
|
||||
const GROUP_MEMBER = 1;
|
||||
const GROUP_EDITOR = 2;
|
||||
const GROUP_MODERATOR = 2;
|
||||
const GROUP_ADMIN = 3;
|
||||
const SIGNATURE_ID = 1;
|
||||
const SIGNATURE_PSEUDO = 2;
|
||||
@ -127,24 +127,24 @@ class common {
|
||||
self::GROUP_BANNED => 'Banni',
|
||||
self::GROUP_VISITOR => 'Visiteur',
|
||||
self::GROUP_MEMBER => 'Membre',
|
||||
self::GROUP_EDITOR => 'Éditeur',
|
||||
self::GROUP_MODERATOR => 'Éditeur',
|
||||
self::GROUP_ADMIN => 'Administrateur'
|
||||
];
|
||||
public static $groupEdits = [
|
||||
self::GROUP_BANNED => 'Banni',
|
||||
self::GROUP_MEMBER => 'Membre',
|
||||
self::GROUP_EDITOR => 'Éditeur',
|
||||
self::GROUP_MODERATOR => 'Éditeur',
|
||||
self::GROUP_ADMIN => 'Administrateur'
|
||||
];
|
||||
public static $groupNews = [
|
||||
self::GROUP_MEMBER => 'Membre',
|
||||
self::GROUP_EDITOR => 'Éditeur',
|
||||
self::GROUP_MODERATOR => 'Éditeur',
|
||||
self::GROUP_ADMIN => 'Administrateur'
|
||||
];
|
||||
public static $groupPublics = [
|
||||
self::GROUP_VISITOR => 'Visiteur',
|
||||
self::GROUP_MEMBER => 'Membre',
|
||||
self::GROUP_EDITOR => 'Éditeur',
|
||||
self::GROUP_MODERATOR => 'Éditeur',
|
||||
self::GROUP_ADMIN => 'Administrateur'
|
||||
];
|
||||
public static $timezone;
|
||||
@ -2695,7 +2695,7 @@ class layout extends common {
|
||||
if($this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')) {
|
||||
// Items de gauche
|
||||
$leftItems = '';
|
||||
if($this->getUser('group') >= self::GROUP_EDITOR) {
|
||||
if($this->getUser('group') >= self::GROUP_MODERATOR) {
|
||||
$leftItems .= '<li><select id="barSelectPage">';
|
||||
$leftItems .= '<option value="">Choisissez une page</option>';
|
||||
$leftItems .= '<optgroup label="Pages orphelines">';
|
||||
@ -2759,7 +2759,7 @@ class layout extends common {
|
||||
}
|
||||
// Items de droite
|
||||
$rightItems = '';
|
||||
if($this->getUser('group') >= self::GROUP_EDITOR) {
|
||||
if($this->getUser('group') >= self::GROUP_MODERATOR) {
|
||||
$rightItems .= '<li><a href="' . helper::baseUrl(false) . 'core/vendor/filemanager/dialog.php?type=0&akey=' . md5_file(self::DATA_DIR.'core.json') .'" data-tippy-content="Gérer les fichiers" data-lity>' . template::ico('folder') . '</a></li>';
|
||||
}
|
||||
if($this->getUser('group') >= self::GROUP_ADMIN) {
|
||||
@ -2818,7 +2818,7 @@ class layout extends common {
|
||||
$vars .= 'var baseUrlQs = ' . json_encode(helper::baseUrl()) . ';';
|
||||
if(
|
||||
$this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
||||
AND $this->getUser('group') >= self::GROUP_EDITOR
|
||||
AND $this->getUser('group') >= self::GROUP_MODERATOR
|
||||
) {
|
||||
$vars .= 'var privateKey = ' . json_encode(md5_file(self::DATA_DIR.'core.json')) . ';';
|
||||
}
|
||||
|
@ -17,10 +17,10 @@
|
||||
class page extends common {
|
||||
|
||||
public static $actions = [
|
||||
'add' => self::GROUP_EDITOR,
|
||||
'delete' => self::GROUP_EDITOR,
|
||||
'edit' => self::GROUP_EDITOR,
|
||||
'duplicate' => self::GROUP_EDITOR
|
||||
'add' => self::GROUP_MODERATOR,
|
||||
'delete' => self::GROUP_MODERATOR,
|
||||
'edit' => self::GROUP_MODERATOR,
|
||||
'duplicate' => self::GROUP_MODERATOR
|
||||
];
|
||||
public static $pagesNoParentId = [
|
||||
'' => 'Aucune'
|
||||
|
@ -124,7 +124,7 @@ class user extends common {
|
||||
// L'utilisateur n'existe pas
|
||||
$this->getData(['user', $this->getUrl(2)]) === null
|
||||
// Groupe insuffisant
|
||||
AND ($this->getUrl('group') < self::GROUP_EDITOR)
|
||||
AND ($this->getUrl('group') < self::GROUP_MODERATOR)
|
||||
) {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
@ -183,7 +183,7 @@ class user extends common {
|
||||
AND $this->getUrl('group') <= self::GROUP_VISITOR
|
||||
)
|
||||
// Impossible d'éditer un autre utilisateur
|
||||
OR ($this->getUrl('group') < self::GROUP_EDITOR)
|
||||
OR ($this->getUrl('group') < self::GROUP_MODERATOR)
|
||||
)
|
||||
) {
|
||||
// Valeurs en sortie
|
||||
|
@ -50,7 +50,7 @@
|
||||
<ul id="userAddGroupDescription<?php echo self::GROUP_MEMBER; ?>" class="userAddGroupDescription displayNone">
|
||||
<li>Accès aux pages privées membres</li>
|
||||
</ul>
|
||||
<ul id="userAddGroupDescription<?php echo self::GROUP_EDITOR; ?>" class="userAddGroupDescription displayNone">
|
||||
<ul id="userAddGroupDescription<?php echo self::GROUP_MODERATOR; ?>" class="userAddGroupDescription displayNone">
|
||||
<li>Accès aux pages privées membres et éditeurs</li>
|
||||
<li>Ajout / Édition / Suppression de pages</li>
|
||||
<li>Ajout / Édition / Suppression de fichiers</li>
|
||||
|
@ -68,7 +68,7 @@
|
||||
<ul id="userEditGroupDescription<?php echo self::GROUP_MEMBER; ?>" class="userEditGroupDescription displayNone">
|
||||
<li>Accès aux pages privées membres</li>
|
||||
</ul>
|
||||
<ul id="userEditGroupDescription<?php echo self::GROUP_EDITOR; ?>" class="userEditGroupDescription displayNone">
|
||||
<ul id="userEditGroupDescription<?php echo self::GROUP_MODERATOR; ?>" class="userEditGroupDescription displayNone">
|
||||
<li>Accès aux pages privées membres et éditeurs</li>
|
||||
<li>Ajout / Édition / Suppression de pages</li>
|
||||
<li>Ajout / Édition / Suppression de fichiers</li>
|
||||
|
@ -19,14 +19,14 @@ class blog extends common {
|
||||
const EDIT_ALL = 'all';
|
||||
|
||||
public static $actions = [
|
||||
'add' => self::GROUP_EDITOR,
|
||||
'comment' => self::GROUP_EDITOR,
|
||||
'commentApprove' => self::GROUP_EDITOR,
|
||||
'commentDelete' => self::GROUP_EDITOR,
|
||||
'commentDeleteAll' => self::GROUP_EDITOR,
|
||||
'config' => self::GROUP_EDITOR,
|
||||
'delete' => self::GROUP_EDITOR,
|
||||
'edit' => self::GROUP_EDITOR,
|
||||
'add' => self::GROUP_MODERATOR,
|
||||
'comment' => self::GROUP_MODERATOR,
|
||||
'commentApprove' => self::GROUP_MODERATOR,
|
||||
'commentDelete' => self::GROUP_MODERATOR,
|
||||
'commentDeleteAll' => self::GROUP_MODERATOR,
|
||||
'config' => self::GROUP_MODERATOR,
|
||||
'delete' => self::GROUP_MODERATOR,
|
||||
'edit' => self::GROUP_MODERATOR,
|
||||
'index' => self::GROUP_VISITOR
|
||||
];
|
||||
|
||||
@ -310,7 +310,7 @@ class blog extends common {
|
||||
(
|
||||
$this->getData(['module', $this->getUrl(0), $value,'editConsent']) === self::EDIT_OWNER
|
||||
AND $this->getData(['module', $this->getUrl(0), $value,'userId']) === $this->getUser('id')
|
||||
AND $this->getUser('group') >= self::GROUP_EDITOR
|
||||
AND $this->getUser('group') >= self::GROUP_MODERATOR
|
||||
)
|
||||
|
||||
OR (
|
||||
@ -481,7 +481,7 @@ class blog extends common {
|
||||
ksort(self::$users);
|
||||
foreach(self::$users as $userId => &$userFirstname) {
|
||||
// Les membres ne sont pas éditeurs, les exclure de la liste
|
||||
if ( $this->getData(['user', $userId, 'group']) < self::GROUP_EDITOR) {
|
||||
if ( $this->getData(['user', $userId, 'group']) < self::GROUP_MODERATOR) {
|
||||
unset(self::$users[$userId]);
|
||||
}
|
||||
$userFirstname = $userFirstname . ' ' . $this->getData(['user', $userId, 'lastname']) . ' (' . self::$groupEdits[$this->getData(['user', $userId, 'group'])] . ')';
|
||||
|
@ -15,7 +15,7 @@
|
||||
(
|
||||
$this->getData(['module', $this->getUrl(0), $this->getUrl(1),'editConsent']) === $module::EDIT_OWNER
|
||||
AND $this->getData(['module', $this->getUrl(0), $this->getUrl(1),'userId']) === $this->getUser('id')
|
||||
AND $this->getUser('group') >= self::GROUP_EDITOR
|
||||
AND $this->getUser('group') >= self::GROUP_MODERATOR
|
||||
)
|
||||
) OR (
|
||||
// Groupe
|
||||
|
@ -17,13 +17,13 @@
|
||||
class form extends common {
|
||||
|
||||
public static $actions = [
|
||||
'config' => self::GROUP_EDITOR,
|
||||
'data' => self::GROUP_EDITOR,
|
||||
'delete' => self::GROUP_EDITOR,
|
||||
'deleteall' => self::GROUP_EDITOR,
|
||||
'config' => self::GROUP_MODERATOR,
|
||||
'data' => self::GROUP_MODERATOR,
|
||||
'delete' => self::GROUP_MODERATOR,
|
||||
'deleteall' => self::GROUP_MODERATOR,
|
||||
'index' => self::GROUP_VISITOR,
|
||||
'export2csv' => self::GROUP_EDITOR,
|
||||
'output2csv' => self::GROUP_EDITOR
|
||||
'export2csv' => self::GROUP_MODERATOR,
|
||||
'output2csv' => self::GROUP_MODERATOR
|
||||
];
|
||||
|
||||
public static $data = [];
|
||||
|
@ -36,13 +36,13 @@ class gallery extends common {
|
||||
public static $thumbs = [];
|
||||
|
||||
public static $actions = [
|
||||
'config' => self::GROUP_EDITOR,
|
||||
'delete' => self::GROUP_EDITOR,
|
||||
'dirs' => self::GROUP_EDITOR,
|
||||
'sortGalleries' => self::GROUP_EDITOR,
|
||||
'sortPictures' => self::GROUP_EDITOR,
|
||||
'edit' => self::GROUP_EDITOR,
|
||||
'theme' => self::GROUP_EDITOR,
|
||||
'config' => self::GROUP_MODERATOR,
|
||||
'delete' => self::GROUP_MODERATOR,
|
||||
'dirs' => self::GROUP_MODERATOR,
|
||||
'sortGalleries' => self::GROUP_MODERATOR,
|
||||
'sortPictures' => self::GROUP_MODERATOR,
|
||||
'edit' => self::GROUP_MODERATOR,
|
||||
'theme' => self::GROUP_MODERATOR,
|
||||
'index' => self::GROUP_VISITOR
|
||||
];
|
||||
|
||||
|
@ -15,10 +15,10 @@
|
||||
class news extends common {
|
||||
|
||||
public static $actions = [
|
||||
'add' => self::GROUP_EDITOR,
|
||||
'config' => self::GROUP_EDITOR,
|
||||
'delete' => self::GROUP_EDITOR,
|
||||
'edit' => self::GROUP_EDITOR,
|
||||
'add' => self::GROUP_MODERATOR,
|
||||
'config' => self::GROUP_MODERATOR,
|
||||
'delete' => self::GROUP_MODERATOR,
|
||||
'edit' => self::GROUP_MODERATOR,
|
||||
'index' => self::GROUP_VISITOR
|
||||
];
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
class redirection extends common {
|
||||
|
||||
public static $actions = [
|
||||
'config' => self::GROUP_EDITOR,
|
||||
'config' => self::GROUP_MODERATOR,
|
||||
'index' => self::GROUP_VISITOR
|
||||
];
|
||||
|
||||
@ -49,7 +49,7 @@ class redirection extends common {
|
||||
// Message si l'utilisateur peut éditer la page
|
||||
if(
|
||||
$this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
||||
AND $this->getUser('group') >= self::GROUP_EDITOR
|
||||
AND $this->getUser('group') >= self::GROUP_MODERATOR
|
||||
AND $this->getUrl(1) !== 'force'
|
||||
) {
|
||||
// Valeurs en sortie
|
||||
|
@ -20,7 +20,7 @@ class search extends common {
|
||||
|
||||
public static $actions = [
|
||||
'index' => self::GROUP_VISITOR,
|
||||
'config' => self::GROUP_EDITOR
|
||||
'config' => self::GROUP_MODERATOR
|
||||
];
|
||||
|
||||
// Variables pour l'affichage des résultats
|
||||
|
Loading…
Reference in New Issue
Block a user