Fixed longtimenosee unenrolments. user_lastaccess and role_assignments were growing with uneccessary entries, to the point where memory limits were reached and in the end NO unenrolments were happening at all.

See  MDL-11571
This commit is contained in:
moodler 2007-10-03 12:24:06 +00:00
parent ece966f06e
commit 1afb11e70b
2 changed files with 4 additions and 5 deletions

View file

@ -354,10 +354,9 @@ function get_users_unconfirmed($cutofftime=2000000000) {
*/
function get_users_longtimenosee($cutofftime) {
global $CFG;
return get_records_sql("SELECT userid as id, courseid
return get_records_sql("SELECT id, userid, courseid
FROM {$CFG->prefix}user_lastaccess
WHERE courseid != ".SITEID."
AND timeaccess > 0
AND timeaccess < $cutofftime ");
}