Modifications première phase

This commit is contained in:
Deltacms 2022-11-07 16:37:05 +01:00
parent 3dacfdbbef
commit 39677ca151
32 changed files with 220 additions and 116 deletions

View File

@ -1,5 +1,8 @@
# Changelog
## Version 4.4.01 de Deltacms
- Modifications :
## Version 4.3.08 de Deltacms
- Modifications :
- Captcha : nouvelle option 'Captcha simple pour les humains', le Captcha se réduit à une simple case à cocher, une analyse comportementale

View File

@ -1,5 +1,5 @@
# DeltaCMS 4.3.08
# DeltaCMS 4.4.01
DeltaCMS est un CMS sans base de données (flat-file) qui permet de créer et gérer facilement un site web sans aucune connaissance en programmation.
L'administration du site est bilingue anglais ou français, le site peut être rédigé dans une des principales langues européennes.

View File

@ -547,6 +547,6 @@ $(document).ready(function(){
dataType: "html"
});
});
});
});
});

View File

@ -27,8 +27,9 @@ class common {
const GROUP_BANNED = -1;
const GROUP_VISITOR = 0;
const GROUP_MEMBER = 1;
const GROUP_MODERATOR = 2;
const GROUP_ADMIN = 3;
const GROUP_EDITOR = 2;
const GROUP_MODERATOR = 3;
const GROUP_ADMIN = 4;
const SIGNATURE_ID = 1;
const SIGNATURE_PSEUDO = 2;
const SIGNATURE_FIRSTLASTNAME = 3;
@ -48,7 +49,7 @@ class common {
// Numéro de version
const DELTA_UPDATE_URL = 'https://update.deltacms.fr/master/';
const DELTA_VERSION = '4.3.08';
const DELTA_VERSION = '4.4.01';
const DELTA_UPDATE_CHANNEL = "v4";
public static $actions = [];
@ -1624,7 +1625,7 @@ class common {
) OR (
$this->getData(['page',$parentPageId,'disable']) === true
AND $this->getUser('password') === $this->getInput('DELTA_USER_PASSWORD')
AND $this->getUser('group') < self::GROUP_MODERATOR
AND $this->getUser('group') < self::GROUP_EDITOR
)
){
$pageUrl = ($this->getData(['locale', 'homePageId']) === $this->getUrl(0)) ? helper::baseUrl(false) : helper::baseUrl() . $this->getUrl(0);
@ -1714,7 +1715,7 @@ class common {
) OR (
$this->getData(['page',$childKey,'disable']) === true
AND $this->getUser('password') === $this->getInput('DELTA_USER_PASSWORD')
AND $this->getUser('group') < self::GROUP_MODERATOR
AND $this->getUser('group') < self::GROUP_EDITOR
)
){
$pageUrl = ($this->getData(['locale', 'homePageId']) === $this->getUrl(0)) ? helper::baseUrl(false) : helper::baseUrl() . $this->getUrl(0);
@ -1954,7 +1955,7 @@ class common {
if($this->getUser('password') === $this->getInput('DELTA_USER_PASSWORD')) {
// Items de gauche
$leftItems = '';
if($this->getUser('group') >= self::GROUP_MODERATOR) {
if($this->getUser('group') >= self::GROUP_EDITOR) {
$leftItems .= '<li><select id="barSelectPage">';
$leftItems .= '<option value="">'.$text['core']['showBar'][0].'</option>';
$leftItems .= '<optgroup label="'.$text['core']['showBar'][1].'">';
@ -2003,7 +2004,7 @@ class common {
}
$leftItems .= '</optgroup>';
$leftItems .= '</select></li>';
$leftItems .= '<li><a href="' . helper::baseUrl() . 'page/add" data-tippy-content="'.$text['core']['showBar'][4] .'"'. template::ico('plus') . '</a></li>';
if($this->getUser('group') >= self::GROUP_MODERATOR) $leftItems .= '<li><a href="' . helper::baseUrl() . 'page/add" data-tippy-content="'.$text['core']['showBar'][4] .'"'. template::ico('plus') . '</a></li>';
if(
// Sur un module de page qui autorise le bouton de modification de la page
$this->output['showBarEditButton']
@ -2016,13 +2017,15 @@ class common {
if ($this->getData(['page', $this->getUrl(0),'moduleId'])) {
$leftItems .= '<li><a href="' . helper::baseUrl() . $this->getUrl(0) . '/config' . '" data-tippy-content="'.$text['core']['showBar'][6].'">' . template::ico('gear') . '</a></li>';
}
$leftItems .= '<li><a id="pageDuplicate" href="' . helper::baseUrl() . 'page/duplicate/' . $this->getUrl(0) . '&csrf=' . $_SESSION['csrf'] . '" data-tippy-content="'.$text['core']['showBar'][7].'">' . template::ico('clone') . '</a></li>';
$leftItems .= '<li><a id="pageDelete" href="' . helper::baseUrl() . 'page/delete/' . $this->getUrl(0) . '&csrf=' . $_SESSION['csrf'] . '" data-tippy-content="'.$text['core']['showBar'][8].'">' . template::ico('trash') . '</a></li>';
if($this->getUser('group') >= self::GROUP_MODERATOR) {
$leftItems .= '<li><a id="pageDuplicate" href="' . helper::baseUrl() . 'page/duplicate/' . $this->getUrl(0) . '&csrf=' . $_SESSION['csrf'] . '" data-tippy-content="'.$text['core']['showBar'][7].'">' . template::ico('clone') . '</a></li>';
$leftItems .= '<li><a id="pageDelete" href="' . helper::baseUrl() . 'page/delete/' . $this->getUrl(0) . '&csrf=' . $_SESSION['csrf'] . '" data-tippy-content="'.$text['core']['showBar'][8].'">' . template::ico('trash') . '</a></li>';
}
}
}
// Items de droite
$rightItems = '';
if($this->getUser('group') >= self::GROUP_MODERATOR) {
if($this->getUser('group') >= self::GROUP_EDITOR) {
$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="'.$text['core']['showBar'][9] .'" data-lity>' . template::ico('folder') . '</a></li>';
}
if($this->getUser('group') >= self::GROUP_ADMIN) {
@ -2049,7 +2052,7 @@ class common {
$rightItems .= '<li><a id="barUpdate" href="' . helper::baseUrl() . 'install/update" data-tippy-content="'.$text['core']['showBar'][15]. common::DELTA_VERSION .' vers '. helper::getOnlineVersion(common::DELTA_UPDATE_CHANNEL) .'">' . template::ico('update colorRed') . '</a></li>';
}
}
if($this->getUser('group') >= self::GROUP_MODERATOR) {
if($this->getUser('group') >= self::GROUP_EDITOR) {
$rightItems .= '<li><a href="' . helper::baseUrl() . 'user/edit/' . $this->getUser('id'). '/' . $_SESSION['csrf'] . '" data-tippy-content="'.$text['core']['showBar'][16].'">' . template::ico('user', 'right') . '<span id="displayUsername">' . $this->getUser('firstname') . ' ' . $this->getUser('lastname') . '</span></a></li>';
}
$rightItems .= '<li><a id="barLogout" href="' . helper::baseUrl() . 'user/logout" data-tippy-content="'.$text['core']['showBar'][17].'">' . template::ico('logout') . '</a></li>';
@ -2101,7 +2104,7 @@ class common {
$vars .= 'var baseUrlQs = ' . json_encode(helper::baseUrl()) . ';';
if(
$this->getUser('password') === $this->getInput('DELTA_USER_PASSWORD')
AND $this->getUser('group') >= self::GROUP_MODERATOR
AND $this->getUser('group') >= self::GROUP_EDITOR
) {
$vars .= 'var privateKey = ' . json_encode(md5_file(self::DATA_DIR.'core.json')) . ';';
}
@ -2363,10 +2366,10 @@ class core extends common {
$css .= '.block h4 {background-color:'. $colors['normal'] . ';color:' . $colors['text'] .';border-radius: ' . $this->getdata(['theme','block','blockBorderRadius']) . ' ' . $this->getdata(['theme','block','blockBorderRadius']) . ' 0px 0px;}';
$css .= '.block p {margin: 0px -5px;}';
//$css .= '.mce-tinymce {border: 1px solid ' . $this->getdata(['theme','block','borderColor']) .' !important;}';
//Tinymce option titre sous une image valeurs par défaut modifiables dans custom.css
$css .= 'figure.image { border-color: ' . $this->getdata(['theme','block','borderColor']) . '; background-color: ' . $this->getdata(['theme','block','backgroundColor']).'}';
// Bannière
// Eléments communs
@ -2659,7 +2662,7 @@ class core extends common {
) OR (
$this->getData(['page', $this->getUrl(0),'disable']) === true
AND $this->getUser('password') === $this->getInput('DELTA_USER_PASSWORD')
AND $this->getUser('group') < self::GROUP_MODERATOR
AND $this->getUser('group') < self::GROUP_EDITOR
)
){
$access = false;
@ -2963,19 +2966,23 @@ class core extends common {
}
// Erreurs
// Lexique
include('./core/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_core.php');
if($access === 'login') {
http_response_code(302);
header('Location:' . helper::baseUrl() . 'user/login/');
exit();
}
if($access === false) {
http_response_code(403);
if($access === false) {
if ($accessInfo['userName']) {
http_response_code(409);
$this->addOutput([
'title' => 'Accès verrouillé',
'content' => template::speech('La page <strong>' . $accessInfo['pageId'] . '</strong> est ouverte par l\'utilisateur <strong>' . $accessInfo['userName'] . '</strong>')
'title' => $text['core']['router'][0],
'content' => template::speech( $text['core']['router'][1] . '<strong>' . $accessInfo['pageId'] . '</strong>'. $text['core']['router'][2] .'<strong>' . $accessInfo['userName'] . '</strong>')
]);
} else {
http_response_code(403);
$_SESSION['humanBot'] = 'bot';
if ( $this->getData(['locale','page403']) !== 'none'
AND $this->getData(['page',$this->getData(['locale','page403'])]))
@ -2983,8 +2990,8 @@ class core extends common {
header('Location:' . helper::baseUrl() . $this->getData(['locale','page403']));
} else {
$this->addOutput([
'title' => 'Accès interdit',
'content' => template::speech('Vous n\'êtes pas autorisé à consulter cette page (erreur 403)')
'title' => $text['core']['router'][3],
'content' => template::speech( $text['core']['router'][4] )
]);
}
}
@ -2997,8 +3004,8 @@ class core extends common {
header('Location:' . helper::baseUrl() . $this->getData(['locale','page404']));
} else {
$this->addOutput([
'title' => 'Page indisponible',
'content' => template::speech('Oups ! La page demandée n\'existe pas ou est introuvable (erreur 404)')
'title' => $text['core']['router'][5],
'content' => template::speech( $text['core']['router'][6] )
]);
}
}

View File

@ -68,7 +68,7 @@ if ($this->getData(['core', 'dataVersion']) < 4307) {
}
if ($this->getData(['core', 'dataVersion']) < 4308) {
$this->setData(['config', 'connect', 'captchaBot', false]);
$this->setData(['config', 'connect', 'captchaBot', true]);
$this->setData(['locale', 'captchaSimpleText', 'Je ne suis pas un robot' ]);
$this->setData(['locale', 'captchaSimpleHelp', 'Cochez cette case pour prouver que vous n\'êtes pas un robot' ]);
$this->deleteData([ 'config', 'connect', 'captchaStrong' ]);
@ -76,4 +76,15 @@ if ($this->getData(['core', 'dataVersion']) < 4308) {
// Mise à jour
$this->setData(['core', 'dataVersion', 4308]);
}
if ($this->getData(['core', 'dataVersion']) < 4401) {
$userIdsFirstnames = helper::arrayCollumn($this->getData(['user']), 'firstname');
foreach($userIdsFirstnames as $userId => $userFirstname) {
if ($this->getData(['user', $userId, 'group']) >= 2) {
$this->setData(['user', $userId, 'group', $this->getData(['user', $userId, 'group']) +1 ]);
}
}
// Mise à jour
$this->setData(['core', 'dataVersion', 4401]);
}
?>

View File

@ -24,6 +24,13 @@ $text['core']['showBar'][14] = 'Setting up users';
$text['core']['showBar'][15] = 'Updating DeltaCMS ';
$text['core']['showBar'][16] = 'Set up my account';
$text['core']['showBar'][17] = 'Logout';
$text['core']['router'][0] = 'Access locked';
$text['core']['router'][1] = 'The page ';
$text['core']['router'][2] = ' is opened by the user ';
$text['core']['router'][3] = 'Access denied';
$text['core']['router'][4] = 'You are not authorised to view this page (error 403)';
$text['core']['router'][5] = 'Page unavailable';
$text['core']['router'][6] = 'Oops! The requested page does not exist or cannot be found (error 404)';
// core.js.php

View File

@ -24,7 +24,13 @@ $text['core']['showBar'][14] = 'Configurer les utilisateurs';
$text['core']['showBar'][15] = 'Mettre à jour DeltaCMS ';
$text['core']['showBar'][16] = 'Configurer mon compte';
$text['core']['showBar'][17] = 'Me déconnecter';
$text['core']['router'][0] = 'Accès verrouillé';
$text['core']['router'][1] = 'La page ';
$text['core']['router'][2] = ' est ouverte par l\'utilisateur ';
$text['core']['router'][3] = 'Accès interdit';
$text['core']['router'][4] = 'Vous n\'êtes pas autorisé à consulter cette page (erreur 403)';
$text['core']['router'][5] = 'Page indisponible';
$text['core']['router'][6] = 'Oups ! La page demandée n\'existe pas ou est introuvable (erreur 404)';
// core.js.php
$text['core_js'][0] = "Effectuer la mise à jour ?";

View File

@ -1772,12 +1772,18 @@ th.col12 {
}
}
/* Option image avec titre dans tinymce */
figure.image {
display: inline-block;
border: 1px solid;
margin: 0 6px;
}
figure.align-center {
display: table;
margin:auto;
}
figure.align-left {
float: left;
}

View File

@ -14,8 +14,8 @@
?>
<link rel="stylesheet" href="<?php echo helper::baseUrl(false); ?>core/layout/common.css">
<link rel="stylesheet" href="<?php echo helper::baseUrl(false); ?>core/layout/light.css">
<link rel="stylesheet" href="<?php echo helper::baseUrl(false) . self::DATA_DIR; ?>theme.css?<?php echo md5_file(self::DATA_DIR.'theme.css'); ?>">
<link rel="stylesheet" href="<?php echo helper::baseUrl(false) . self::DATA_DIR; ?>custom.css?<?php echo md5_file(self::DATA_DIR.'custom.css'); ?>">
<link rel="stylesheet" href="<?php echo helper::baseUrl(false) . self::DATA_DIR; ?>theme.css">
<link rel="stylesheet" href="<?php echo helper::baseUrl(false) . self::DATA_DIR; ?>custom.css">
</head>
<body>
<?php $this->showNotification(); ?>
@ -24,4 +24,4 @@
</div>
<?php $this->showScript(); ?>
</body>
</html>
</html>

View File

@ -15,16 +15,16 @@ if( $this->getInput('DELTA_I18N_SITE') !== '' && $this->getInput('DELTA_I18N_SIT
$this->showFavicon();
$this->showVendor();
?>
<link rel="stylesheet" href="<?php echo helper::baseUrl(false); ?>core/layout/common.css?<?php echo md5_file('core/layout/common.css');?>">
<link rel="stylesheet" href="<?php echo helper::baseUrl(false) . self::DATA_DIR; ?>theme.css?<?php echo md5_file(self::DATA_DIR.'theme.css'); ?>">
<link rel="stylesheet" href="<?php echo helper::baseUrl(false) . self::DATA_DIR; ?>custom.css?<?php echo md5_file(self::DATA_DIR.'custom.css'); ?>">
<link rel="stylesheet" href="<?php echo helper::baseUrl(false); ?>core/layout/common.css">
<link rel="stylesheet" href="<?php echo helper::baseUrl(false) . self::DATA_DIR; ?>theme.css">
<link rel="stylesheet" href="<?php echo helper::baseUrl(false) . self::DATA_DIR; ?>custom.css">
<!-- Détection RSS -->
<?php if ( ( $this->getData(['page', $this->getUrl(0), 'moduleId']) === 'blog'
OR $this->getData(['page', $this->getUrl(0), 'moduleId']) === 'news' )
AND $this->getData(['module', $this->getUrl(0), 'config', 'feeds']) === TRUE ): ?>
<link rel="alternate" type="application/rss+xml" href="'<?php echo helper::baseUrl(). $this->getUrl(0) . '/rss';?>" title="fLUX rss">
<?php endif; ?>
<?php $this->showStyle(); ?>
<?php $this->showStyle(); echo PHP_EOL; ?>
<?php if (file_exists(self::DATA_DIR .'head.inc.html')) {
include(self::DATA_DIR .'head.inc.html');
}?>
@ -131,8 +131,7 @@ if( $this->getInput('DELTA_I18N_SITE') !== '' && $this->getInput('DELTA_I18N_SIT
<?php echo $this->getData(['theme','header','featureContent']);?>
</div>
<?php endif; ?>
</header>
</header>
<?php endif; ?>
<!-- Menu dans le fond du site après la bannière -->

View File

@ -68,7 +68,7 @@ class init extends common {
]
],
'core' => [
'dataVersion' => 4308,
'dataVersion' => 4401,
'lastBackup' => 0,
'lastClearTmp' => 0,
'lastAutoUpdate' => 0,

View File

@ -84,7 +84,8 @@ $displayMenu = [
$groupPublics = [
self::GROUP_VISITOR => 'Visitor',
self::GROUP_MEMBER => 'Member',
self::GROUP_MODERATOR => 'Editor',
self::GROUP_EDITOR => 'Editor',
self::GROUP_MODERATOR => 'Moderator',
self::GROUP_ADMIN => 'Administrator'
];
?>

View File

@ -85,7 +85,8 @@ $displayMenu = [
$groupPublics = [
self::GROUP_VISITOR => 'Visiteur',
self::GROUP_MEMBER => 'Membre',
self::GROUP_MODERATOR => 'Éditeur',
self::GROUP_EDITOR => 'Editeur',
self::GROUP_MODERATOR => 'Modérateur',
self::GROUP_ADMIN => 'Administrateur'
];
?>

View File

@ -21,7 +21,7 @@ class page extends common {
public static $actions = [
'add' => self::GROUP_MODERATOR,
'delete' => self::GROUP_MODERATOR,
'edit' => self::GROUP_MODERATOR,
'edit' => self::GROUP_EDITOR,
'duplicate' => self::GROUP_MODERATOR
];

View File

@ -38,19 +38,19 @@ echo template::formOpen('pageEditForm'); ?>
]); ?>
</div>
<div class="col2 offset2">
<?php echo template::button('pageEditDuplicate', [
<?php if($this->getUser('group') >= self::GROUP_MODERATOR) { echo template::button('pageEditDuplicate', [
'href' => helper::baseUrl() . 'page/duplicate/' . $this->getUrl(2) . '&csrf=' . $_SESSION['csrf'],
'value' => $text['core_page_view']['edit'][2],
'ico' => 'clone'
]); ?>
]); } ?>
</div>
<div class="col2">
<?php echo template::button('pageEditDelete', [
<?php if($this->getUser('group') >= self::GROUP_MODERATOR) { echo template::button('pageEditDelete', [
'class' => 'buttonRed',
'href' => helper::baseUrl() . 'page/delete/' . $this->getUrl(2) . '&csrf=' . $_SESSION['csrf'],
'value' => $text['core_page_view']['edit'][3],
'ico' => 'cancel'
]); ?>
]); } ?>
</div>
<div class="col2">
<?php echo template::submit('pageEditSubmit', [
@ -84,7 +84,7 @@ echo template::formOpen('pageEditForm'); ?>
]); ?>
</div>
<div class="col4">
<div class="row">
<div class="row" <?php if($this->getUser('group') < self::GROUP_MODERATOR) { echo 'style="display: none;"'; } ?>>
<div class="col9">
<?php echo template::hidden('pageEditModuleRedirect'); ?>
<?php echo template::select('pageEditModuleId', $module::$moduleIds, [
@ -144,8 +144,16 @@ echo template::formOpen('pageEditForm'); ?>
]); ?>
</div>
</div>
<?php
if($this->getUser('group') < self::GROUP_MODERATOR) {
echo '<div style="display: none;">';
}
else {
echo '<div style="display: block;">';
}
?>
<div class="row">
<div class="col12" id="pageEditBlockLayout">
<div class="col12" id="pageEditBlockLayout">
<div class="block">
<h4><?php echo $text['core_page_view']['edit'][16]; ?>
<span id="specialeHelpButton" class="helpDisplayButton">
@ -201,7 +209,7 @@ echo template::formOpen('pageEditForm'); ?>
</div>
</div>
<div class="row">
<div class="col12" id="pageEditMenu">
<div class="col12" id="pageEditMenu">
<div class="block">
<h4><?php echo $text['core_page_view']['edit'][23]; ?>
<span id="specialeHelpButton" class="helpDisplayButton">
@ -324,9 +332,10 @@ echo template::formOpen('pageEditForm'); ?>
</div>
</div>
</div>
</div><!-- conditionnelle -->
<?php echo template::formClose(); ?>
<script>
var textConfirm = <?php echo '"'.$text['core_page_view']['edit'][41].'"'; ?>;
var text1Confirm = <?php echo '"'.$text['core_page_view']['edit'][42].'"'; ?>;
var text2Confirm = <?php echo '"'.$text['core_page_view']['edit'][43].'"'; ?>;
</script>
</script>

View File

@ -217,6 +217,11 @@ figure.image {
background-color: #f5f2f0;
}
figure.align-center {
display: table;
margin:auto;
}
figure.align-left {
float: left;
}

View File

@ -12,7 +12,7 @@ $text['core_user_view']['add'][8] = 'File sharing allowed';
$text['core_user_view']['add'][9] = 'This member will be able to upload or download files to the \'partage\' folder and its subfolders';
$text['core_user_view']['add'][10] = 'Authorisations :';
$text['core_user_view']['add'][11] = 'Access to private member pages';
$text['core_user_view']['add'][12] = 'Access to members\' and editors\' private pages';
$text['core_user_view']['add'][12] = 'Access to private member to moderator pages';
$text['core_user_view']['add'][13] = 'General information';
$text['core_user_view']['add'][14] = 'Add / Edit / Delete pages';
$text['core_user_view']['add'][15] = 'Add / Edit / Delete files';
@ -30,6 +30,9 @@ $text['core_user_view']['add'][26] = 'Redirection';
$text['core_user_view']['add'][27] = 'Redirection after login';
$text['core_user_view']['add'][28] = 'Select \'Aucune\' if you do not want a redirection.';
$text['core_user_view']['add'][29] = 'Register';
$text['core_user_view']['add'][30] = 'Edit pages';
$text['core_user_view']['add'][31] = 'Add files';
$text['core_user_view']['add'][32] = 'Access to private members\' and editors\' pages';
$text['core_user_view']['edit'][0] = 'Back';
$text['core_user_view']['edit'][1] = 'Help';
$text['core_user_view']['edit'][2] = 'First name';

View File

@ -12,7 +12,7 @@ $text['core_user_view']['add'][8] = 'Partage de fichiers autorisé';
$text['core_user_view']['add'][9] = 'Ce membre pourra téléverser ou télécharger des fichiers dans le dossier \'partage\' et ses sous-dossiers';
$text['core_user_view']['add'][10] = 'Autorisations :';
$text['core_user_view']['add'][11] = 'Accès aux pages privées membres';
$text['core_user_view']['add'][12] = 'Accès aux pages privées membres et éditeurs';
$text['core_user_view']['add'][12] = 'Accès aux pages privées membres à modérateurs';
$text['core_user_view']['add'][13] = 'Informations générales';
$text['core_user_view']['add'][14] = 'Ajout / Édition / Suppression de pages';
$text['core_user_view']['add'][15] = 'Ajout / Édition / Suppression de fichiers';
@ -30,6 +30,9 @@ $text['core_user_view']['add'][26] = 'Redirection';
$text['core_user_view']['add'][27] = 'Redirection après connexion';
$text['core_user_view']['add'][28] = 'Choisir Aucune si vous ne souhaitez pas de redirection.';
$text['core_user_view']['add'][29] = 'Enregistrer';
$text['core_user_view']['add'][30] = 'Édition de pages';
$text['core_user_view']['add'][31] = 'Ajout de fichiers';
$text['core_user_view']['add'][32] = 'Accès aux pages privées membres et éditeurs';
$text['core_user_view']['edit'][0] = 'Retour';
$text['core_user_view']['edit'][1] = 'Aide';
$text['core_user_view']['edit'][2] = 'Prénom';
@ -166,18 +169,21 @@ $groups = [
self::GROUP_BANNED => 'Banni',
self::GROUP_VISITOR => 'Visiteur',
self::GROUP_MEMBER => 'Membre',
self::GROUP_MODERATOR => 'Éditeur',
self::GROUP_EDITOR => 'Éditeur',
self::GROUP_MODERATOR => 'Modérateur',
self::GROUP_ADMIN => 'Administrateur'
];
$groupNews = [
self::GROUP_MEMBER => 'Membre',
self::GROUP_MODERATOR => 'Éditeur',
self::GROUP_EDITOR => 'Éditeur',
self::GROUP_MODERATOR => 'Modérateur',
self::GROUP_ADMIN => 'Administrateur'
];
$groupEdits = [
self::GROUP_BANNED => 'Banni',
self::GROUP_MEMBER => 'Membre',
self::GROUP_MODERATOR => 'Éditeur',
self::GROUP_EDITOR => 'Éditeur',
self::GROUP_MODERATOR => 'Modérateur',
self::GROUP_ADMIN => 'Administrateur'
];
?>

View File

@ -281,7 +281,7 @@ class user extends common {
$redirect = helper::baseUrl() . 'user/login/' . str_replace('/', '_', $this->getUrl());
}
// Redirection si retour en arrière possible
elseif($this->getUser('group') === 3) {
elseif($this->getUser('group') === self::GROUP_ADMIN) {
$redirect = helper::baseUrl() . 'user';
}
// Redirection normale

View File

@ -69,6 +69,11 @@ include('./core/module/user/lang/'. $this->getData(['config', 'i18n', 'langAdmin
<?php echo $text['core_user_view']['add'][10]; ?>
<ul id="userAddGroupDescription<?php echo self::GROUP_MEMBER; ?>" class="userAddGroupDescription displayNone">
<li><?php echo $text['core_user_view']['add'][11]; ?></li>
</ul>
<ul id="userAddGroupDescription<?php echo self::GROUP_EDITOR; ?>" class="userAddGroupDescription displayNone">
<li><?php echo $text['core_user_view']['add'][30]; ?></li>
<li><?php echo $text['core_user_view']['add'][31]; ?></li>
<li><?php echo $text['core_user_view']['add'][32]; ?></li>
</ul>
<ul id="userAddGroupDescription<?php echo self::GROUP_MODERATOR; ?>" class="userAddGroupDescription displayNone">
<li><?php echo $text['core_user_view']['add'][12]; ?></li>

View File

@ -33,7 +33,7 @@ $group = $tab['user'][$userId]['group'];
$uploadDir = '/site/file/source/';
$currentPath = '../../../site/file/source/';
switch ($group) {
case 3:
case 4:
// Administrateur, droits maximum
$deleteFiles = true;
$createFolders = true;
@ -52,11 +52,11 @@ switch ($group) {
$createtextFiles = true;
$downloadFiles = true;
break;
case 2:
// Modérateur éditeur
case 3:
// Modérateur
$deleteFiles = true;
$createFolders = false;
$deleteFolders = false;
$createFolders = true;
$deleteFolders = true;
$uploadFiles = true;
$renameFiles = true;
$renameFolders = false;
@ -71,6 +71,25 @@ switch ($group) {
$createtextFiles = true;
$downloadFiles = true;
break;
case 2:
// Editeur
$deleteFiles = false;
$createFolders = true;
$deleteFolders = false;
$uploadFiles = true;
$renameFiles = false;
$renameFolders = false;
$duplicateFiles = false;
$extractFiles = false;
$copycutFiles = false;
$copycutDirs = false;
$chmodFiles = false;
$chmodDirs = false;
$previewtextFiles = false;
$edittextFiles = false;
$createtextFiles = false;
$downloadFiles = true;
break;
default:
// Membre avec droits d'upload / download
$uploadDir = '/site/file/source/partage/';

View File

@ -27,16 +27,16 @@ class agenda extends common {
public static $actions = [
'creation' => self::GROUP_VISITOR,
'edition' => self::GROUP_VISITOR,
'config' => self::GROUP_MODERATOR,
'categories' => self::GROUP_MODERATOR,
'config' => self::GROUP_EDITOR,
'categories' => self::GROUP_EDITOR,
'delete' => self::GROUP_VISITOR,
'deleteEvent' => self::GROUP_VISITOR,
'deleteall' => self::GROUP_MODERATOR,
'categorieDelete' => self::GROUP_MODERATOR,
'categorieDelete' => self::GROUP_EDITOR,
'index' => self::GROUP_VISITOR
];
const VERSION = '5.4';
const VERSION = '5.5';
const REALNAME = 'Agenda';
const DELETE = true;
const UPDATE = '4.1';
@ -585,6 +585,7 @@ class agenda extends common {
// Liste des utilisateurs
$membres = '';
$editeurs = '';
$moderateurs = '';
$administrateurs = '';
$inscrits = '';
foreach($this->getData(['user']) as $userId => $arrayValues){
@ -598,6 +599,9 @@ class agenda extends common {
$editeurs .= $mail.',';
break;
case 3:
$moderateurs .= $mail.',';
break;
case 4:
$administrateurs .= $mail.',';
break;
default :
@ -609,10 +613,12 @@ class agenda extends common {
//suppression de la dernière virgule
if( $membres != ''){$membres = substr($membres, 0, -1);}
if( $editeurs != ''){$editeurs = substr($editeurs, 0, -1);}
if( $moderateurs != ''){$editeurs = substr($editeurs, 0, -1);}
$administrateurs = substr($administrateurs, 0, -1);
$inscrits = substr($inscrits, 0, -1);
//Placer les listes dans un fichier txt et sauvegarder dans le dossier self::DATAMODULE.adresses
file_put_contents(self::DATAMODULE.'adresses/editeurs_administrateurs.txt', $editeurs.','.$administrateurs);
file_put_contents(self::DATAMODULE.'adresses/editeurs_administrateurs.txt', $editeurs.','.$moderateurs.', '.$administrateurs);
file_put_contents(self::DATAMODULE.'adresses/moderateurs_administrateurs.txt', $moderateurs.', '.$administrateurs);
file_put_contents(self::DATAMODULE.'adresses/administrateurs.txt', $administrateurs);
file_put_contents(self::DATAMODULE.'adresses/tous_inscrits.txt', $inscrits);

View File

@ -138,7 +138,8 @@ $groupe = [
'0' => 'Visitor',
'1' => 'Member',
'2' => 'Editor',
'3' => 'Administrator'
'3' => 'Moderator',
'4' => 'Administrator'
];
$couleur = [
'black' => 'black',

View File

@ -138,7 +138,8 @@ $groupe = [
'0' => 'Visiteur',
'1' => 'Membre',
'2' => 'Editeur',
'3' => 'Administrateur'
'3' => 'Modérateur',
'4' => 'Administrateur'
];
$couleur = [
'black' => 'noir',

View File

@ -96,19 +96,21 @@ echo template::formOpen('configuration'); ?>
</div>
<!--Tout supprimer-->
<div class="block">
<h4><?php echo $text['agenda_view']['config'][16]; ?></h4>
<div class="col4">
<?php echo template::button('config_suptout', [
'class' => 'configSup buttonRed',
'disabled' => $readonly,
'help' => $text['agenda_view']['config'][20],
'href' => helper::baseUrl() . $this->getUrl(0).'/deleteall',
'ico' => 'cancel',
'value' => $text['agenda_view']['config'][21]
]); ?>
</div>
</div>
<?php if($this->getUser('group') >= self::GROUP_MODERATOR) { ?>
<div class="block">
<h4><?php echo $text['agenda_view']['config'][16]; ?></h4>
<div class="col4">
<?php echo template::button('config_suptout', [
'class' => 'configSup buttonRed',
'disabled' => $readonly,
'help' => $text['agenda_view']['config'][20],
'href' => helper::baseUrl() . $this->getUrl(0).'/deleteall',
'ico' => 'cancel',
'value' => $text['agenda_view']['config'][21]
]); ?>
</div>
</div>
<?php } ?>
<!-- Sélection d'un fichier ics depuis le dossier site/file/source/agenda/ics -->
<div class="block">

View File

@ -28,6 +28,9 @@ if ( $this->getData(['module', $this->getUrl(0), 'config', 'droit_limite']) ){
case 2 :
array_splice($groupe,3);
break;
case 3 :
array_splice($groupe,4);
break;
}
}
@ -43,7 +46,7 @@ echo template::formOpen('creation_events'); ?>
</div>
<?php if( $this->getUser('group') >= $this->getData(['module', $this->getUrl(0), 'config', 'droit_creation']) ){
if( $this->getUser('group') >= 2){
if( $this->getUser('group') >= self::GROUP_EDITOR){
$class_tinymce = 'editorWysiwyg';
}
else{
@ -131,7 +134,7 @@ echo template::formOpen('creation_events'); ?>
<div class="col4">
<?php
$groupe_mini = $this->getUser('group');
if ($groupe_mini == 3){ $groupe_mini = 2;}
if ($groupe_mini == self::GROUP_ADMIN){ $groupe_mini = self::GROUP_MODERATOR;}
?>
<?php echo template::select('creation_groupe_mod', $groupe,[
'help' => $text['agenda_view']['creation'][17],

View File

@ -15,7 +15,7 @@ echo '<link rel="stylesheet" href="' . helper::baseUrl(false) . 'core/vendor/tin
// Adaptation de Tinymce en fonction des droits des utilisateurs
if( $this->getUser('group') >= $module::$evenement['groupe_mod'] ){
if( $this->getUser('group') >= 2){
if( $this->getUser('group') >= self::GROUP_EDITOR){
$class_tinymce = 'editorWysiwyg';
}
else{
@ -39,6 +39,9 @@ if ( $this->getData(['module', $this->getUrl(0), 'config', 'droit_limite']) ){
case 2 :
array_splice($groupe,3);
break;
case 3 :
array_splice($groupe,4);
break;
}
}

View File

@ -18,7 +18,7 @@
class blog extends common {
const VERSION = '6.4';
const VERSION = '6.5';
const REALNAME = 'Blog';
const DELETE = true;
const UPDATE = '0.0';
@ -29,15 +29,15 @@ class blog extends common {
const EDIT_ALL = 'all';
public static $actions = [
'add' => self::GROUP_MODERATOR,
'comment' => self::GROUP_MODERATOR,
'commentApprove' => self::GROUP_MODERATOR,
'commentDelete' => self::GROUP_MODERATOR,
'commentDeleteAll' => self::GROUP_MODERATOR,
'config' => self::GROUP_MODERATOR,
'texts' => self::GROUP_MODERATOR,
'delete' => self::GROUP_MODERATOR,
'edit' => self::GROUP_MODERATOR,
'add' => self::GROUP_EDITOR,
'comment' => self::GROUP_EDITOR,
'commentApprove' => self::GROUP_EDITOR,
'commentDelete' => self::GROUP_EDITOR,
'commentDeleteAll' => self::GROUP_EDITOR,
'config' => self::GROUP_EDITOR,
'texts' => self::GROUP_EDITOR,
'delete' => self::GROUP_EDITOR,
'edit' => self::GROUP_EDITOR,
'index' => self::GROUP_VISITOR,
'rss' => self::GROUP_VISITOR
];

View File

@ -18,21 +18,21 @@
class form extends common {
const VERSION = '4.4';
const VERSION = '4.5';
const REALNAME = 'Formulaire';
const DELETE = true;
const UPDATE = '0.0';
const DATADIRECTORY = ''; // Contenu localisé inclus par défaut (page.json et module.json)
public static $actions = [
'config' => self::GROUP_MODERATOR,
'update' => self::GROUP_MODERATOR,
'data' => self::GROUP_MODERATOR,
'delete' => self::GROUP_MODERATOR,
'deleteall' => self::GROUP_MODERATOR,
'config' => self::GROUP_EDITOR,
'update' => self::GROUP_EDITOR,
'data' => self::GROUP_EDITOR,
'delete' => self::GROUP_EDITOR,
'deleteall' => self::GROUP_EDITOR,
'index' => self::GROUP_VISITOR,
'export2csv' => self::GROUP_MODERATOR,
'output2csv' => self::GROUP_MODERATOR
'export2csv' => self::GROUP_EDITOR,
'output2csv' => self::GROUP_EDITOR
];
public static $data = [];

View File

@ -19,7 +19,7 @@
class gallery extends common {
const VERSION = '4.1';
const VERSION = '4.2';
const REALNAME = 'Galerie';
const DELETE = true;
const UPDATE = '0.0';
@ -45,13 +45,13 @@ class gallery extends common {
public static $thumbs = [];
public static $actions = [
'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,
'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,
'index' => self::GROUP_VISITOR
];

View File

@ -18,17 +18,17 @@
class news extends common {
const VERSION = '4.3';
const VERSION = '4.4';
const REALNAME = 'News';
const DELETE = true;
const UPDATE = '0.0';
const DATADIRECTORY = self::DATA_DIR . 'news/';
public static $actions = [
'add' => self::GROUP_MODERATOR,
'config' => self::GROUP_MODERATOR,
'delete' => self::GROUP_MODERATOR,
'edit' => self::GROUP_MODERATOR,
'add' => self::GROUP_EDITOR,
'config' => self::GROUP_EDITOR,
'delete' => self::GROUP_EDITOR,
'edit' => self::GROUP_EDITOR,
'index' => self::GROUP_VISITOR,
'rss' => self::GROUP_VISITOR
];

View File

@ -18,14 +18,14 @@
class redirection extends common {
const VERSION = '2.1';
const VERSION = '2.2';
const REALNAME = 'Redirection';
const DELETE = true;
const UPDATE = '0.0';
const DATADIRECTORY = ''; // Contenu localisé inclus par défaut (page.json et module.json)
public static $actions = [
'config' => self::GROUP_MODERATOR,
'config' => self::GROUP_EDITOR,
'index' => self::GROUP_VISITOR
];
@ -61,7 +61,7 @@ class redirection extends common {
// Message si l'utilisateur peut éditer la page
if(
$this->getUser('password') === $this->getInput('DELTA_USER_PASSWORD')
AND $this->getUser('group') >= self::GROUP_MODERATOR
AND $this->getUser('group') >= self::GROUP_EDITOR
AND $this->getUrl(1) !== 'force'
) {
// Valeurs en sortie