diff --git a/app/controllers/course/admission.php b/app/controllers/course/admission.php index fad975512065b5e276c07179135234f386c6d651..efc7c22bac944119c82a2ae884da4770b010f797 100644 --- a/app/controllers/course/admission.php +++ b/app/controllers/course/admission.php @@ -405,6 +405,7 @@ class Course_AdmissionController extends AuthenticatedController $rule_types = AdmissionRule::getAvailableAdmissionRules(true); if (isset($rule_types[$type])) { $rule = new $type($rule_id); + $another_rule = null; if (isset($rule_types[$another_type])) { $another_rule = new $another_type($another_rule_id); } @@ -418,11 +419,16 @@ class Course_AdmissionController extends AuthenticatedController return; } else { CSRFProtection::verifyUnsafeRequest(); - $rule->setAllData(Request::getInstance()); $errors = $rule->validate(Request::getInstance()); + if (empty($errors)) { + $rule->setAllData(Request::getInstance()); + } if ($another_rule) { - $another_rule->setAllData(Request::getInstance()); - $errors = array_merge($errors, $another_rule->validate(Request::getInstance())); + $another_errors = $another_rule->validate(Request::getInstance()); + if (empty($another_errors)) { + $another_rule->setAllData(Request::getInstance()); + } + $errors = array_merge($errors, $another_errors); } if (!mb_strlen(trim(Request::get('instant_course_set_name')))) { $errors[] = _("Bitte geben Sie einen Namen für die Anmelderegel ein!"); diff --git a/lib/admissionrules/passwordadmission/PasswordAdmission.class.php b/lib/admissionrules/passwordadmission/PasswordAdmission.class.php index 08a687d32073c716501e5a413c144ac5c236bdf2..c0aa97070a75716db31b8e45a7d0eaa3a082829d 100644 --- a/lib/admissionrules/passwordadmission/PasswordAdmission.class.php +++ b/lib/admissionrules/passwordadmission/PasswordAdmission.class.php @@ -140,7 +140,7 @@ class PasswordAdmission extends AdmissionRule * * @param String userId * @param String courseId - * @return Boolean + * @return array */ public function ruleApplies($userId, $courseId) { @@ -235,7 +235,4 @@ class PasswordAdmission extends AdmissionRule } return $errors; } - -} /* end of class PasswordAdmission */ - -?> +} diff --git a/lib/admissionrules/passwordadmission/templates/configure.php b/lib/admissionrules/passwordadmission/templates/configure.php index 7e067f6db5948743a18ad59ec5f60bfb8d3200be..e9ccac1618f95b6f53b05ce2ebaf830733c6c04c 100644 --- a/lib/admissionrules/passwordadmission/templates/configure.php +++ b/lib/admissionrules/passwordadmission/templates/configure.php @@ -1,15 +1,14 @@ <h3><?= htmlReady($rule->getName()) ?></h3> -<label for="message" class="caption"> +<label> <?= _('Nachricht bei fehlgeschlagener Anmeldung') ?>: + <textarea name="message" rows="4" cols="50"><?= htmlReady($rule->getMessage()) ?></textarea> </label> -<textarea name="message" rows="4" cols="50"><?= $rule->getMessage() ?></textarea> -<br/> -<label for="password1" class="caption"> +<label> <?= _('Zugangspasswort') ?>: + <input type="password" name="password1" size="25" max="40" value="<?= htmlReady($rule->getPassword()) ?>" required> </label> -<input type="password" name="password1" size="25" max="40" value="<?= htmlReady($rule->getPassword()) ?>" required/> <br/> -<label for="password2" class="caption"> +<label> <?= _('Passwort wiederholen') ?>: + <input type="password" name="password2" size="25" max="40" value="<?= htmlReady($rule->getPassword()) ?>" required> </label> -<input type="password" name="password2" size="25" max="40" value="<?= htmlReady($rule->getPassword()) ?>" required/> \ No newline at end of file