hello, I am trying to make moodle communicate with an external system, I am running moodle 2.9, I know there are enrolment and authentication plugins from external database, but I would like to use the flat file upload for users Maybe the external connection/bridge failed for some reason), what I would like to know if there is a way to set the filepath and location rather tnan using the filepicker? this way the external system will dump a csv file and Moodle cron job will directly read/update from this csv without my intervention or input to select the file from filepicker and click upload.... the csv import file looks like this, can use a predefined filepath?
if ($proffields = $DB->get_records('user_info_field')) {
foreach ($proffields as $key => $proffield) {
$profilefieldname = 'profile_field_'.$proffield->shortname;
$PRF_FIELDS[] = $profilefieldname;
// Re-index $proffields with key as shortname. This will be
// used while checking if profile data is key and needs to be converted (eg. menu profile field)
$proffields[$profilefieldname] = $proffield;
unset($proffields[$key]);
}
}
if (empty($iid)) {
$mform1 = new admin_uploaduser_form1();
if ($formdata = $mform1->get_data()) {
$iid = csv_import_reader::get_new_iid('uploaduser');
$cir = new csv_import_reader($iid, 'uploaduser');
$content = $mform1->get_file_content('userfile');
$readcount = $cir->load_csv_content($content, $formdata->encoding, $formdata->delimiter_name);
$csvloaderror = $cir->get_error();
unset($content);
if (!is_null($csvloaderror)) {
print_error('csvloaderror', '', $returnurl, $csvloaderror);
}
// test if columns ok
$filecolumns = uu_validate_user_upload_columns($cir, $STD_FIELDS, $PRF_FIELDS, $returnurl);
// continue to form2