forked from ZwiiCMS-Team/ZwiiCampus
fix bloquage clé incorrecte
This commit is contained in:
parent
6b840ecaa9
commit
a025d33ab8
@ -658,10 +658,17 @@ class course extends common
|
||||
$_SESSION['ZWII_SITE_CONTENT'] = $courseId;
|
||||
break;
|
||||
case self::COURSE_ENROLMENT_SELF_KEY:
|
||||
if ($this->getInput('courseSwapEnrolmentKey') === $this->getData(['course', $courseId, 'enrolmentKey'])) {
|
||||
if ($this->getInput('courseSwapEnrolmentKey', null, true) === $this->getData(['course', $courseId, 'enrolmentKey'])) {
|
||||
$this->courseEnrolUser($courseId, $userId);
|
||||
// Stocker la sélection
|
||||
$_SESSION['ZWII_SITE_CONTENT'] = $courseId;
|
||||
} else {
|
||||
// Valeurs en sortie
|
||||
$this->addOutput([
|
||||
'redirect' => helper::baseUrl(),
|
||||
'state' => false,
|
||||
'notification' => 'La clé est incorrecte'
|
||||
]);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -784,7 +791,8 @@ class course extends common
|
||||
}
|
||||
}
|
||||
|
||||
private function countPages($array) {
|
||||
private function countPages($array)
|
||||
{
|
||||
$count = 0;
|
||||
foreach ($array as $key => $value) {
|
||||
$count++; // Incrémente le compteur pour chaque clé associative trouvée
|
||||
|
Loading…
x
Reference in New Issue
Block a user