forked from ZwiiCMS-Team/ZwiiCampus
Renomme les groupes
This commit is contained in:
parent
727f8123c0
commit
2c12067131
@ -345,7 +345,7 @@ class layout extends common
|
|||||||
}
|
}
|
||||||
// Affichage de la barre de membre simple
|
// Affichage de la barre de membre simple
|
||||||
if (
|
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
|
&& $this->getData(['theme', 'footer', 'memberBar']) === true
|
||||||
) {
|
) {
|
||||||
$items .= '<span id="footerDisplayMemberAccount"';
|
$items .= '<span id="footerDisplayMemberAccount"';
|
||||||
@ -506,11 +506,11 @@ class layout extends common
|
|||||||
}
|
}
|
||||||
// Commandes pour les membres simples
|
// Commandes pour les membres simples
|
||||||
if (
|
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', 'menu', 'memberBar']) === true
|
&& $this->getData(['theme', 'menu', 'memberBar']) === true
|
||||||
) {
|
) {
|
||||||
if (
|
if (
|
||||||
$this->getUser('group') >= self::GROUP_TUTOR &&
|
$this->getUser('group') >= self::GROUP_STUDENT &&
|
||||||
$this->getUser('permission', 'filemanager') === true
|
$this->getUser('permission', 'filemanager') === true
|
||||||
) {
|
) {
|
||||||
$itemsRight .= '<li>' . template::ico('folder', [
|
$itemsRight .= '<li>' . template::ico('folder', [
|
||||||
|
@ -527,7 +527,7 @@ class core extends common
|
|||||||
$access = null;
|
$access = null;
|
||||||
if ($this->getData(['page', $this->getUrl(0)]) !== null) {
|
if ($this->getData(['page', $this->getUrl(0)]) !== null) {
|
||||||
if (
|
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')
|
or ($this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
||||||
// and $this->getUser('group') >= $this->getData(['page', $this->getUrl(0), 'group'])
|
// and $this->getUser('group') >= $this->getData(['page', $this->getUrl(0), 'group'])
|
||||||
// Modification qui tient compte du profil de la page
|
// Modification qui tient compte du profil de la page
|
||||||
@ -705,7 +705,7 @@ class core extends common
|
|||||||
$output = $module->output;
|
$output = $module->output;
|
||||||
// Check le groupe de l'utilisateur
|
// Check le groupe de l'utilisateur
|
||||||
if (
|
if (
|
||||||
($module::$actions[$action] === self::GROUP_STUDENT
|
($module::$actions[$action] === self::GROUP_VISITOR
|
||||||
or ($this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
or ($this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
||||||
and $this->getUser('group') >= $module::$actions[$action]
|
and $this->getUser('group') >= $module::$actions[$action]
|
||||||
and $this->getUser('permission', $moduleId, $action)
|
and $this->getUser('permission', $moduleId, $action)
|
||||||
|
@ -25,8 +25,8 @@ class common
|
|||||||
const DISPLAY_LAYOUT_MAIN = 4;
|
const DISPLAY_LAYOUT_MAIN = 4;
|
||||||
const DISPLAY_LAYOUT_LIGHT = 5;
|
const DISPLAY_LAYOUT_LIGHT = 5;
|
||||||
const GROUP_BANNED = -1;
|
const GROUP_BANNED = -1;
|
||||||
const GROUP_STUDENT = 0;
|
const GROUP_VISITOR = 0;
|
||||||
const GROUP_TUTOR = 1;
|
const GROUP_STUDENT = 1;
|
||||||
const GROUP_TEACHER = 2;
|
const GROUP_TEACHER = 2;
|
||||||
// Groupe MODERATOR, compatibilité avec les anciens modules :
|
// Groupe MODERATOR, compatibilité avec les anciens modules :
|
||||||
const GROUP_ADMIN = 3;
|
const GROUP_ADMIN = 3;
|
||||||
@ -145,25 +145,25 @@ class common
|
|||||||
];
|
];
|
||||||
public static $groups = [
|
public static $groups = [
|
||||||
self::GROUP_BANNED => 'Banni',
|
self::GROUP_BANNED => 'Banni',
|
||||||
self::GROUP_STUDENT => 'Apprenant',
|
self::GROUP_VISITOR => 'Visiteur',
|
||||||
self::GROUP_TUTOR => 'Tuteur',
|
self::GROUP_STUDENT => 'Etudiant',
|
||||||
self::GROUP_TEACHER => 'Enseignant',
|
self::GROUP_TEACHER => 'Enseignant',
|
||||||
self::GROUP_ADMIN => 'Administrateur'
|
self::GROUP_ADMIN => 'Administrateur'
|
||||||
];
|
];
|
||||||
public static $groupEdits = [
|
public static $groupEdits = [
|
||||||
self::GROUP_BANNED => 'Banni',
|
self::GROUP_BANNED => 'Banni',
|
||||||
self::GROUP_TUTOR => 'Tuteur',
|
self::GROUP_STUDENT => 'Etudiant',
|
||||||
self::GROUP_TEACHER => 'Enseignant',
|
self::GROUP_TEACHER => 'Enseignant',
|
||||||
self::GROUP_ADMIN => 'Administrateur'
|
self::GROUP_ADMIN => 'Administrateur'
|
||||||
];
|
];
|
||||||
public static $groupNews = [
|
public static $groupNews = [
|
||||||
self::GROUP_TUTOR => 'Tuteur',
|
self::GROUP_STUDENT => 'Etudiant',
|
||||||
self::GROUP_TEACHER => 'Enseignant',
|
self::GROUP_TEACHER => 'Enseignant',
|
||||||
self::GROUP_ADMIN => 'Administrateur'
|
self::GROUP_ADMIN => 'Administrateur'
|
||||||
];
|
];
|
||||||
public static $groupPublics = [
|
public static $groupPublics = [
|
||||||
self::GROUP_STUDENT => 'Apprenant',
|
self::GROUP_VISITOR => 'Visiteur',
|
||||||
self::GROUP_TUTOR => 'Tuteur',
|
self::GROUP_STUDENT => 'Etudiant',
|
||||||
self::GROUP_TEACHER => 'Enseignant',
|
self::GROUP_TEACHER => 'Enseignant',
|
||||||
self::GROUP_ADMIN => 'Administrateur'
|
self::GROUP_ADMIN => 'Administrateur'
|
||||||
];
|
];
|
||||||
@ -711,7 +711,7 @@ class common
|
|||||||
// Page parent
|
// Page parent
|
||||||
$this->getData(['page', $pageId, 'parentPageId']) === ''
|
$this->getData(['page', $pageId, 'parentPageId']) === ''
|
||||||
// Ignore les pages dont l'utilisateur n'a pas accès
|
// 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')
|
or ($this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
||||||
//and $this->getUser('group') >= $this->getData(['page', $pageId, 'group'])
|
//and $this->getUser('group') >= $this->getData(['page', $pageId, 'group'])
|
||||||
// Modification qui tient compte du profil de la page
|
// Modification qui tient compte du profil de la page
|
||||||
@ -736,8 +736,8 @@ class common
|
|||||||
$parentId = $this->getData(['page', $pageId, 'parentPageId'])
|
$parentId = $this->getData(['page', $pageId, 'parentPageId'])
|
||||||
// Ignore les pages dont l'utilisateur n'a pas accès
|
// Ignore les pages dont l'utilisateur n'a pas accès
|
||||||
and (
|
and (
|
||||||
($this->getData(['page', $pageId, 'group']) === self::GROUP_STUDENT
|
($this->getData(['page', $pageId, 'group']) === self::GROUP_VISITOR
|
||||||
and $this->getData(['page', $parentId, 'group']) === self::GROUP_STUDENT
|
and $this->getData(['page', $parentId, 'group']) === self::GROUP_VISITOR
|
||||||
)
|
)
|
||||||
or ($this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
or ($this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
||||||
//and $this->getUser('group') >= $this->getData(['page', $parentId, 'group'])
|
//and $this->getUser('group') >= $this->getData(['page', $parentId, 'group'])
|
||||||
@ -1435,8 +1435,8 @@ class common
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $c;
|
return $c;
|
||||||
case self::GROUP_TUTOR:
|
|
||||||
case self::GROUP_STUDENT:
|
case self::GROUP_STUDENT:
|
||||||
|
case self::GROUP_VISITOR:
|
||||||
foreach ($c as $courseId => $value) {
|
foreach ($c as $courseId => $value) {
|
||||||
$students = $this->getData(['enrolment', $courseId, 'students']);
|
$students = $this->getData(['enrolment', $courseId, 'students']);
|
||||||
if (in_array($userId, $students) === false) {
|
if (in_array($userId, $students) === false) {
|
||||||
@ -1465,13 +1465,13 @@ class common
|
|||||||
case self::GROUP_TEACHER:
|
case self::GROUP_TEACHER:
|
||||||
$r = in_array($userId, array_keys($this->getData(['enrolment', $courseId])));
|
$r = in_array($userId, array_keys($this->getData(['enrolment', $courseId])));
|
||||||
break;
|
break;
|
||||||
case self::GROUP_TUTOR:
|
|
||||||
case self::GROUP_STUDENT:
|
case self::GROUP_STUDENT:
|
||||||
$r = $this->courseIsAvailable($courseId) &&
|
$r = $this->courseIsAvailable($courseId) &&
|
||||||
(in_array($userId, array_keys($this->getData(['enrolment', $courseId]))) ||
|
(in_array($userId, array_keys($this->getData(['enrolment', $courseId]))) ||
|
||||||
$this->getData(['course', $courseId, 'enrolment']) <= self::COURSE_ENROLMENT_SELF);
|
$this->getData(['course', $courseId, 'enrolment']) <= self::COURSE_ENROLMENT_SELF);
|
||||||
break;
|
break;
|
||||||
// Visiteur non connecté
|
// Visiteur non connecté
|
||||||
|
case self::GROUP_VISITOR:
|
||||||
case false:
|
case false:
|
||||||
$r = $this->courseIsAvailable($courseId) &&
|
$r = $this->courseIsAvailable($courseId) &&
|
||||||
$this->getData(['course', $courseId, 'enrolment']) === self::COURSE_ENROLMENT_GUEST;
|
$this->getData(['course', $courseId, 'enrolment']) === self::COURSE_ENROLMENT_GUEST;
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<!-- Barre d'administration -->
|
<!-- Barre d'administration -->
|
||||||
<?php if ($this->getUser('group') > self::GROUP_TUTOR) : ?>
|
<?php if ($this->getUser('group') > self::GROUP_STUDENT) : ?>
|
||||||
<?php $layout->showBar(); ?>
|
<?php $layout->showBar(); ?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<!-- Notifications -->
|
<!-- Notifications -->
|
||||||
@ -45,7 +45,7 @@
|
|||||||
$this->getData(['theme', 'menu', 'position']) === 'top'
|
$this->getData(['theme', 'menu', 'position']) === 'top'
|
||||||
and $this->getData(['theme', 'menu', 'fixed']) === true
|
and $this->getData(['theme', 'menu', 'fixed']) === true
|
||||||
and $this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
and $this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD')
|
||||||
and $this->getUser('group') > self::GROUP_TUTOR
|
and $this->getUser('group') > self::GROUP_STUDENT
|
||||||
) {
|
) {
|
||||||
echo '<nav id="navfixedconnected" >';
|
echo '<nav id="navfixedconnected" >';
|
||||||
} else {
|
} else {
|
||||||
|
@ -21,8 +21,8 @@ class course extends common
|
|||||||
'edit' => self::GROUP_ADMIN,
|
'edit' => self::GROUP_ADMIN,
|
||||||
'add' => self::GROUP_ADMIN,
|
'add' => self::GROUP_ADMIN,
|
||||||
'delete' => self::GROUP_ADMIN,
|
'delete' => self::GROUP_ADMIN,
|
||||||
'swap' => self::GROUP_STUDENT,
|
'swap' => self::GROUP_VISITOR,
|
||||||
'change' => self::GROUP_STUDENT,
|
'change' => self::GROUP_VISITOR,
|
||||||
];
|
];
|
||||||
|
|
||||||
public static $courseAccess = [
|
public static $courseAccess = [
|
||||||
|
@ -18,8 +18,8 @@ class install extends common
|
|||||||
{
|
{
|
||||||
|
|
||||||
public static $actions = [
|
public static $actions = [
|
||||||
'index' => self::GROUP_STUDENT,
|
'index' => self::GROUP_VISITOR,
|
||||||
"postinstall" => self::GROUP_STUDENT,
|
"postinstall" => self::GROUP_VISITOR,
|
||||||
'steps' => self::GROUP_ADMIN,
|
'steps' => self::GROUP_ADMIN,
|
||||||
'update' => self::GROUP_ADMIN
|
'update' => self::GROUP_ADMIN
|
||||||
];
|
];
|
||||||
|
@ -323,7 +323,7 @@ class init extends common
|
|||||||
'comment' => 'Accès désactivé',
|
'comment' => 'Accès désactivé',
|
||||||
],
|
],
|
||||||
'0' => [
|
'0' => [
|
||||||
'name' => 'Apprenant',
|
'name' => 'Visiteur',
|
||||||
'readonly' => true,
|
'readonly' => true,
|
||||||
'permanent' => true,
|
'permanent' => true,
|
||||||
'comment' => 'Accède au site',
|
'comment' => 'Accède au site',
|
||||||
@ -687,7 +687,7 @@ class init extends common
|
|||||||
'modulePosition' => 'bottom',
|
'modulePosition' => 'bottom',
|
||||||
'parentPageId' => '',
|
'parentPageId' => '',
|
||||||
'position' => 1,
|
'position' => 1,
|
||||||
'group' => self::GROUP_STUDENT,
|
'group' => self::GROUP_VISITOR,
|
||||||
'profil' => 0,
|
'profil' => 0,
|
||||||
'targetBlank' => false,
|
'targetBlank' => false,
|
||||||
'title' => 'Accueil',
|
'title' => 'Accueil',
|
||||||
@ -718,7 +718,7 @@ class init extends common
|
|||||||
'modulePosition' => 'bottom',
|
'modulePosition' => 'bottom',
|
||||||
'parentPageId' => '',
|
'parentPageId' => '',
|
||||||
'position' => 6,
|
'position' => 6,
|
||||||
'group' => self::GROUP_STUDENT,
|
'group' => self::GROUP_VISITOR,
|
||||||
'profil' => 0,
|
'profil' => 0,
|
||||||
'targetBlank' => false,
|
'targetBlank' => false,
|
||||||
'title' => 'Contact',
|
'title' => 'Contact',
|
||||||
@ -749,7 +749,7 @@ class init extends common
|
|||||||
'modulePosition' => 'bottom',
|
'modulePosition' => 'bottom',
|
||||||
'parentPageId' => '',
|
'parentPageId' => '',
|
||||||
'position' => 0,
|
'position' => 0,
|
||||||
'group' => self::GROUP_STUDENT,
|
'group' => self::GROUP_VISITOR,
|
||||||
'profil' => 0,
|
'profil' => 0,
|
||||||
'targetBlank' => false,
|
'targetBlank' => false,
|
||||||
'title' => 'Mentions légales',
|
'title' => 'Mentions légales',
|
||||||
@ -781,7 +781,7 @@ class init extends common
|
|||||||
'modulePosition' => '',
|
'modulePosition' => '',
|
||||||
'parentPageId' => '',
|
'parentPageId' => '',
|
||||||
'position' => 0,
|
'position' => 0,
|
||||||
'group' => self::GROUP_STUDENT,
|
'group' => self::GROUP_VISITOR,
|
||||||
'profil' => 0,
|
'profil' => 0,
|
||||||
'targetBlank' => false,
|
'targetBlank' => false,
|
||||||
'title' => 'Maintenance en cours',
|
'title' => 'Maintenance en cours',
|
||||||
@ -813,7 +813,7 @@ class init extends common
|
|||||||
'modulePosition' => 'bottom',
|
'modulePosition' => 'bottom',
|
||||||
'parentPageId' => '',
|
'parentPageId' => '',
|
||||||
'position' => 0,
|
'position' => 0,
|
||||||
'group' => self::GROUP_STUDENT,
|
'group' => self::GROUP_VISITOR,
|
||||||
'profil' => 0,
|
'profil' => 0,
|
||||||
'targetBlank' => false,
|
'targetBlank' => false,
|
||||||
'title' => 'Erreur 403',
|
'title' => 'Erreur 403',
|
||||||
@ -844,7 +844,7 @@ class init extends common
|
|||||||
'modulePosition' => 'bottom',
|
'modulePosition' => 'bottom',
|
||||||
'parentPageId' => '',
|
'parentPageId' => '',
|
||||||
'position' => 0,
|
'position' => 0,
|
||||||
'group' => self::GROUP_STUDENT,
|
'group' => self::GROUP_VISITOR,
|
||||||
'profil' => 0,
|
'profil' => 0,
|
||||||
'targetBlank' => false,
|
'targetBlank' => false,
|
||||||
'title' => 'Erreur 404',
|
'title' => 'Erreur 404',
|
||||||
@ -989,7 +989,7 @@ class init extends common
|
|||||||
'modulePosition' => 'bottom',
|
'modulePosition' => 'bottom',
|
||||||
'parentPageId' => '',
|
'parentPageId' => '',
|
||||||
'position' => 1,
|
'position' => 1,
|
||||||
'group' => self::GROUP_STUDENT,
|
'group' => self::GROUP_VISITOR,
|
||||||
'profil' => 0,
|
'profil' => 0,
|
||||||
'targetBlank' => false,
|
'targetBlank' => false,
|
||||||
'title' => 'Accueil',
|
'title' => 'Accueil',
|
||||||
|
@ -17,7 +17,7 @@ class maintenance extends common
|
|||||||
{
|
{
|
||||||
|
|
||||||
public static $actions = [
|
public static $actions = [
|
||||||
'index' => self::GROUP_STUDENT
|
'index' => self::GROUP_VISITOR
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -155,7 +155,7 @@ class page extends common
|
|||||||
'parentPageId' => '',
|
'parentPageId' => '',
|
||||||
'modulePosition' => 'bottom',
|
'modulePosition' => 'bottom',
|
||||||
'position' => 0,
|
'position' => 0,
|
||||||
'group' => self::GROUP_STUDENT,
|
'group' => self::GROUP_VISITOR,
|
||||||
'targetBlank' => false,
|
'targetBlank' => false,
|
||||||
'title' => $pageTitle,
|
'title' => $pageTitle,
|
||||||
'shortTitle' => $pageTitle,
|
'shortTitle' => $pageTitle,
|
||||||
@ -564,7 +564,7 @@ class page extends common
|
|||||||
// Profils installés
|
// Profils installés
|
||||||
// Profils disponibles
|
// Profils disponibles
|
||||||
foreach ($this->getData(['profil']) as $profilId => $profilData) {
|
foreach ($this->getData(['profil']) as $profilId => $profilData) {
|
||||||
if ($profilId < self::GROUP_TUTOR) {
|
if ($profilId < self::GROUP_STUDENT) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if ($profilId === self::GROUP_ADMIN) {
|
if ($profilId === self::GROUP_ADMIN) {
|
||||||
|
@ -389,8 +389,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col6">
|
<div class="col6">
|
||||||
<div class="pageEditGroupProfil displayNone"
|
<div class="pageEditGroupProfil displayNone"
|
||||||
id="pageEditGroupProfil<?php echo self::GROUP_TUTOR; ?>">
|
id="pageEditGroupProfil<?php echo self::GROUP_STUDENT; ?>">
|
||||||
<?php echo template::select('pageEditProfil' . self::GROUP_TUTOR, $module::$userProfils[self::GROUP_TUTOR], [
|
<?php echo template::select('pageEditProfil' . self::GROUP_STUDENT, $module::$userProfils[self::GROUP_STUDENT], [
|
||||||
'label' => 'Profil minimal pour accéder à la page',
|
'label' => 'Profil minimal pour accéder à la page',
|
||||||
'selected' => $this->getData(['page', $this->getUrl(2), 'profil']),
|
'selected' => $this->getData(['page', $this->getUrl(2), 'profil']),
|
||||||
'help' => 'Les profils de niveau supérieur accèdent à la page.',
|
'help' => 'Les profils de niveau supérieur accèdent à la page.',
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
class sitemap extends common
|
class sitemap extends common
|
||||||
{
|
{
|
||||||
public static $actions = [
|
public static $actions = [
|
||||||
'index' => self::GROUP_STUDENT
|
'index' => self::GROUP_VISITOR
|
||||||
];
|
];
|
||||||
|
|
||||||
public static $siteMap = '';
|
public static $siteMap = '';
|
||||||
|
@ -22,11 +22,11 @@ class user extends common
|
|||||||
'import' => self::GROUP_ADMIN,
|
'import' => self::GROUP_ADMIN,
|
||||||
'index' => self::GROUP_ADMIN,
|
'index' => self::GROUP_ADMIN,
|
||||||
'template' => self::GROUP_ADMIN,
|
'template' => self::GROUP_ADMIN,
|
||||||
'edit' => self::GROUP_TUTOR,
|
'edit' => self::GROUP_STUDENT,
|
||||||
'logout' => self::GROUP_TUTOR,
|
'logout' => self::GROUP_STUDENT,
|
||||||
'forgot' => self::GROUP_STUDENT,
|
'forgot' => self::GROUP_VISITOR,
|
||||||
'login' => self::GROUP_STUDENT,
|
'login' => self::GROUP_VISITOR,
|
||||||
'reset' => self::GROUP_STUDENT,
|
'reset' => self::GROUP_VISITOR,
|
||||||
'profil' => self::GROUP_ADMIN,
|
'profil' => self::GROUP_ADMIN,
|
||||||
'profilEdit' => self::GROUP_ADMIN,
|
'profilEdit' => self::GROUP_ADMIN,
|
||||||
'profilAdd' => self::GROUP_ADMIN,
|
'profilAdd' => self::GROUP_ADMIN,
|
||||||
@ -65,7 +65,7 @@ class user extends common
|
|||||||
];
|
];
|
||||||
|
|
||||||
public static $groupProfils = [
|
public static $groupProfils = [
|
||||||
self::GROUP_TUTOR => 'Membre',
|
self::GROUP_STUDENT => 'Membre',
|
||||||
self::GROUP_TEACHER => 'Éditeur'
|
self::GROUP_TEACHER => 'Éditeur'
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -162,7 +162,7 @@ class user extends common
|
|||||||
|
|
||||||
// Profils disponibles
|
// Profils disponibles
|
||||||
foreach ($this->getData(['profil']) as $profilId => $profilData) {
|
foreach ($this->getData(['profil']) as $profilId => $profilData) {
|
||||||
if ($profilId < self::GROUP_TUTOR) {
|
if ($profilId < self::GROUP_STUDENT) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if ($profilId === self::GROUP_ADMIN) {
|
if ($profilId === self::GROUP_ADMIN) {
|
||||||
@ -242,7 +242,7 @@ class user extends common
|
|||||||
and (
|
and (
|
||||||
// Impossible de s'auto-éditer
|
// Impossible de s'auto-éditer
|
||||||
($this->getUser('id') === $this->getUrl(2)
|
($this->getUser('id') === $this->getUrl(2)
|
||||||
and $this->getUrl('group') <= self::GROUP_STUDENT
|
and $this->getUrl('group') <= self::GROUP_VISITOR
|
||||||
)
|
)
|
||||||
// Impossible d'éditer un autre utilisateur
|
// Impossible d'éditer un autre utilisateur
|
||||||
or ($this->getUrl('group') < self::GROUP_TEACHER)
|
or ($this->getUrl('group') < self::GROUP_TEACHER)
|
||||||
@ -354,7 +354,7 @@ class user extends common
|
|||||||
|
|
||||||
// Profils disponibles
|
// Profils disponibles
|
||||||
foreach ($this->getData(['profil']) as $profilId => $profilData) {
|
foreach ($this->getData(['profil']) as $profilId => $profilData) {
|
||||||
if ($profilId < self::GROUP_TUTOR) {
|
if ($profilId < self::GROUP_STUDENT) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if ($profilId === self::GROUP_ADMIN) {
|
if ($profilId === self::GROUP_ADMIN) {
|
||||||
@ -473,7 +473,7 @@ class user extends common
|
|||||||
// Membres sans permissions spécifiques
|
// Membres sans permissions spécifiques
|
||||||
if (
|
if (
|
||||||
$groupId == self::GROUP_BANNED ||
|
$groupId == self::GROUP_BANNED ||
|
||||||
$groupId == self::GROUP_STUDENT ||
|
$groupId == self::GROUP_VISITOR ||
|
||||||
$groupId == self::GROUP_ADMIN
|
$groupId == self::GROUP_ADMIN
|
||||||
) {
|
) {
|
||||||
self::$userGroups[$groupId] = [
|
self::$userGroups[$groupId] = [
|
||||||
@ -492,7 +492,7 @@ class user extends common
|
|||||||
])
|
])
|
||||||
];
|
];
|
||||||
} elseif (
|
} elseif (
|
||||||
$groupId == self::GROUP_TUTOR ||
|
$groupId == self::GROUP_STUDENT ||
|
||||||
$groupId == self::GROUP_TEACHER
|
$groupId == self::GROUP_TEACHER
|
||||||
) {
|
) {
|
||||||
// Enumérer les sous groupes MEMBER et MODERATOR
|
// Enumérer les sous groupes MEMBER et MODERATOR
|
||||||
@ -871,7 +871,7 @@ class user extends common
|
|||||||
($this->getData(['user', $userId, 'connectTimeout']) + $this->getData(['config', 'connect', 'timeout'])) < time()
|
($this->getData(['user', $userId, 'connectTimeout']) + $this->getData(['config', 'connect', 'timeout'])) < time()
|
||||||
and $this->getData(['user', $userId, 'connectFail']) < $this->getData(['config', 'connect', 'attempt'])
|
and $this->getData(['user', $userId, 'connectFail']) < $this->getData(['config', 'connect', 'attempt'])
|
||||||
and password_verify(html_entity_decode($this->getInput('userLoginPassword', helper::FILTER_STRING_SHORT, true)), $this->getData(['user', $userId, 'password']))
|
and password_verify(html_entity_decode($this->getInput('userLoginPassword', helper::FILTER_STRING_SHORT, true)), $this->getData(['user', $userId, 'password']))
|
||||||
and $this->getData(['user', $userId, 'group']) >= self::GROUP_TUTOR
|
and $this->getData(['user', $userId, 'group']) >= self::GROUP_STUDENT
|
||||||
and $captcha === true
|
and $captcha === true
|
||||||
) {
|
) {
|
||||||
// RAZ
|
// RAZ
|
||||||
|
@ -91,13 +91,13 @@
|
|||||||
<div class="col6">
|
<div class="col6">
|
||||||
<?php echo template::select('userAddGroup', self::$groupNews, [
|
<?php echo template::select('userAddGroup', self::$groupNews, [
|
||||||
'label' => 'Groupe',
|
'label' => 'Groupe',
|
||||||
'selected' => self::GROUP_TUTOR
|
'selected' => self::GROUP_STUDENT
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="col6">
|
<div class="col6">
|
||||||
<div class="userAddGroupProfil displayNone"
|
<div class="userAddGroupProfil displayNone"
|
||||||
id="userAddGroupProfil<?php echo self::GROUP_TUTOR; ?>">
|
id="userAddGroupProfil<?php echo self::GROUP_STUDENT; ?>">
|
||||||
<?php echo template::select('userAddProfil' . self::GROUP_TUTOR, $module::$userProfils[self::GROUP_TUTOR], [
|
<?php echo template::select('userAddProfil' . self::GROUP_STUDENT, $module::$userProfils[self::GROUP_STUDENT], [
|
||||||
'label' => 'Profil',
|
'label' => 'Profil',
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
@ -110,9 +110,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div id="userCommentProfil<?php echo self::GROUP_TUTOR; ?>" class="col12 displayNone userCommentProfil">
|
<div id="userCommentProfil<?php echo self::GROUP_STUDENT; ?>" class="col12 displayNone userCommentProfil">
|
||||||
<?php echo template::textarea('useraddProfilComment' . self::GROUP_TUTOR, [
|
<?php echo template::textarea('useraddProfilComment' . self::GROUP_STUDENT, [
|
||||||
"value" => implode("\n",$module::$userProfilsComments[self::GROUP_TUTOR])
|
"value" => implode("\n",$module::$userProfilsComments[self::GROUP_STUDENT])
|
||||||
]);
|
]);
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
|
@ -116,8 +116,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col6">
|
<div class="col6">
|
||||||
<div class="userEditGroupProfil displayNone"
|
<div class="userEditGroupProfil displayNone"
|
||||||
id="userEditGroupProfil<?php echo self::GROUP_TUTOR; ?>">
|
id="userEditGroupProfil<?php echo self::GROUP_STUDENT; ?>">
|
||||||
<?php echo template::select('userEditProfil' . self::GROUP_TUTOR, $module::$userProfils[self::GROUP_TUTOR], [
|
<?php echo template::select('userEditProfil' . self::GROUP_STUDENT, $module::$userProfils[self::GROUP_STUDENT], [
|
||||||
'label' => 'Profil',
|
'label' => 'Profil',
|
||||||
'selected' => $this->getData(['user', $this->getUrl(2), 'profil']),
|
'selected' => $this->getData(['user', $this->getUrl(2), 'profil']),
|
||||||
'disabled' => $this->getUser('group') !== self::GROUP_ADMIN,
|
'disabled' => $this->getUser('group') !== self::GROUP_ADMIN,
|
||||||
@ -135,10 +135,10 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col12">
|
<div class="col12">
|
||||||
<div id="userCommentProfil<?php echo self::GROUP_TUTOR; ?>"
|
<div id="userCommentProfil<?php echo self::GROUP_STUDENT; ?>"
|
||||||
class="col12 userCommentProfil">
|
class="col12 userCommentProfil">
|
||||||
<?php echo template::textarea('userEditProfilComment' . self::GROUP_TUTOR, [
|
<?php echo template::textarea('userEditProfilComment' . self::GROUP_STUDENT, [
|
||||||
"value" => implode("\n", $module::$userProfilsComments[self::GROUP_TUTOR]),
|
"value" => implode("\n", $module::$userProfilsComments[self::GROUP_STUDENT]),
|
||||||
'disabled' => $this->getUser('group') !== self::GROUP_ADMIN,
|
'disabled' => $this->getUser('group') !== self::GROUP_ADMIN,
|
||||||
]);
|
]);
|
||||||
?>
|
?>
|
||||||
|
@ -36,8 +36,8 @@ class blog extends common
|
|||||||
'option' => self::GROUP_TEACHER,
|
'option' => self::GROUP_TEACHER,
|
||||||
'delete' => self::GROUP_TEACHER,
|
'delete' => self::GROUP_TEACHER,
|
||||||
'edit' => self::GROUP_TEACHER,
|
'edit' => self::GROUP_TEACHER,
|
||||||
'index' => self::GROUP_STUDENT,
|
'index' => self::GROUP_VISITOR,
|
||||||
'rss' => self::GROUP_STUDENT
|
'rss' => self::GROUP_VISITOR
|
||||||
];
|
];
|
||||||
|
|
||||||
public static $articles = [];
|
public static $articles = [];
|
||||||
|
@ -27,7 +27,7 @@ class form extends common
|
|||||||
'data' => self::GROUP_TEACHER,
|
'data' => self::GROUP_TEACHER,
|
||||||
'delete' => self::GROUP_TEACHER,
|
'delete' => self::GROUP_TEACHER,
|
||||||
'deleteall' => self::GROUP_TEACHER,
|
'deleteall' => self::GROUP_TEACHER,
|
||||||
'index' => self::GROUP_STUDENT,
|
'index' => self::GROUP_VISITOR,
|
||||||
'export2csv' => self::GROUP_TEACHER,
|
'export2csv' => self::GROUP_TEACHER,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ class gallery extends common
|
|||||||
'add' => self::GROUP_TEACHER,
|
'add' => self::GROUP_TEACHER,
|
||||||
'theme' => self::GROUP_TEACHER,
|
'theme' => self::GROUP_TEACHER,
|
||||||
'option' => self::GROUP_TEACHER,
|
'option' => self::GROUP_TEACHER,
|
||||||
'index' => self::GROUP_STUDENT
|
'index' => self::GROUP_VISITOR
|
||||||
];
|
];
|
||||||
|
|
||||||
public static $sort = [
|
public static $sort = [
|
||||||
|
@ -28,8 +28,8 @@ class news extends common
|
|||||||
// paramétrage des news
|
// paramétrage des news
|
||||||
'delete' => self::GROUP_TEACHER,
|
'delete' => self::GROUP_TEACHER,
|
||||||
'edit' => self::GROUP_TEACHER,
|
'edit' => self::GROUP_TEACHER,
|
||||||
'index' => self::GROUP_STUDENT,
|
'index' => self::GROUP_VISITOR,
|
||||||
'rss' => self::GROUP_STUDENT
|
'rss' => self::GROUP_VISITOR
|
||||||
];
|
];
|
||||||
|
|
||||||
public static $news = [];
|
public static $news = [];
|
||||||
|
@ -22,7 +22,7 @@ class redirection extends common
|
|||||||
|
|
||||||
public static $actions = [
|
public static $actions = [
|
||||||
'config' => self::GROUP_TEACHER,
|
'config' => self::GROUP_TEACHER,
|
||||||
'index' => self::GROUP_STUDENT
|
'index' => self::GROUP_VISITOR
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ class search extends common
|
|||||||
const DATADIRECTORY = self::DATA_DIR . 'search/';
|
const DATADIRECTORY = self::DATA_DIR . 'search/';
|
||||||
|
|
||||||
public static $actions = [
|
public static $actions = [
|
||||||
'index' => self::GROUP_STUDENT,
|
'index' => self::GROUP_VISITOR,
|
||||||
'config' => self::GROUP_TEACHER
|
'config' => self::GROUP_TEACHER
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ class slider extends common
|
|||||||
'theme' => self::GROUP_MODERATOR,
|
'theme' => self::GROUP_MODERATOR,
|
||||||
'delete' => self::GROUP_MODERATOR,
|
'delete' => self::GROUP_MODERATOR,
|
||||||
'dirs' => self::GROUP_MODERATOR,
|
'dirs' => self::GROUP_MODERATOR,
|
||||||
'index' => self::GROUP_STUDENT
|
'index' => self::GROUP_VISITOR
|
||||||
];
|
];
|
||||||
|
|
||||||
const VERSION = '6.0';
|
const VERSION = '6.0';
|
||||||
|
Loading…
Reference in New Issue
Block a user