diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 95cebdb486e..0d46fe4ef1c 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -8145,6 +8145,10 @@ function notify_login_failures() { return false; } + if (empty($CFG->lastnotifyfailure)) { + $CFG->lastnotifyfailure=0; + } + $recip = get_users_from_config($CFG->notifyloginfailures, 'moodle/site:config'); // If it has been less than an hour, or if there are no recipients, don't execute. @@ -8152,10 +8156,6 @@ function notify_login_failures() { return false; } - if (empty($CFG->lastnotifyfailure)) { - $CFG->lastnotifyfailure=0; - } - // we need to deal with the threshold stuff first. if (empty($CFG->notifyloginthreshold)) { $CFG->notifyloginthreshold = 10; // default to something sensible.