From 80ee16aa8279ea4a9f4c2560139336f5c9645f07 Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Mon, 12 Oct 2020 18:32:55 +0200 Subject: [PATCH] Revert "Permissions de l'article" This reverts commit e24461fa2d19f72c3e01b1a0ca8c9a477674b8f5. --- index.php | 2 +- module/blog/blog.php | 7 +++++-- module/blog/view/add/add.php | 2 +- module/blog/view/edit/edit.php | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/index.php b/index.php index e56f6ff7..682664c3 100644 --- a/index.php +++ b/index.php @@ -23,7 +23,7 @@ if(version_compare(PHP_VERSION, '5.6.0', '<')) { /* Set locale to French */ date_default_timezone_set('Europe/Paris'); -setlocale (LC_ALL, 'fr_FR.UTF8','fra'); +setlocale (LC_TIME, 'fr_FR.utf8','fra'); /** * Initialisation de Zwii diff --git a/module/blog/blog.php b/module/blog/blog.php index 2a9bbcd4..49143111 100644 --- a/module/blog/blog.php +++ b/module/blog/blog.php @@ -15,6 +15,7 @@ class blog extends common { const EDIT_OWNER = 'owner'; + const EDIT_GROUP = 'group'; public static $actions = [ 'add' => self::GROUP_EDITOR, @@ -76,7 +77,8 @@ class blog extends common { // Permissions d'un article public static $articleConsent = [ - self::EDIT_OWNER => 'Propriétaire' + self::EDIT_GROUP => 'Groupe du propriétaire', + self::EDIT_OWNER => 'Propiétaire' ]; @@ -308,7 +310,8 @@ class blog extends common { $consent === self::EDIT_OWNER AND $this->getData(['module', $this->getUrl(0), $value,'userId']) === $this->getUser('id') ) OR ( - $this->getUser('group') >= $this->getData(['module',$this->getUrl(0), $value,'editConsent']) + $consent === self::EDIT_GROUP + AND $this->getUser('group') >= $this->getData(['user',$this->getUser('group'),'group']) ) ) { $filterData[] = $value; diff --git a/module/blog/view/add/add.php b/module/blog/view/add/add.php index ef239c22..85ab6b20 100644 --- a/module/blog/view/add/add.php +++ b/module/blog/view/add/add.php @@ -87,7 +87,7 @@ ]); ?>
- 'Edition / Suppression', 'selected' => $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'editConsent']), 'help' => 'Les utilisateurs des groupes supérieurs accèdent à l\'article sans restriction' diff --git a/module/blog/view/edit/edit.php b/module/blog/view/edit/edit.php index f7169e21..10402bce 100644 --- a/module/blog/view/edit/edit.php +++ b/module/blog/view/edit/edit.php @@ -93,7 +93,7 @@ ]); ?>
- 'Edition / Suppression', 'selected' => $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'editConsent']), 'help' => 'Les utilisateurs des groupes supérieurs accèdent à l\'article sans restriction'