From 2c120671312d1c16c373a77461911146b6fcc530 Mon Sep 17 00:00:00 2001 From: Fred Tempez Date: Thu, 21 Sep 2023 21:19:39 +0200 Subject: [PATCH] Renomme les groupes --- core/class/layout.class.php | 6 ++--- core/class/router.class.php | 4 +-- core/core.php | 26 +++++++++---------- core/layout/main.php | 4 +-- core/module/course/course.php | 4 +-- core/module/install/install.php | 4 +-- core/module/install/ressource/defaultdata.php | 16 ++++++------ core/module/maintenance/maintenance.php | 2 +- core/module/page/page.php | 4 +-- core/module/page/view/edit/edit.php | 4 +-- core/module/sitemap/sitemap.php | 2 +- core/module/user/user.php | 24 ++++++++--------- core/module/user/view/add/add.php | 12 ++++----- core/module/user/view/edit/edit.php | 10 +++---- module/blog/blog.php | 4 +-- module/form/form.php | 2 +- module/gallery/gallery.php | 2 +- module/news/news.php | 4 +-- module/redirection/redirection.php | 2 +- module/search/search.php | 2 +- module/slider/slider.php | 2 +- 21 files changed, 70 insertions(+), 70 deletions(-) diff --git a/core/class/layout.class.php b/core/class/layout.class.php index da1e482..1fc299e 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_TUTOR && $this->getUser('group') < self::GROUP_ADMIN + $this->getUser('group') >= self::GROUP_STUDENT && $this->getUser('group') < self::GROUP_ADMIN && $this->getData(['theme', 'footer', 'memberBar']) === true ) { $items .= 'getUser('group') >= self::GROUP_TUTOR && $this->getUser('group') < self::GROUP_ADMIN + $this->getUser('group') >= self::GROUP_STUDENT && $this->getUser('group') < self::GROUP_ADMIN && $this->getData(['theme', 'menu', 'memberBar']) === true ) { if ( - $this->getUser('group') >= self::GROUP_TUTOR && + $this->getUser('group') >= self::GROUP_STUDENT && $this->getUser('permission', 'filemanager') === true ) { $itemsRight .= '
  • ' . template::ico('folder', [ diff --git a/core/class/router.class.php b/core/class/router.class.php index 7d306d2..42d1723 100644 --- a/core/class/router.class.php +++ b/core/class/router.class.php @@ -527,7 +527,7 @@ class core extends common $access = null; if ($this->getData(['page', $this->getUrl(0)]) !== null) { if ( - $this->getData(['page', $this->getUrl(0), 'group']) === self::GROUP_STUDENT + $this->getData(['page', $this->getUrl(0), 'group']) === self::GROUP_VISITOR or ($this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD') // and $this->getUser('group') >= $this->getData(['page', $this->getUrl(0), 'group']) // Modification qui tient compte du profil de la page @@ -705,7 +705,7 @@ class core extends common $output = $module->output; // Check le groupe de l'utilisateur if ( - ($module::$actions[$action] === self::GROUP_STUDENT + ($module::$actions[$action] === self::GROUP_VISITOR or ($this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD') and $this->getUser('group') >= $module::$actions[$action] and $this->getUser('permission', $moduleId, $action) diff --git a/core/core.php b/core/core.php index 0050cf4..185599c 100644 --- a/core/core.php +++ b/core/core.php @@ -25,8 +25,8 @@ class common const DISPLAY_LAYOUT_MAIN = 4; const DISPLAY_LAYOUT_LIGHT = 5; const GROUP_BANNED = -1; - const GROUP_STUDENT = 0; - const GROUP_TUTOR = 1; + const GROUP_VISITOR = 0; + const GROUP_STUDENT = 1; const GROUP_TEACHER = 2; // Groupe MODERATOR, compatibilité avec les anciens modules : const GROUP_ADMIN = 3; @@ -145,25 +145,25 @@ class common ]; public static $groups = [ self::GROUP_BANNED => 'Banni', - self::GROUP_STUDENT => 'Apprenant', - self::GROUP_TUTOR => 'Tuteur', + self::GROUP_VISITOR => 'Visiteur', + self::GROUP_STUDENT => 'Etudiant', self::GROUP_TEACHER => 'Enseignant', self::GROUP_ADMIN => 'Administrateur' ]; public static $groupEdits = [ self::GROUP_BANNED => 'Banni', - self::GROUP_TUTOR => 'Tuteur', + self::GROUP_STUDENT => 'Etudiant', self::GROUP_TEACHER => 'Enseignant', self::GROUP_ADMIN => 'Administrateur' ]; public static $groupNews = [ - self::GROUP_TUTOR => 'Tuteur', + self::GROUP_STUDENT => 'Etudiant', self::GROUP_TEACHER => 'Enseignant', self::GROUP_ADMIN => 'Administrateur' ]; public static $groupPublics = [ - self::GROUP_STUDENT => 'Apprenant', - self::GROUP_TUTOR => 'Tuteur', + self::GROUP_VISITOR => 'Visiteur', + self::GROUP_STUDENT => 'Etudiant', self::GROUP_TEACHER => 'Enseignant', self::GROUP_ADMIN => 'Administrateur' ]; @@ -711,7 +711,7 @@ class common // Page parent $this->getData(['page', $pageId, 'parentPageId']) === '' // Ignore les pages dont l'utilisateur n'a pas accès - and ($this->getData(['page', $pageId, 'group']) === self::GROUP_STUDENT + and ($this->getData(['page', $pageId, 'group']) === self::GROUP_VISITOR or ($this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD') //and $this->getUser('group') >= $this->getData(['page', $pageId, 'group']) // Modification qui tient compte du profil de la page @@ -736,8 +736,8 @@ class common $parentId = $this->getData(['page', $pageId, 'parentPageId']) // Ignore les pages dont l'utilisateur n'a pas accès and ( - ($this->getData(['page', $pageId, 'group']) === self::GROUP_STUDENT - and $this->getData(['page', $parentId, 'group']) === self::GROUP_STUDENT + ($this->getData(['page', $pageId, 'group']) === self::GROUP_VISITOR + and $this->getData(['page', $parentId, 'group']) === self::GROUP_VISITOR ) or ($this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD') //and $this->getUser('group') >= $this->getData(['page', $parentId, 'group']) @@ -1435,8 +1435,8 @@ class common } } return $c; - case self::GROUP_TUTOR: case self::GROUP_STUDENT: + case self::GROUP_VISITOR: foreach ($c as $courseId => $value) { $students = $this->getData(['enrolment', $courseId, 'students']); if (in_array($userId, $students) === false) { @@ -1465,13 +1465,13 @@ class common case self::GROUP_TEACHER: $r = in_array($userId, array_keys($this->getData(['enrolment', $courseId]))); break; - case self::GROUP_TUTOR: case self::GROUP_STUDENT: $r = $this->courseIsAvailable($courseId) && (in_array($userId, array_keys($this->getData(['enrolment', $courseId]))) || $this->getData(['course', $courseId, 'enrolment']) <= self::COURSE_ENROLMENT_SELF); break; // Visiteur non connecté + case self::GROUP_VISITOR: case false: $r = $this->courseIsAvailable($courseId) && $this->getData(['course', $courseId, 'enrolment']) === self::COURSE_ENROLMENT_GUEST; diff --git a/core/layout/main.php b/core/layout/main.php index 508bf18..1a82d9a 100644 --- a/core/layout/main.php +++ b/core/layout/main.php @@ -32,7 +32,7 @@ - getUser('group') > self::GROUP_TUTOR) : ?> + getUser('group') > self::GROUP_STUDENT) : ?> 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_TUTOR + and $this->getUser('group') > self::GROUP_STUDENT ) { echo '