Home
Documentation
Downloads
Demo
Tracker
Development
Translation
Moodle.net
Search
projects
/
moodle.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a280078
)
MDL-30051 cron: login error sql is now cross db
author
Rajesh Taneja
<rajesh@moodle.com>
Fri, 30 Mar 2012 03:44:53 +0000
(11:44 +0800)
committer
Rajesh Taneja
<rajesh@moodle.com>
Fri, 30 Mar 2012 08:48:31 +0000
(16:48 +0800)
lib/cronlib.php
patch
|
blob
|
blame
|
history
diff --git
a/lib/cronlib.php
b/lib/cronlib.php
index
818a774
..
62d4348
100644
(file)
--- a/
lib/cronlib.php
+++ b/
lib/cronlib.php
@@
-646,7
+646,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
// 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
FROM {log} l
JOIN {cache_flags} cf ON l.ip = cf.name
LEFT JOIN {user} u ON l.userid = u.id
@@
-660,8
+661,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 > ?
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
$params = array($CFG->lastnotifyfailure, $CFG->lastnotifyfailure);
// Init some variables