Permalink
Browse files

Merge branch 'MDL-28690_metacourse_automatic_unenrolment' of git://gi…

…thub.com/davosmith/moodle into MOODLE_19_STABLE
  • Loading branch information...
2 parents eee432c + f802bf6 commit 615702a5c1ff2af65c652196353f5e5e46a39468 @stronk7 stronk7 committed Aug 23, 2011
Showing with 6 additions and 3 deletions.
  1. +6 −3 admin/cron.php
View
@@ -241,10 +241,13 @@
if ($CFG->longtimenosee) { // value in days
$cuttime = $timenow - ($CFG->longtimenosee * 3600 * 24);
- $rs = get_recordset_sql ("SELECT id, userid, courseid
- FROM {$CFG->prefix}user_lastaccess
+ $rs = get_recordset_sql ("SELECT la.id, la.userid, la.courseid
+ FROM {$CFG->prefix}user_lastaccess la
+ JOIN {$CFG->prefix}course c
+ ON c.id = la.courseid
WHERE courseid != ".SITEID."
- AND timeaccess < $cuttime ");
+ AND timeaccess < $cuttime
+ AND c.metacourse = 0 ");
while ($assign = rs_fetch_next_record($rs)) {
if ($context = get_context_instance(CONTEXT_COURSE, $assign->courseid)) {
if (role_unassign(0, $assign->userid, 0, $context->id)) {

0 comments on commit 615702a

Please sign in to comment.