From 81b8f32b52d008cf6ade5dbbdbebf35e0cbcca73 Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Fri, 22 Sep 2023 15:19:18 +0200 Subject: [PATCH] Nom des groupes standard --- core/class/layout.class.php | 20 ++++++------- core/class/router.class.php | 2 +- core/core.php | 28 +++++++++---------- core/layout/main.php | 4 +-- core/module/course/course.php | 4 +-- core/module/page/page.php | 14 +++++----- core/module/page/view/edit/edit.php | 8 +++--- core/module/user/user.php | 22 +++++++-------- core/module/user/view/add/add.php | 22 +++++++-------- core/module/user/view/edit/edit.php | 24 ++++++++-------- .../user/view/profilEdit/profilEdit.php | 2 +- module/blog/view/article/article.php | 2 +- module/blog/view/index/index.php | 2 +- module/gallery/gallery.php | 18 ++++++------ module/news/news.php | 10 +++---- module/redirection/redirection.php | 4 +-- module/search/search.php | 2 +- 17 files changed, 94 insertions(+), 94 deletions(-) diff --git a/core/class/layout.class.php b/core/class/layout.class.php index 1fc299e..c56a3fe 100644 --- a/core/class/layout.class.php +++ b/core/class/layout.class.php @@ -345,7 +345,7 @@ class layout extends common } // Affichage de la barre de membre simple if ( - $this->getUser('group') >= self::GROUP_STUDENT && $this->getUser('group') < self::GROUP_ADMIN + $this->getUser('group') >= self::GROUP_MEMBER && $this->getUser('group') < self::GROUP_ADMIN && $this->getData(['theme', 'footer', 'memberBar']) === true ) { $items .= 'getUser('group') >= self::GROUP_STUDENT && $this->getUser('group') < self::GROUP_ADMIN + $this->getUser('group') >= self::GROUP_MEMBER && $this->getUser('group') < self::GROUP_ADMIN && $this->getData(['theme', 'menu', 'memberBar']) === true ) { if ( - $this->getUser('group') >= self::GROUP_STUDENT && + $this->getUser('group') >= self::GROUP_MEMBER && $this->getUser('permission', 'filemanager') === true ) { $itemsRight .= '
  • ' . template::ico('folder', [ @@ -571,7 +571,7 @@ class layout extends common and $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD') ) or ($this->getData(['page', $parentPageId, 'disable']) === true and $this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD') - and $this->getUser('group') < self::GROUP_TEACHER + and $this->getUser('group') < self::GROUP_EDITOR ) ) { $pageUrl = ($this->getData(['config', 'homePageId']) === $this->getUrl(0)) ? helper::baseUrl(false) : helper::baseUrl() . $this->getUrl(0); @@ -637,7 +637,7 @@ class layout extends common and $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD') ) or ($this->getData(['page', $childKey, 'disable']) === true and $this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD') - and $this->getUser('group') < self::GROUP_TEACHER + and $this->getUser('group') < self::GROUP_EDITOR ) ) { $pageUrl = ($this->getData(['config', 'homePageId']) === $this->getUrl(0)) ? helper::baseUrl(false) : helper::baseUrl() . $this->getUrl(0); @@ -899,7 +899,7 @@ class layout extends common * Les enseignants les cours dont ils sont auteurs * Les étudiants les cours dans lesquels ils sont inscrits */ - if ($this->getUser('group') >= self::GROUP_TEACHER) { + if ($this->getUser('group') >= self::GROUP_EDITOR) { if ($this->getCoursesByUser($this->getUser('id'), $this->getUser('group'))) { $leftItems .= '
  • '; $leftItems .= ''; $leftItems .= ''; @@ -1030,7 +1030,7 @@ class layout extends common // Items de droite $rightItems = ''; if ( - $this->getUser('group') >= self::GROUP_TEACHER + $this->getUser('group') >= self::GROUP_EDITOR && $this->getUser( 'permission', 'filemanager' @@ -1090,7 +1090,7 @@ class layout extends common } } if ( - $this->getUser('group') >= self::GROUP_TEACHER + $this->getUser('group') >= self::GROUP_EDITOR && $this->getUser('permission', 'user', 'edit') ) { @@ -1177,7 +1177,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_TEACHER + and $this->getUser('group') >= self::GROUP_EDITOR ) { $vars .= 'var privateKey = ' . json_encode(md5_file(self::DATA_DIR . 'core.json')) . ';'; } diff --git a/core/class/router.class.php b/core/class/router.class.php index 42d1723..bfbe4a3 100644 --- a/core/class/router.class.php +++ b/core/class/router.class.php @@ -548,7 +548,7 @@ class core extends common and $this->getUser('password') !== $this->getInput('ZWII_USER_PASSWORD') ) or ($this->getData(['page', $this->getUrl(0), 'disable']) === true and $this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD') - and $this->getUser('group') < self::GROUP_TEACHER + and $this->getUser('group') < self::GROUP_EDITOR ) ) { $access = false; diff --git a/core/core.php b/core/core.php index 185599c..d69ce43 100644 --- a/core/core.php +++ b/core/core.php @@ -26,8 +26,8 @@ class common const DISPLAY_LAYOUT_LIGHT = 5; const GROUP_BANNED = -1; const GROUP_VISITOR = 0; - const GROUP_STUDENT = 1; - const GROUP_TEACHER = 2; + const GROUP_MEMBER = 1; + const GROUP_EDITOR = 2; // Groupe MODERATOR, compatibilité avec les anciens modules : const GROUP_ADMIN = 3; const SIGNATURE_ID = 1; @@ -146,25 +146,25 @@ class common public static $groups = [ self::GROUP_BANNED => 'Banni', self::GROUP_VISITOR => 'Visiteur', - self::GROUP_STUDENT => 'Etudiant', - self::GROUP_TEACHER => 'Enseignant', + self::GROUP_MEMBER => 'Etudiant', + self::GROUP_EDITOR => 'Enseignant', self::GROUP_ADMIN => 'Administrateur' ]; public static $groupEdits = [ self::GROUP_BANNED => 'Banni', - self::GROUP_STUDENT => 'Etudiant', - self::GROUP_TEACHER => 'Enseignant', + self::GROUP_MEMBER => 'Etudiant', + self::GROUP_EDITOR => 'Enseignant', self::GROUP_ADMIN => 'Administrateur' ]; public static $groupNews = [ - self::GROUP_STUDENT => 'Etudiant', - self::GROUP_TEACHER => 'Enseignant', + self::GROUP_MEMBER => 'Etudiant', + self::GROUP_EDITOR => 'Enseignant', self::GROUP_ADMIN => 'Administrateur' ]; public static $groupPublics = [ self::GROUP_VISITOR => 'Visiteur', - self::GROUP_STUDENT => 'Etudiant', - self::GROUP_TEACHER => 'Enseignant', + self::GROUP_MEMBER => 'Etudiant', + self::GROUP_EDITOR => 'Enseignant', self::GROUP_ADMIN => 'Administrateur' ]; @@ -1428,14 +1428,14 @@ class common switch ($userStatus) { case self::GROUP_ADMIN: return $c; - case self::GROUP_TEACHER: + case self::GROUP_EDITOR: foreach ($c as $courseId => $value) { if ($this->getData(['enrolment', $courseId]) !== $userId) { unset($c[$courseId]); } } return $c; - case self::GROUP_STUDENT: + case self::GROUP_MEMBER: case self::GROUP_VISITOR: foreach ($c as $courseId => $value) { $students = $this->getData(['enrolment', $courseId, 'students']); @@ -1462,10 +1462,10 @@ class common case self::GROUP_ADMIN: $r = true; break; - case self::GROUP_TEACHER: + case self::GROUP_EDITOR: $r = in_array($userId, array_keys($this->getData(['enrolment', $courseId]))); break; - case self::GROUP_STUDENT: + case self::GROUP_MEMBER: $r = $this->courseIsAvailable($courseId) && (in_array($userId, array_keys($this->getData(['enrolment', $courseId]))) || $this->getData(['course', $courseId, 'enrolment']) <= self::COURSE_ENROLMENT_SELF); diff --git a/core/layout/main.php b/core/layout/main.php index 1a82d9a..46d3710 100644 --- a/core/layout/main.php +++ b/core/layout/main.php @@ -32,7 +32,7 @@ - getUser('group') > self::GROUP_STUDENT) : ?> + getUser('group') > self::GROUP_MEMBER) : ?> showBar(); ?> @@ -45,7 +45,7 @@ $this->getData(['theme', 'menu', 'position']) === 'top' and $this->getData(['theme', 'menu', 'fixed']) === true and $this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD') - and $this->getUser('group') > self::GROUP_STUDENT + and $this->getUser('group') > self::GROUP_MEMBER ) { echo '