// Get and validate context.
$context = self::get_context_from_params($fileinfo);
self::validate_context($context);
-
- if (!($fileinfo['component'] == 'user' and $fileinfo['filearea'] == 'private')) {
- throw new coding_exception('File can be uploaded to user private area only');
- } else {
- // TODO MDL-31116 hard-coded to use user_private area.
- $component = 'user';
- $filearea = 'private';
+ if (($fileinfo['component'] == 'user' and $fileinfo['filearea'] == 'private')) {
- debugging('Uploading directly to user private files area is deprecated. Upload to a draft area and then move the files with core_user::add_files_to_private_files');
++ debugging('Uploading directly to user private files area is deprecated. Upload to a draft area and then move the files with core_user::add_user_private_files');
}
$browser = get_file_browser();
upgrade_main_savepoint(true, 2013072600.01);
}
- if ($oldversion < 2013080700.01) {
++ if ($oldversion < 2013081200.00) {
+ // Define field uploadfiles to be added to external_services.
+ $table = new xmldb_table('external_services');
+ $field = new xmldb_field('uploadfiles', XMLDB_TYPE_INTEGER, '1', null, XMLDB_NOTNULL, null, '0', 'downloadfiles');
+
+ // Conditionally launch add field uploadfiles.
+ if (!$dbman->field_exists($table, $field)) {
+ $dbman->add_field($table, $field);
+ }
+
+ // Main savepoint reached.
- upgrade_main_savepoint(true, 2013080700.01);
++ upgrade_main_savepoint(true, 2013081200.00);
+ }
+
return true;
}
defined('MOODLE_INTERNAL') || die();
- $version = 2013080801.00; // YYYYMMDD = weekly release date of this DEV branch
-$version = 2013080700.01; // YYYYMMDD = weekly release date of this DEV branch
++$version = 2013081200.00; // YYYYMMDD = weekly release date of this DEV branch
// RR = release increments - 00 in DEV branches
// .XX = incremental changes