courseUserEnrolment change de nom

This commit is contained in:
Fred Tempez 2023-09-25 20:36:54 +02:00
parent 71e4bd5612
commit 56af790d82
2 changed files with 4 additions and 3 deletions

View File

@ -1455,8 +1455,9 @@ class common
* @param string $userId identifiant de l'utilisateur
* @param string $courseId identifiant du cours sollicité
*/
public function courseUserEnrolment($courseId, $userId = null)
public function courseIsUserEnroled($courseId)
{
$userId = $this->getUser('id');
$group = $userId ? $this->getData(['user', $userId, 'group']) : false;
switch ($group) {
case self::GROUP_ADMIN:

View File

@ -316,7 +316,7 @@ class course extends common
self::$swapMessage['submitLabel'] = 'Se connecter';
self::$swapMessage['enrolmentMessage'] = '';
self::$swapMessage['enrolmentKey'] = '';
if ($this->courseUserEnrolment($courseId, $userId) === false) {
if ($this->courseIsUserEnroled($courseId) === false) {
switch ($this->getData(['course', $courseId, 'enrolment'])) {
case self::COURSE_ENROLMENT_GUEST:
case self::COURSE_ENROLMENT_SELF: