MDL-82643 enrol_self: clarify validation of notification threshold.

This commit is contained in:
Paul Holden
2024-07-30 15:46:44 +01:00
parent 1a33da6637
commit 3cf196df6f
2 changed files with 3 additions and 4 deletions
+1 -1
View File
@@ -702,7 +702,7 @@ class enrol_manual_plugin extends enrol_plugin {
// This method is used when configuring the enrolment method, and when only updating the welcome message.
// The 'expirynotify' key won't be set when updating the welcome message.
if (isset($data['expirynotify']) && $data['expirynotify'] > 0 && $data['expirythreshold'] < 86400) {
if (isset($data['expirynotify']) && $data['expirynotify'] > 0 && $data['expirythreshold'] < DAYSECS) {
$errors['expirythreshold'] = get_string('errorthresholdlow', 'core_enrol');
}
+2 -3
View File
@@ -1073,9 +1073,8 @@ class enrol_self_plugin extends enrol_plugin {
}
}
if (array_key_exists('expirynotify', $data)
&& ($data['expirynotify'] > 0 || $data['customint2'])
&& $data['expirythreshold'] < 86400) {
// If expirynotify is selected, then ensure the threshold is at least one day.
if (isset($data['expirynotify']) && $data['expirynotify'] > 0 && $data['expirythreshold'] < DAYSECS) {
$errors['expirythreshold'] = get_string('errorthresholdlow', 'core_enrol');
}