diff --git a/CHANGES.md b/CHANGES.md index 85773ce..b431608 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -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 diff --git a/README.md b/README.md index bea3e4f..9c5eaee 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/core/core.js.php b/core/core.js.php index b18e680..0426fb1 100644 --- a/core/core.js.php +++ b/core/core.js.php @@ -547,6 +547,6 @@ $(document).ready(function(){ dataType: "html" }); }); - }); + }); }); diff --git a/core/core.php b/core/core.php index 665a193..4bdcba9 100644 --- a/core/core.php +++ b/core/core.php @@ -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 .= '
  • '; - $leftItems .= '
  • '; + if($this->getUser('group') >= self::GROUP_MODERATOR) $leftItems .= '
  • '; 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 .= '
  • ' . template::ico('gear') . '
  • '; } - $leftItems .= '
  • ' . template::ico('clone') . '
  • '; - $leftItems .= '
  • ' . template::ico('trash') . '
  • '; + if($this->getUser('group') >= self::GROUP_MODERATOR) { + $leftItems .= '
  • ' . template::ico('clone') . '
  • '; + $leftItems .= '
  • ' . template::ico('trash') . '
  • '; + } } } // Items de droite $rightItems = ''; - if($this->getUser('group') >= self::GROUP_MODERATOR) { + if($this->getUser('group') >= self::GROUP_EDITOR) { $rightItems .= '
  • ' . template::ico('folder') . '
  • '; } if($this->getUser('group') >= self::GROUP_ADMIN) { @@ -2049,7 +2052,7 @@ class common { $rightItems .= '
  • ' . template::ico('update colorRed') . '
  • '; } } - if($this->getUser('group') >= self::GROUP_MODERATOR) { + if($this->getUser('group') >= self::GROUP_EDITOR) { $rightItems .= '
  • ' . template::ico('user', 'right') . '' . $this->getUser('firstname') . ' ' . $this->getUser('lastname') . '
  • '; } $rightItems .= '
  • ' . template::ico('logout') . '
  • '; @@ -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 ' . $accessInfo['pageId'] . ' est ouverte par l\'utilisateur ' . $accessInfo['userName'] . '') + 'title' => $text['core']['router'][0], + 'content' => template::speech( $text['core']['router'][1] . '' . $accessInfo['pageId'] . ''. $text['core']['router'][2] .'' . $accessInfo['userName'] . '') ]); } 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] ) ]); } } diff --git a/core/include/update.inc.php b/core/include/update.inc.php index 8ff7fab..c788f60 100644 --- a/core/include/update.inc.php +++ b/core/include/update.inc.php @@ -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]); +} ?> diff --git a/core/lang/en/lex_core.php b/core/lang/en/lex_core.php index f74e87f..ca35749 100644 --- a/core/lang/en/lex_core.php +++ b/core/lang/en/lex_core.php @@ -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 diff --git a/core/lang/fr/lex_core.php b/core/lang/fr/lex_core.php index a6d0cdc..b46f96d 100644 --- a/core/lang/fr/lex_core.php +++ b/core/lang/fr/lex_core.php @@ -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 ?"; diff --git a/core/layout/common.css b/core/layout/common.css index df3d1ad..16cf560 100644 --- a/core/layout/common.css +++ b/core/layout/common.css @@ -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; } diff --git a/core/layout/light.php b/core/layout/light.php index ff10cd8..8ddad4b 100644 --- a/core/layout/light.php +++ b/core/layout/light.php @@ -14,8 +14,8 @@ ?> - - + + showNotification(); ?> @@ -24,4 +24,4 @@ showScript(); ?> - \ No newline at end of file + diff --git a/core/layout/main.php b/core/layout/main.php index 8501baa..01b38a3 100644 --- a/core/layout/main.php +++ b/core/layout/main.php @@ -15,16 +15,16 @@ if( $this->getInput('DELTA_I18N_SITE') !== '' && $this->getInput('DELTA_I18N_SIT $this->showFavicon(); $this->showVendor(); ?> - - - + + + 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 ): ?> - showStyle(); ?> + showStyle(); echo PHP_EOL; ?> @@ -131,8 +131,7 @@ if( $this->getInput('DELTA_I18N_SITE') !== '' && $this->getInput('DELTA_I18N_SIT getData(['theme','header','featureContent']);?> - - + diff --git a/core/module/install/ressource/defaultdata.php b/core/module/install/ressource/defaultdata.php index 0741145..34cd2a1 100644 --- a/core/module/install/ressource/defaultdata.php +++ b/core/module/install/ressource/defaultdata.php @@ -68,7 +68,7 @@ class init extends common { ] ], 'core' => [ - 'dataVersion' => 4308, + 'dataVersion' => 4401, 'lastBackup' => 0, 'lastClearTmp' => 0, 'lastAutoUpdate' => 0, diff --git a/core/module/page/lang/en/lex_page.php b/core/module/page/lang/en/lex_page.php index 1eb571d..27c885c 100644 --- a/core/module/page/lang/en/lex_page.php +++ b/core/module/page/lang/en/lex_page.php @@ -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' ]; ?> \ No newline at end of file diff --git a/core/module/page/lang/fr/lex_page.php b/core/module/page/lang/fr/lex_page.php index abaf986..3555f94 100644 --- a/core/module/page/lang/fr/lex_page.php +++ b/core/module/page/lang/fr/lex_page.php @@ -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' ]; ?> \ No newline at end of file diff --git a/core/module/page/page.php b/core/module/page/page.php index eb57118..7aca722 100644 --- a/core/module/page/page.php +++ b/core/module/page/page.php @@ -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 ]; diff --git a/core/module/page/view/edit/edit.php b/core/module/page/view/edit/edit.php index 5570f54..07073da 100644 --- a/core/module/page/view/edit/edit.php +++ b/core/module/page/view/edit/edit.php @@ -38,19 +38,19 @@ echo template::formOpen('pageEditForm'); ?> ]); ?>
    - 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' - ]); ?> + ]); } ?>
    - 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' - ]); ?> + ]); } ?>
    ]); ?>
    -
    +
    getUser('group') < self::GROUP_MODERATOR) { echo 'style="display: none;"'; } ?>>
    ]); ?>
    +getUser('group') < self::GROUP_MODERATOR) { + echo '
    '; +} +else { + echo '
    '; +} +?>
    -
    +

    @@ -201,7 +209,7 @@ echo template::formOpen('pageEditForm'); ?>

    -
    +

    @@ -324,9 +332,10 @@ echo template::formOpen('pageEditForm'); ?>

    +
    \ No newline at end of file + diff --git a/core/module/theme/resource/custom.css b/core/module/theme/resource/custom.css index 04a3d1f..8ccec76 100644 --- a/core/module/theme/resource/custom.css +++ b/core/module/theme/resource/custom.css @@ -217,6 +217,11 @@ figure.image { background-color: #f5f2f0; } +figure.align-center { + display: table; + margin:auto; +} + figure.align-left { float: left; } diff --git a/core/module/user/lang/en/lex_user.php b/core/module/user/lang/en/lex_user.php index e836be9..52a3b7d 100644 --- a/core/module/user/lang/en/lex_user.php +++ b/core/module/user/lang/en/lex_user.php @@ -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'; diff --git a/core/module/user/lang/fr/lex_user.php b/core/module/user/lang/fr/lex_user.php index dddb428..184fd0a 100644 --- a/core/module/user/lang/fr/lex_user.php +++ b/core/module/user/lang/fr/lex_user.php @@ -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' ]; ?> \ No newline at end of file diff --git a/core/module/user/user.php b/core/module/user/user.php index 4cfa989..9e04402 100644 --- a/core/module/user/user.php +++ b/core/module/user/user.php @@ -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 diff --git a/core/module/user/view/add/add.php b/core/module/user/view/add/add.php index f76540d..e1edeb9 100644 --- a/core/module/user/view/add/add.php +++ b/core/module/user/view/add/add.php @@ -69,6 +69,11 @@ include('./core/module/user/lang/'. $this->getData(['config', 'i18n', 'langAdmin
    • +
    +
      +
    • +
    • +
    • diff --git a/core/vendor/filemanager/config/config.php b/core/vendor/filemanager/config/config.php index 4a47fdb..f6297ee 100644 --- a/core/vendor/filemanager/config/config.php +++ b/core/vendor/filemanager/config/config.php @@ -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/'; diff --git a/module/agenda/agenda.php b/module/agenda/agenda.php index b9e70f4..baf0052 100644 --- a/module/agenda/agenda.php +++ b/module/agenda/agenda.php @@ -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); diff --git a/module/agenda/lang/en/lex_agenda.php b/module/agenda/lang/en/lex_agenda.php index 2d10085..6fee7f5 100644 --- a/module/agenda/lang/en/lex_agenda.php +++ b/module/agenda/lang/en/lex_agenda.php @@ -138,7 +138,8 @@ $groupe = [ '0' => 'Visitor', '1' => 'Member', '2' => 'Editor', - '3' => 'Administrator' + '3' => 'Moderator', + '4' => 'Administrator' ]; $couleur = [ 'black' => 'black', diff --git a/module/agenda/lang/fr/lex_agenda.php b/module/agenda/lang/fr/lex_agenda.php index d5e70cb..3fae94a 100644 --- a/module/agenda/lang/fr/lex_agenda.php +++ b/module/agenda/lang/fr/lex_agenda.php @@ -138,7 +138,8 @@ $groupe = [ '0' => 'Visiteur', '1' => 'Membre', '2' => 'Editeur', - '3' => 'Administrateur' + '3' => 'Modérateur', + '4' => 'Administrateur' ]; $couleur = [ 'black' => 'noir', diff --git a/module/agenda/view/config/config.php b/module/agenda/view/config/config.php index d8c84b2..1f97995 100644 --- a/module/agenda/view/config/config.php +++ b/module/agenda/view/config/config.php @@ -96,19 +96,21 @@ echo template::formOpen('configuration'); ?>
    -
    -

    -
    - '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] - ]); ?> -
    -
    +getUser('group') >= self::GROUP_MODERATOR) { ?> +
    +

    +
    + '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] + ]); ?> +
    +
    +
    diff --git a/module/agenda/view/creation/creation.php b/module/agenda/view/creation/creation.php index 2b998f2..8a3baeb 100644 --- a/module/agenda/view/creation/creation.php +++ b/module/agenda/view/creation/creation.php @@ -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'); ?>
    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'); ?>
    getUser('group'); - if ($groupe_mini == 3){ $groupe_mini = 2;} + if ($groupe_mini == self::GROUP_ADMIN){ $groupe_mini = self::GROUP_MODERATOR;} ?> $text['agenda_view']['creation'][17], diff --git a/module/agenda/view/edition/edition.php b/module/agenda/view/edition/edition.php index d2443c5..d8e14ff 100644 --- a/module/agenda/view/edition/edition.php +++ b/module/agenda/view/edition/edition.php @@ -15,7 +15,7 @@ echo '