MDL-32985 cron: prevent notices on "new" sites.

This commit is contained in:
Eloy Lafuente (stronk7)
2012-06-05 02:17:16 +02:00
parent 335a24ea72
commit ceb3ce58a9
+4 -4
View File
@@ -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.