Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-29248 backup: take rid of the setting and code handling the 'priv…

…ate' user filearea
  • Loading branch information...
commit 4fda074e695f667f4800b25f2d6534d77fcff28e 1 parent 0d8ce6a
@stronk7 stronk7 authored
View
1  backup/converter/moodle1/handlerlib.php
@@ -441,7 +441,6 @@ public function on_root_element_end() {
'users' => 0, // @todo how to detect this from moodle.xml?
'anonymize' => 0,
'role_assignments' => 0,
- 'user_files' => 0,
'activities' => 1,
'blocks' => 1,
'filters' => 0,
View
2  backup/moodle2/backup_final_task.class.php
@@ -58,7 +58,7 @@ public function build() {
// 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)
View
7 backup/moodle2/backup_root_task.class.php
@@ -69,13 +69,6 @@ protected function define_settings() {
$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')));
View
7 backup/moodle2/backup_settingslib.php
@@ -70,13 +70,6 @@ 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
* exactly in the same way than @backup_anonymize_setting so we extend from it
*/
View
4 backup/moodle2/backup_stepslib.php
@@ -1759,10 +1759,6 @@ protected function define_execution() {
// 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'));
View
13 backup/moodle2/restore_root_task.class.php
@@ -117,19 +117,6 @@ protected function define_settings() {
$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;
View
7 backup/moodle2/restore_settingslib.php
@@ -45,13 +45,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)
* are dependent of this setting
View
2  backup/moodle2/restore_stepslib.php
@@ -683,7 +683,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());
}
}
View
6 backup/util/dbops/restore_dbops.class.php
@@ -730,7 +730,7 @@ public static function send_files_to_pool($basepath, $restoreid, $component, $fi
* 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 @@ public static function create_included_users($basepath, $restoreid, $userfiles,
// 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();
View
4 backup/util/ui/renderer.php
@@ -97,7 +97,9 @@ public function backup_details($details, $nextstageurl) {
$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');
View
1  lang/en/backup.php
@@ -197,7 +197,6 @@
$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';
Please sign in to comment.
Something went wrong with that request. Please try again.