Permalink
Browse files

Merge branch 'wip-mdl-30051-m22' of git://github.com/rajeshtaneja/moo…

…dle into MOODLE_22_STABLE
  • Loading branch information...
2 parents 167c8c6 + d2fbfb5 commit 697f104ac1f329bf365fdcb86a6d8cd3358066e8 @danpoltawski danpoltawski committed Apr 10, 2012
Showing with 4 additions and 3 deletions.
  1. +4 −3 lib/cronlib.php
View
@@ -644,7 +644,8 @@ function notify_login_failures() {
// Now, select all the login error logged records belonging to the ips and infos
// since lastnotifyfailure, that we have stored in the cache_flags table
- $sql = "SELECT l.*, u.firstname, u.lastname
+ $sql = "SELECT * FROM (
+ SELECT l.*, u.firstname, u.lastname
FROM {log} l
JOIN {cache_flags} cf ON l.ip = cf.name
LEFT JOIN {user} u ON l.userid = u.id
@@ -658,8 +659,8 @@ function notify_login_failures() {
LEFT JOIN {user} u ON l.userid = u.id
WHERE l.module = 'login' AND l.action = 'error'
AND l.time > ?
- AND cf.flagtype = 'login_failure_by_info'
- ORDER BY time DESC";
+ AND cf.flagtype = 'login_failure_by_info') t
+ ORDER BY t.time DESC";
$params = array($CFG->lastnotifyfailure, $CFG->lastnotifyfailure);
// Init some variables

0 comments on commit 697f104

Please sign in to comment.