Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

MDL-30051 cron: login error sql is now cross db

  • Loading branch information...
commit a415ecc21cf7b4f2848fc86c1e5b35da98a0d96d 1 parent a280078
Rajesh Taneja rajeshtaneja authored

Showing 1 changed file with 4 additions and 3 deletions. Show diff stats Hide diff stats

  1. +4 3 lib/cronlib.php
7 lib/cronlib.php
@@ -646,7 +646,8 @@ function notify_login_failures() {
646 646
647 647 // Now, select all the login error logged records belonging to the ips and infos
648 648 // since lastnotifyfailure, that we have stored in the cache_flags table
649   - $sql = "SELECT l.*, u.firstname, u.lastname
  649 + $sql = "SELECT * FROM (
  650 + SELECT l.*, u.firstname, u.lastname
650 651 FROM {log} l
651 652 JOIN {cache_flags} cf ON l.ip = cf.name
652 653 LEFT JOIN {user} u ON l.userid = u.id
@@ -660,8 +661,8 @@ function notify_login_failures() {
660 661 LEFT JOIN {user} u ON l.userid = u.id
661 662 WHERE l.module = 'login' AND l.action = 'error'
662 663 AND l.time > ?
663   - AND cf.flagtype = 'login_failure_by_info'
664   - ORDER BY time DESC";
  664 + AND cf.flagtype = 'login_failure_by_info') t
  665 + ORDER BY t.time DESC";
665 666 $params = array($CFG->lastnotifyfailure, $CFG->lastnotifyfailure);
666 667
667 668 // Init some variables

0 comments on commit a415ecc

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