Skip to content
Browse files

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

  • Loading branch information...
1 parent 335a24e commit ceb3ce58a978fcf21d74ac4792f40c5b136ab0b3 @stronk7 stronk7 committed Jun 5, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/moodlelib.php
View
8 lib/moodlelib.php
@@ -8145,17 +8145,17 @@ 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.
if (((time() - HOURSECS) < $CFG->lastnotifyfailure) || !is_array($recip) || count($recip) <= 0) {
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.

0 comments on commit ceb3ce5

Please sign in to comment.
Something went wrong with that request. Please try again.