diff --git a/enrol/imsenterprise/config.html b/enrol/imsenterprise/config.html deleted file mode 100644 index 56ba350ff33..00000000000 --- a/enrol/imsenterprise/config.html +++ /dev/null @@ -1,199 +0,0 @@ -
| - | ||
|---|---|---|
| : | -- - | -|
| : | -- - | -|
| : | -- enrol_mailadmins) echo "checked=\"checked\"" ?> /> - | -- - | -
| - | ||
| : | -- enrol_createnewusers) echo "checked=\"checked\"" ?> /> - | -- old_help_icon('createnewusers', 'More detail about this option', 'enrol/imsenterprise'); ?> - | -
| : | -- enrol_imsdeleteusers) echo "checked=\"checked\"" ?> /> - | -- old_help_icon('deleteusers', 'More detail about this option', 'enrol/imsenterprise'); ?> - | -
| : | -- enrol_fixcaseusernames) echo "checked=\"checked\"" ?> /> - | -- - | -
| : | -- enrol_fixcasepersonalnames) echo "checked=\"checked\"" ?> /> - | -- - | -
| : | -- enrol_imssourcedidfallback) echo "checked=\"checked\"" ?> /> - | -- old_help_icon('sourceddidfallback', 'More detail about this option', 'enrol/imsenterprise'); ?> - | -
| - | ||
| - | ||
| "" (): | -- $configref) ? $frm->$configref : $this->determine_default_rolemapping($imsrolenum), false); - ?> - | -- | -
| - | ||
| : | -- enrol_truncatecoursecodes).'"' ?> name="enrol_truncatecoursecodes" size="3" maxlength="3" /> - | -- old_help_icon('truncatecoursecodes', 'More detail about this option', 'enrol/imsenterprise'); ?> - | -
| : | -- enrol_createnewcourses) echo "checked=\"checked\"" ?> /> - | -- old_help_icon('createnewcourses', 'More detail about this option', 'enrol/imsenterprise'); ?> - | -
| : | -- enrol_createnewcategories) echo "checked=\"checked\"" ?> /> - | -- old_help_icon('categorisation', 'More detail about this option', 'enrol/imsenterprise'); ?> - | -
| : | -- enrol_imsunenrol) echo "checked=\"checked\"" ?> /> - | -- old_help_icon('unenrol', 'More detail about this option', 'enrol/imsenterprise'); ?> - | -
| - | ||
| : | -- enrol_imsrestricttarget).'"' ?> name="enrol_imsrestricttarget" size="20" maxlength="32" /> - old_help_icon('target', 'More detail about this option', 'enrol/imsenterprise'); ?> - | -|
| : | -- enrol_imscapitafix) echo "checked=\"checked\"" ?> /> - | -- old_help_icon('capita', 'More detail about this option', 'enrol/imsenterprise'); ?> - | -
Resetting config->$configref
"; - $config->$configref = 0; - } - set_config('enrol_imse_imsrolemap' . $imsrolenum, $config->$configref); - } - - - set_config('enrol_ims_prev_md5', ''); // Forget the MD5 - to force re-processing if we change the config setting - set_config('enrol_ims_prev_time', ''); // Ditto - return true; - -} - -function get_access_icons($course){} - /** * Read in an IMS Enterprise file. * Originally designed to handle v1.1 files but should be able to handle @@ -221,20 +63,26 @@ function get_access_icons($course){} function cron() { global $CFG; - if (empty($CFG->enrol_imsfilelocation)) { + // Get configs + $imsfilelocation = $this->get_config('imsfilelocation'); + $logtolocation = $this->get_config('logtolocation'); + $mailadmins = $this->get_config('mailadmins'); + $prev_time = $this->get_config('prev_time'); + $prev_md5 = $this->get_config('prev_md5'); + $prev_path = $this->get_config('prev_path'); + + if (empty($imsfilelocation)) { // $filename = "$CFG->dirroot/enrol/imsenterprise/example.xml"; // Default location $filename = "$CFG->dataroot/1/imsenterprise-enrol.xml"; // Default location } else { - $filename = $CFG->enrol_imsfilelocation; + $filename = $imsfilelocation; } $this->logfp = false; // File pointer for writing log data to - if(!empty($CFG->enrol_logtolocation)) { - $this->logfp = fopen($CFG->enrol_logtolocation, 'a'); + if(!empty($logtolocation)) { + $this->logfp = fopen($logtolocation, 'a'); } - - if ( file_exists($filename) ) { @set_time_limit(0); $starttime = time(); @@ -252,19 +100,19 @@ function cron() { // Decide if we want to process the file (based on filepath, modification time, and MD5 hash) // This is so we avoid wasting the server's efforts processing a file unnecessarily - if(empty($CFG->enrol_ims_prev_path) || ($filename != $CFG->enrol_ims_prev_path)){ + if(empty($prev_path) || ($filename != $prev_path)) { $fileisnew = true; - }elseif(isset($CFG->enrol_ims_prev_time) && ($filemtime <= $CFG->enrol_ims_prev_time)){ + } 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($CFG->enrol_ims_prev_md5) && ($md5 == $CFG->enrol_ims_prev_md5)){ + } elseif(isset($prev_md5) && ($md5 == $prev_md5)) { $fileisnew = false; $this->log_line('File MD5 hash is same as on last update - skipping processing.'); - }else{ + } else { $fileisnew = true; // Let's process it! } - if($fileisnew){ + if($fileisnew) { $listoftags = array('group', 'person', 'member', 'membership', 'comments', 'properties'); // The list of tags which should trigger action (even if only cache trimming) $this->continueprocessing = true; // The