From: Marina Glancy Date: Tue, 1 Oct 2013 10:42:37 +0000 (+1000) Subject: Merge branch 'MDL-39653-master' of git://github.com/danpoltawski/moodle X-Git-Tag: v2.6.0-beta~189 X-Git-Url: http://git.moodle.org/gw?p=moodle.git;a=commitdiff_plain;h=815f0ef33c935b11fd821c2e433730f3c1b7a270;hp=eef850815c85baec4c2f7d55228e3c7ba13206c6 Merge branch 'MDL-39653-master' of git://github.com/danpoltawski/moodle --- diff --git a/enrol/imsenterprise/lib.php b/enrol/imsenterprise/lib.php index acb8b056185..f5aa7c188aa 100644 --- a/enrol/imsenterprise/lib.php +++ b/enrol/imsenterprise/lib.php @@ -85,6 +85,7 @@ function cron() { $this->logfp = fopen($logtolocation, 'a'); } + $fileisnew = false; if ( file_exists($filename) ) { @set_time_limit(0); $starttime = time(); @@ -107,10 +108,8 @@ function cron() { if(empty($prev_path) || ($filename != $prev_path)) { $fileisnew = true; } elseif(isset($prev_time) && ($filemtime <= $prev_time)) { - $fileisnew = false; $this->log_line('File modification time is not more recent than last update - skipping processing.'); } elseif(isset($prev_md5) && ($md5 == $prev_md5)) { - $fileisnew = false; $this->log_line('File MD5 hash is same as on last update - skipping processing.'); } else { $fileisnew = true; // Let's process it! @@ -217,7 +216,7 @@ function cron() { $this->log_line('File not found: '.$filename); } - if (!empty($mailadmins)) { + if (!empty($mailadmins) && $fileisnew) { $msg = "An IMS enrolment has been carried out within Moodle.\nTime taken: $timeelapsed seconds.\n\n"; if(!empty($logtolocation)){ if($this->logfp){