Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge branch 'MDL-29248_21' of git://github.com/stronk7/moodle into M…

…OODLE_21_STABLE
  • Loading branch information...
commit 33bd4e0455eb5a9bde398e8d78c9c9081121d7d7 2 parents 85d555e + 4fda074
Sam Hemelryk samhemelryk authored
2  admin/settings/courses.php
@@ -97,7 +97,6 @@
97 97 $temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_users', get_string('generalusers','backup'), get_string('configgeneralusers','backup'), array('value'=>1, 'locked'=>0)));
98 98 $temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_anonymize', get_string('generalanonymize','backup'), get_string('configgeneralanonymize','backup'), array('value'=>0, 'locked'=>0)));
99 99 $temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_role_assignments', get_string('generalroleassignments','backup'), get_string('configgeneralroleassignments','backup'), array('value'=>1, 'locked'=>0)));
100   - $temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_user_files', get_string('generaluserfiles','backup'), get_string('configgeneraluserfiles','backup'), array('value'=>1, 'locked'=>0)));
101 100 $temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_activities', get_string('generalactivities','backup'), get_string('configgeneralactivities','backup'), array('value'=>1, 'locked'=>0)));
102 101 $temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_blocks', get_string('generalblocks','backup'), get_string('configgeneralblocks','backup'), array('value'=>1, 'locked'=>0)));
103 102 $temp->add(new admin_setting_configcheckbox_with_lock('backup/backup_general_filters', get_string('generalfilters','backup'), get_string('configgeneralfilters','backup'), array('value'=>1, 'locked'=>0)));
@@ -144,7 +143,6 @@
144 143 $temp->add(new admin_setting_heading('automatedsettings', get_string('automatedsettings','backup'), ''));
145 144 $temp->add(new admin_setting_configcheckbox('backup/backup_auto_users', get_string('generalusers', 'backup'), get_string('configgeneralusers', 'backup'), 1));
146 145 $temp->add(new admin_setting_configcheckbox('backup/backup_auto_role_assignments', get_string('generalroleassignments','backup'), get_string('configgeneralroleassignments','backup'), 1));
147   - $temp->add(new admin_setting_configcheckbox('backup/backup_auto_user_files', get_string('generaluserfiles', 'backup'), get_string('configgeneraluserfiles','backup'), 1));
148 146 $temp->add(new admin_setting_configcheckbox('backup/backup_auto_activities', get_string('generalactivities','backup'), get_string('configgeneralactivities','backup'), 1));
149 147 $temp->add(new admin_setting_configcheckbox('backup/backup_auto_blocks', get_string('generalblocks','backup'), get_string('configgeneralblocks','backup'), 1));
150 148 $temp->add(new admin_setting_configcheckbox('backup/backup_auto_filters', get_string('generalfilters','backup'), get_string('configgeneralfilters','backup'), 1));
1  backup/converter/moodle1/handlerlib.php
@@ -441,7 +441,6 @@ public function on_root_element_end() {
441 441 'users' => 0, // @todo how to detect this from moodle.xml?
442 442 'anonymize' => 0,
443 443 'role_assignments' => 0,
444   - 'user_files' => 0,
445 444 'activities' => 1,
446 445 'blocks' => 1,
447 446 'filters' => 0,
2  backup/moodle2/backup_final_task.class.php
@@ -58,7 +58,7 @@ public function build() {
58 58 // done in a single pass
59 59 $this->add_step(new backup_annotate_all_question_files('question_files'));
60 60
61   - // Annotate all the user files (conditionally) (private, profile and icon files)
  61 + // Annotate all the user files (conditionally) (profile and icon files)
62 62 // Because each user has its own context, we need a separate/specialised step here
63 63 // This step also ensures that the contexts for all the users exist, so next
64 64 // step can be safely executed (join between users and contexts)
7 backup/moodle2/backup_root_task.class.php
@@ -69,13 +69,6 @@ protected function define_settings() {
69 69 $this->add_setting($roleassignments);
70 70 $users->add_dependency($roleassignments);
71 71
72   - // Define user_files (dependent of users and anonymize)
73   - $userfiles = new backup_user_files_setting('user_files', base_setting::IS_BOOLEAN, true);
74   - $userfiles->set_ui(new backup_setting_ui_checkbox($userfiles, get_string('rootsettinguserfiles', 'backup')));
75   - $this->add_setting($userfiles);
76   - $users->add_dependency($userfiles);
77   - $anonymize->add_dependency($userfiles, setting_dependency::DISABLED_TRUE);
78   -
79 72 // Define activities
80 73 $activities = new backup_activities_setting('activities', base_setting::IS_BOOLEAN, true);
81 74 $activities->set_ui(new backup_setting_ui_checkbox($activities, get_string('rootsettingactivities', 'backup')));
7 backup/moodle2/backup_settingslib.php
@@ -70,13 +70,6 @@ class backup_anonymize_setting extends root_backup_setting {}
70 70
71 71 /**
72 72 * root setting to control if backup will include
73   - * user files or no (images, local storage), depends of @backup_users_setting
74   - * exactly in the same way than @backup_anonymize_setting so we extend from it
75   - */
76   -class backup_user_files_setting extends backup_anonymize_setting {}
77   -
78   -/**
79   - * root setting to control if backup will include
80 73 * role assignments or no (any level), depends of @backup_users_setting
81 74 * exactly in the same way than @backup_anonymize_setting so we extend from it
82 75 */
4 backup/moodle2/backup_stepslib.php
@@ -1759,10 +1759,6 @@ protected function define_execution() {
1759 1759 // List of fileareas we are going to annotate
1760 1760 $fileareas = array('profile', 'icon');
1761 1761
1762   - if ($this->get_setting_value('user_files')) { // private files only if enabled in settings
1763   - $fileareas[] = 'private';
1764   - }
1765   -
1766 1762 // Fetch all annotated (final) users
1767 1763 $rs = $DB->get_recordset('backup_ids_temp', array(
1768 1764 'backupid' => $this->get_backupid(), 'itemname' => 'userfinal'));
13 backup/moodle2/restore_root_task.class.php
@@ -117,19 +117,6 @@ protected function define_settings() {
117 117 $this->add_setting($roleassignments);
118 118 $users->add_dependency($roleassignments);
119 119
120   - // Define user_files (dependent of users)
121   - $defaultvalue = false; // Safer default
122   - $changeable = false;
123   - if (isset($rootsettings['user_files']) && $rootsettings['user_files']) { // Only enabled when available
124   - $defaultvalue = true;
125   - $changeable = true;
126   - }
127   - $userfiles = new restore_user_files_setting('user_files', base_setting::IS_BOOLEAN, $defaultvalue);
128   - $userfiles->set_ui(new backup_setting_ui_checkbox($userfiles, get_string('rootsettinguserfiles', 'backup')));
129   - $userfiles->get_ui()->set_changeable($changeable);
130   - $this->add_setting($userfiles);
131   - $users->add_dependency($userfiles);
132   -
133 120 // Define activitites
134 121 $defaultvalue = false; // Safer default
135 122 $changeable = false;
7 backup/moodle2/restore_settingslib.php
@@ -45,13 +45,6 @@ class restore_users_setting extends restore_generic_setting {}
45 45 class restore_role_assignments_setting extends root_backup_setting {}
46 46
47 47 /**
48   - * root setting to control if restore will create
49   - * user files or no (images, local storage), depends of @restore_users_setting
50   - * exactly in the same way than @restore_role_assignments_setting so we extend from it
51   - */
52   -class restore_user_files_setting extends restore_role_assignments_setting {}
53   -
54   -/**
55 48 * root setting to control if restore will create activities
56 49 * A lot of other settings (_included at activity levels)
57 50 * are dependent of this setting
2  backup/moodle2/restore_stepslib.php
@@ -683,7 +683,7 @@ class restore_create_included_users extends restore_execution_step {
683 683
684 684 protected function define_execution() {
685 685
686   - restore_dbops::create_included_users($this->get_basepath(), $this->get_restoreid(), $this->get_setting_value('user_files'), $this->task->get_userid());
  686 + restore_dbops::create_included_users($this->get_basepath(), $this->get_restoreid(), $this->task->get_userid());
687 687 }
688 688 }
689 689
1  backup/util/dbops/backup_controller_dbops.class.php
@@ -440,7 +440,6 @@ private static function apply_general_config_defaults(backup_controller $control
440 440 'backup_general_users' => 'users',
441 441 'backup_general_anonymize' => 'anonymize',
442 442 'backup_general_role_assignments' => 'role_assignments',
443   - 'backup_general_user_files' => 'user_files',
444 443 'backup_general_activities' => 'activities',
445 444 'backup_general_blocks' => 'blocks',
446 445 'backup_general_filters' => 'filters',
6 backup/util/dbops/restore_dbops.class.php
@@ -730,7 +730,7 @@ public static function send_files_to_pool($basepath, $restoreid, $component, $fi
730 730 * ready to be created. Also, annotate their newids
731 731 * once created for later reference
732 732 */
733   - public static function create_included_users($basepath, $restoreid, $userfiles, $userid) {
  733 + public static function create_included_users($basepath, $restoreid, $userid) {
734 734 global $CFG, $DB;
735 735
736 736 $authcache = array(); // Cache to get some bits from authentication plugins
@@ -871,10 +871,6 @@ public static function create_included_users($basepath, $restoreid, $userfiles,
871 871 // Create user files in pool (profile, icon, private) by context
872 872 restore_dbops::send_files_to_pool($basepath, $restoreid, 'user', 'icon', $recuser->parentitemid, $userid);
873 873 restore_dbops::send_files_to_pool($basepath, $restoreid, 'user', 'profile', $recuser->parentitemid, $userid);
874   - if ($userfiles) { // private files only if enabled in settings
875   - restore_dbops::send_files_to_pool($basepath, $restoreid, 'user', 'private', $recuser->parentitemid, $userid);
876   - }
877   -
878 874 }
879 875 }
880 876 $rs->close();
1  backup/util/helper/backup_cron_helper.class.php
@@ -323,7 +323,6 @@ public static function launch_automated_backup($course, $starttime, $userid) {
323 323 $settings = array(
324 324 'users' => 'backup_auto_users',
325 325 'role_assignments' => 'backup_auto_role_assignments',
326   - 'user_files' => 'backup_auto_user_files',
327 326 'activities' => 'backup_auto_activities',
328 327 'blocks' => 'backup_auto_blocks',
329 328 'filters' => 'backup_auto_filters',
4 backup/util/ui/renderer.php
@@ -97,7 +97,9 @@ public function backup_details($details, $nextstageurl) {
97 97 $html .= html_writer::start_tag('div', array('class'=>'backup-section settings-section'));
98 98 $html .= $this->output->heading(get_string('backupsettings', 'backup'), 2, array('class'=>'header'));
99 99 foreach ($details->root_settings as $label=>$value) {
100   - if ($label == 'filename') continue;
  100 + if ($label == 'filename' or $label == 'user_files') {
  101 + continue;
  102 + }
101 103 $html .= $this->backup_detail_pair(get_string('rootsetting'.str_replace('_','',$label), 'backup'), $value?$yestick:$notick);
102 104 }
103 105 $html .= html_writer::end_tag('div');
3  lang/en/backup.php
@@ -85,7 +85,6 @@
85 85 $string['configgenerallogs'] = 'If enabled logs will be included in backups by default.';
86 86 $string['configgeneralroleassignments'] = 'If enabled by default roles assignments will also be backed up.';
87 87 $string['configgeneraluserscompletion'] = 'If enabled user completion information will be included in backups by default.';
88   -$string['configgeneraluserfiles'] = 'Sets the default for whether user files will be included in backups.';
89 88 $string['configgeneralusers'] = 'Sets the default for whether to include users in backups.';
90 89 $string['confirmcancel'] = 'Cancel backup';
91 90 $string['confirmcancelquestion'] = 'Are you sure you wish to cancel?
@@ -126,7 +125,6 @@
126 125 $string['generallogs'] = 'Include logs';
127 126 $string['generalroleassignments'] = 'Include role assignments';
128 127 $string['generaluserscompletion'] = 'Include user completion information';
129   -$string['generaluserfiles'] = 'Include user files';
130 128 $string['generalusers'] = 'Include users';
131 129 $string['importfile'] = 'Import a backup file';
132 130 $string['importbackupstage1action'] = 'Next';
@@ -199,7 +197,6 @@
199 197 $string['rootsettingusers'] = 'Include enrolled users';
200 198 $string['rootsettinganonymize'] = 'Anonymize user information';
201 199 $string['rootsettingroleassignments'] = 'Include user role assignments';
202   -$string['rootsettinguserfiles'] = 'Include user files';
203 200 $string['rootsettingactivities'] = 'Include activities';
204 201 $string['rootsettingblocks'] = 'Include blocks';
205 202 $string['rootsettingfilters'] = 'Include filters';
9 lib/db/upgrade.php
@@ -6753,6 +6753,15 @@ function xmldb_main_upgrade($oldversion) {
6753 6753 upgrade_main_savepoint(true, 2011070104.09);
6754 6754 }
6755 6755
  6756 + // The ability to backup user (private) files is out completely - MDL-29248
  6757 + if ($oldversion < 2011070104.12) {
  6758 + unset_config('backup_general_user_files', 'backup');
  6759 + unset_config('backup_general_user_files_locked', 'backup');
  6760 + unset_config('backup_auto_user_files', 'backup');
  6761 +
  6762 + upgrade_main_savepoint(true, 2011070104.12);
  6763 + }
  6764 +
6756 6765 return true;
6757 6766 }
6758 6767
2  version.php
@@ -30,7 +30,7 @@
30 30 defined('MOODLE_INTERNAL') || die();
31 31
32 32
33   -$version = 2011070104.11; // 20110701 = branching date YYYYMMDD - do not modify!
  33 +$version = 2011070104.12; // 20110701 = branching date YYYYMMDD - do not modify!
34 34 // RR = release increments - 00 in DEV branches
35 35 // .XX = incremental changes
36 36

0 comments on commit 33bd4e0

Please sign in to comment.
Something went wrong with that request. Please try again.