forked from ZwiiCMS-Team/ZwiiCampus
commente le code
This commit is contained in:
parent
fc1c1bf605
commit
6104800d4d
@ -506,12 +506,18 @@ class course extends common
|
||||
*/
|
||||
public function courseIsAvailable($courseId)
|
||||
{
|
||||
// L'accès à l'accueil est toujours autorisé
|
||||
if ($courseId === 'home') {
|
||||
return true;
|
||||
}
|
||||
if ($this->getUser('group') === self::GROUP_ADMIN || $this->getUser('id') === $this->getData(['group', $courseId, 'author'])) {
|
||||
// Si un utilisateur connecté est admin aou auteur, c'est autorisé
|
||||
if (
|
||||
$this->getUser('password') === $this->getInput('ZWII_USER_PASSWORD') &&
|
||||
$this->getUser('group') === self::GROUP_ADMIN || $this->getUser('id') === $this->getData(['group', $courseId, 'author'])
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
// Retourne le statut du cours dans les autres cas
|
||||
$access = $this->getData(['course', $courseId, 'access']);
|
||||
switch ($access) {
|
||||
case self::COURSE_ACCESS_OPEN:
|
||||
|
Loading…
Reference in New Issue
Block a user