diff --git a/admin/settings/courses.php b/admin/settings/courses.php index 88fbdef20a4..321ce449762 100644 --- a/admin/settings/courses.php +++ b/admin/settings/courses.php @@ -97,7 +97,6 @@ if ($hassiteconfig $temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_users', new lang_string('generalusers','backup'), new lang_string('configgeneralusers','backup'), array('value'=>1, 'locked'=>0))); $temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_anonymize', new lang_string('generalanonymize','backup'), new lang_string('configgeneralanonymize','backup'), array('value'=>0, 'locked'=>0))); $temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_role_assignments', new lang_string('generalroleassignments','backup'), new lang_string('configgeneralroleassignments','backup'), array('value'=>1, 'locked'=>0))); - $temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_user_files', new lang_string('generaluserfiles','backup'), new lang_string('configgeneraluserfiles','backup'), array('value'=>1, 'locked'=>0))); $temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_activities', new lang_string('generalactivities','backup'), new lang_string('configgeneralactivities','backup'), array('value'=>1, 'locked'=>0))); $temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_blocks', new lang_string('generalblocks','backup'), new lang_string('configgeneralblocks','backup'), array('value'=>1, 'locked'=>0))); $temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_filters', new lang_string('generalfilters','backup'), new lang_string('configgeneralfilters','backup'), array('value'=>1, 'locked'=>0))); @@ -144,7 +143,6 @@ if ($hassiteconfig $temp->add(new admin_setting_heading('automatedsettings', new lang_string('automatedsettings','backup'), '')); $temp->add(new admin_setting_configcheckbox('backup/backup_auto_users', new lang_string('generalusers', 'backup'), new lang_string('configgeneralusers', 'backup'), 1)); $temp->add(new admin_setting_configcheckbox('backup/backup_auto_role_assignments', new lang_string('generalroleassignments','backup'), new lang_string('configgeneralroleassignments','backup'), 1)); - $temp->add(new admin_setting_configcheckbox('backup/backup_auto_user_files', new lang_string('generaluserfiles', 'backup'), new lang_string('configgeneraluserfiles','backup'), 1)); $temp->add(new admin_setting_configcheckbox('backup/backup_auto_activities', new lang_string('generalactivities','backup'), new lang_string('configgeneralactivities','backup'), 1)); $temp->add(new admin_setting_configcheckbox('backup/backup_auto_blocks', new lang_string('generalblocks','backup'), new lang_string('configgeneralblocks','backup'), 1)); $temp->add(new admin_setting_configcheckbox('backup/backup_auto_filters', new lang_string('generalfilters','backup'), new lang_string('configgeneralfilters','backup'), 1)); diff --git a/backup/converter/moodle1/handlerlib.php b/backup/converter/moodle1/handlerlib.php index f0c97541ca9..dd09fd4c637 100644 --- a/backup/converter/moodle1/handlerlib.php +++ b/backup/converter/moodle1/handlerlib.php @@ -441,7 +441,6 @@ class moodle1_root_handler extends moodle1_xml_handler { 'users' => 0, // @todo how to detect this from moodle.xml? 'anonymize' => 0, 'role_assignments' => 0, - 'user_files' => 0, 'activities' => 1, 'blocks' => 1, 'filters' => 0, diff --git a/backup/moodle2/backup_final_task.class.php b/backup/moodle2/backup_final_task.class.php index b9f7251f78b..abbecb8be79 100644 --- a/backup/moodle2/backup_final_task.class.php +++ b/backup/moodle2/backup_final_task.class.php @@ -64,7 +64,7 @@ class backup_final_task extends backup_task { // done in a single pass $this->add_step(new backup_annotate_all_question_files('question_files')); - // Annotate all the user files (conditionally) (private, profile and icon files) + // Annotate all the user files (conditionally) (profile and icon files) // Because each user has its own context, we need a separate/specialised step here // This step also ensures that the contexts for all the users exist, so next // step can be safely executed (join between users and contexts) diff --git a/backup/moodle2/backup_root_task.class.php b/backup/moodle2/backup_root_task.class.php index fc65242647a..011a7b5f602 100644 --- a/backup/moodle2/backup_root_task.class.php +++ b/backup/moodle2/backup_root_task.class.php @@ -96,13 +96,6 @@ class backup_root_task extends backup_task { $this->add_setting($roleassignments); $users->add_dependency($roleassignments); - // Define user_files (dependent of users and anonymize) - $userfiles = new backup_user_files_setting('user_files', base_setting::IS_BOOLEAN, true); - $userfiles->set_ui(new backup_setting_ui_checkbox($userfiles, get_string('rootsettinguserfiles', 'backup'))); - $this->add_setting($userfiles); - $users->add_dependency($userfiles); - $anonymize->add_dependency($userfiles, setting_dependency::DISABLED_TRUE); - // Define activities $activities = new backup_activities_setting('activities', base_setting::IS_BOOLEAN, true); $activities->set_ui(new backup_setting_ui_checkbox($activities, get_string('rootsettingactivities', 'backup'))); diff --git a/backup/moodle2/backup_settingslib.php b/backup/moodle2/backup_settingslib.php index fe39f2cf9a2..31e3c7374f1 100644 --- a/backup/moodle2/backup_settingslib.php +++ b/backup/moodle2/backup_settingslib.php @@ -80,13 +80,6 @@ class backup_activities_setting extends backup_generic_setting {} */ class backup_anonymize_setting extends root_backup_setting {} -/** - * root setting to control if backup will include - * user files or no (images, local storage), depends of @backup_users_setting - * exactly in the same way than @backup_anonymize_setting so we extend from it - */ -class backup_user_files_setting extends backup_anonymize_setting {} - /** * root setting to control if backup will include * role assignments or no (any level), depends of @backup_users_setting diff --git a/backup/moodle2/backup_stepslib.php b/backup/moodle2/backup_stepslib.php index b87e3cc4117..78d272144ee 100644 --- a/backup/moodle2/backup_stepslib.php +++ b/backup/moodle2/backup_stepslib.php @@ -1768,10 +1768,6 @@ class backup_annotate_all_user_files extends backup_execution_step { // List of fileareas we are going to annotate $fileareas = array('profile', 'icon'); - if ($this->get_setting_value('user_files')) { // private files only if enabled in settings - $fileareas[] = 'private'; - } - // Fetch all annotated (final) users $rs = $DB->get_recordset('backup_ids_temp', array( 'backupid' => $this->get_backupid(), 'itemname' => 'userfinal')); diff --git a/backup/moodle2/restore_root_task.class.php b/backup/moodle2/restore_root_task.class.php index ac3f81d823f..319fe08ccd7 100644 --- a/backup/moodle2/restore_root_task.class.php +++ b/backup/moodle2/restore_root_task.class.php @@ -125,19 +125,6 @@ class restore_root_task extends restore_task { $this->add_setting($roleassignments); $users->add_dependency($roleassignments); - // Define user_files (dependent of users) - $defaultvalue = false; // Safer default - $changeable = false; - if (isset($rootsettings['user_files']) && $rootsettings['user_files']) { // Only enabled when available - $defaultvalue = true; - $changeable = true; - } - $userfiles = new restore_user_files_setting('user_files', base_setting::IS_BOOLEAN, $defaultvalue); - $userfiles->set_ui(new backup_setting_ui_checkbox($userfiles, get_string('rootsettinguserfiles', 'backup'))); - $userfiles->get_ui()->set_changeable($changeable); - $this->add_setting($userfiles); - $users->add_dependency($userfiles); - // Define activitites $defaultvalue = false; // Safer default $changeable = false; diff --git a/backup/moodle2/restore_settingslib.php b/backup/moodle2/restore_settingslib.php index 6be3cc21830..09f92fe0d34 100644 --- a/backup/moodle2/restore_settingslib.php +++ b/backup/moodle2/restore_settingslib.php @@ -49,13 +49,6 @@ class restore_users_setting extends restore_generic_setting {} */ class restore_role_assignments_setting extends root_backup_setting {} -/** - * root setting to control if restore will create - * user files or no (images, local storage), depends of @restore_users_setting - * exactly in the same way than @restore_role_assignments_setting so we extend from it - */ -class restore_user_files_setting extends restore_role_assignments_setting {} - /** * root setting to control if restore will create activities * A lot of other settings (_included at activity levels) diff --git a/backup/moodle2/restore_stepslib.php b/backup/moodle2/restore_stepslib.php index e62129bf76b..58048ec59a2 100644 --- a/backup/moodle2/restore_stepslib.php +++ b/backup/moodle2/restore_stepslib.php @@ -684,7 +684,7 @@ class restore_create_included_users extends restore_execution_step { protected function define_execution() { - restore_dbops::create_included_users($this->get_basepath(), $this->get_restoreid(), $this->get_setting_value('user_files'), $this->task->get_userid()); + restore_dbops::create_included_users($this->get_basepath(), $this->get_restoreid(), $this->task->get_userid()); } } diff --git a/backup/util/dbops/backup_controller_dbops.class.php b/backup/util/dbops/backup_controller_dbops.class.php index cd89d82f55f..dffdb8d73a0 100644 --- a/backup/util/dbops/backup_controller_dbops.class.php +++ b/backup/util/dbops/backup_controller_dbops.class.php @@ -440,7 +440,6 @@ abstract class backup_controller_dbops extends backup_dbops { 'backup_general_users' => 'users', 'backup_general_anonymize' => 'anonymize', 'backup_general_role_assignments' => 'role_assignments', - 'backup_general_user_files' => 'user_files', 'backup_general_activities' => 'activities', 'backup_general_blocks' => 'blocks', 'backup_general_filters' => 'filters', diff --git a/backup/util/dbops/restore_dbops.class.php b/backup/util/dbops/restore_dbops.class.php index 58342b2a59a..25f2e533d1c 100644 --- a/backup/util/dbops/restore_dbops.class.php +++ b/backup/util/dbops/restore_dbops.class.php @@ -730,7 +730,7 @@ abstract class restore_dbops { * ready to be created. Also, annotate their newids * once created for later reference */ - public static function create_included_users($basepath, $restoreid, $userfiles, $userid) { + public static function create_included_users($basepath, $restoreid, $userid) { global $CFG, $DB; $authcache = array(); // Cache to get some bits from authentication plugins @@ -871,10 +871,6 @@ abstract class restore_dbops { // Create user files in pool (profile, icon, private) by context restore_dbops::send_files_to_pool($basepath, $restoreid, 'user', 'icon', $recuser->parentitemid, $userid); restore_dbops::send_files_to_pool($basepath, $restoreid, 'user', 'profile', $recuser->parentitemid, $userid); - if ($userfiles) { // private files only if enabled in settings - restore_dbops::send_files_to_pool($basepath, $restoreid, 'user', 'private', $recuser->parentitemid, $userid); - } - } } $rs->close(); diff --git a/backup/util/helper/backup_cron_helper.class.php b/backup/util/helper/backup_cron_helper.class.php index 8631be6488d..b3599757157 100644 --- a/backup/util/helper/backup_cron_helper.class.php +++ b/backup/util/helper/backup_cron_helper.class.php @@ -323,7 +323,6 @@ abstract class backup_cron_automated_helper { $settings = array( 'users' => 'backup_auto_users', 'role_assignments' => 'backup_auto_role_assignments', - 'user_files' => 'backup_auto_user_files', 'activities' => 'backup_auto_activities', 'blocks' => 'backup_auto_blocks', 'filters' => 'backup_auto_filters', diff --git a/backup/util/ui/renderer.php b/backup/util/ui/renderer.php index 08454409e31..b1e302c8681 100644 --- a/backup/util/ui/renderer.php +++ b/backup/util/ui/renderer.php @@ -97,7 +97,9 @@ class core_backup_renderer extends plugin_renderer_base { $html .= html_writer::start_tag('div', array('class'=>'backup-section settings-section')); $html .= $this->output->heading(get_string('backupsettings', 'backup'), 2, array('class'=>'header')); foreach ($details->root_settings as $label=>$value) { - if ($label == 'filename') continue; + if ($label == 'filename' or $label == 'user_files') { + continue; + } $html .= $this->backup_detail_pair(get_string('rootsetting'.str_replace('_','',$label), 'backup'), $value?$yestick:$notick); } $html .= html_writer::end_tag('div'); diff --git a/lang/en/backup.php b/lang/en/backup.php index 0116d50c36f..a2cea189cbf 100644 --- a/lang/en/backup.php +++ b/lang/en/backup.php @@ -86,7 +86,6 @@ $string['configgeneralhistories'] = 'Sets the default for including user history $string['configgenerallogs'] = 'If enabled logs will be included in backups by default.'; $string['configgeneralroleassignments'] = 'If enabled by default roles assignments will also be backed up.'; $string['configgeneraluserscompletion'] = 'If enabled user completion information will be included in backups by default.'; -$string['configgeneraluserfiles'] = 'Sets the default for whether user files will be included in backups.'; $string['configgeneralusers'] = 'Sets the default for whether to include users in backups.'; $string['confirmcancel'] = 'Cancel backup'; $string['confirmcancelquestion'] = 'Are you sure you wish to cancel? @@ -127,7 +126,6 @@ $string['generalgradehistories'] = 'Include histories'; $string['generallogs'] = 'Include logs'; $string['generalroleassignments'] = 'Include role assignments'; $string['generaluserscompletion'] = 'Include user completion information'; -$string['generaluserfiles'] = 'Include user files'; $string['generalusers'] = 'Include users'; $string['importfile'] = 'Import a backup file'; $string['importbackupstage1action'] = 'Next'; @@ -200,7 +198,6 @@ $string['rootsettings'] = 'Backup settings'; $string['rootsettingusers'] = 'Include enrolled users'; $string['rootsettinganonymize'] = 'Anonymize user information'; $string['rootsettingroleassignments'] = 'Include user role assignments'; -$string['rootsettinguserfiles'] = 'Include user files'; $string['rootsettingactivities'] = 'Include activities'; $string['rootsettingblocks'] = 'Include blocks'; $string['rootsettingfilters'] = 'Include filters'; diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index df9b3f88060..8aa90d81c62 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -187,6 +187,15 @@ function xmldb_main_upgrade($oldversion) { upgrade_main_savepoint(true, 2012021700.02); } + // The ability to backup user (private) files is out completely - MDL-29248 + if ($oldversion < 2012030100.01) { + unset_config('backup_general_user_files', 'backup'); + unset_config('backup_general_user_files_locked', 'backup'); + unset_config('backup_auto_user_files', 'backup'); + + upgrade_main_savepoint(true, 2012030100.01); + } + return true; } diff --git a/version.php b/version.php index 52b1122b6a0..190f235d90f 100644 --- a/version.php +++ b/version.php @@ -30,7 +30,7 @@ defined('MOODLE_INTERNAL') || die(); -$version = 2012030100.00; // YYYYMMDD = weekly release date of this DEV branch +$version = 2012030100.01; // YYYYMMDD = weekly release date of this DEV branch // RR = release increments - 00 in DEV branches // .XX = incremental changes