Skip to content

Commit

Permalink
Merge branch 'MDL-29248_21' of git://github.com/stronk7/moodle into M…
Browse files Browse the repository at this point in the history
…OODLE_21_STABLE
  • Loading branch information
Sam Hemelryk committed Mar 5, 2012
2 parents 85d555e + 4fda074 commit 33bd4e0
Show file tree
Hide file tree
Showing 16 changed files with 16 additions and 55 deletions.
2 changes: 0 additions & 2 deletions admin/settings/courses.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@
$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)));
$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)));
$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)));
$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)));
$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)));
$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)));
$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)));
Expand Down Expand Up @@ -144,7 +143,6 @@
$temp->add(new admin_setting_heading('automatedsettings', get_string('automatedsettings','backup'), ''));
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_users', get_string('generalusers', 'backup'), get_string('configgeneralusers', 'backup'), 1));
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_role_assignments', get_string('generalroleassignments','backup'), get_string('configgeneralroleassignments','backup'), 1));
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_user_files', get_string('generaluserfiles', 'backup'), get_string('configgeneraluserfiles','backup'), 1));
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_activities', get_string('generalactivities','backup'), get_string('configgeneralactivities','backup'), 1));
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_blocks', get_string('generalblocks','backup'), get_string('configgeneralblocks','backup'), 1));
$temp->add(new admin_setting_configcheckbox('backup/backup_auto_filters', get_string('generalfilters','backup'), get_string('configgeneralfilters','backup'), 1));
Expand Down
1 change: 0 additions & 1 deletion backup/converter/moodle1/handlerlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion backup/moodle2/backup_final_task.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 0 additions & 7 deletions backup/moodle2/backup_root_task.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')));
Expand Down
7 changes: 0 additions & 7 deletions backup/moodle2/backup_settingslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,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
Expand Down
4 changes: 0 additions & 4 deletions backup/moodle2/backup_stepslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
Expand Down
13 changes: 0 additions & 13 deletions backup/moodle2/restore_root_task.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 0 additions & 7 deletions backup/moodle2/restore_settingslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,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)
Expand Down
2 changes: 1 addition & 1 deletion backup/moodle2/restore_stepslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}

Expand Down
1 change: 0 additions & 1 deletion backup/util/dbops/backup_controller_dbops.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,6 @@ private static function apply_general_config_defaults(backup_controller $control
'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',
Expand Down
6 changes: 1 addition & 5 deletions backup/util/dbops/restore_dbops.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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();
Expand Down
1 change: 0 additions & 1 deletion backup/util/helper/backup_cron_helper.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,6 @@ public static function launch_automated_backup($course, $starttime, $userid) {
$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',
Expand Down
4 changes: 3 additions & 1 deletion backup/util/ui/renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
3 changes: 0 additions & 3 deletions lang/en/backup.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@
$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?
Expand Down Expand Up @@ -126,7 +125,6 @@
$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';
Expand Down Expand Up @@ -199,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';
Expand Down
9 changes: 9 additions & 0 deletions lib/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6753,6 +6753,15 @@ function xmldb_main_upgrade($oldversion) {
upgrade_main_savepoint(true, 2011070104.09);
}

// The ability to backup user (private) files is out completely - MDL-29248
if ($oldversion < 2011070104.12) {
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, 2011070104.12);
}

return true;
}

2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
defined('MOODLE_INTERNAL') || die();


$version = 2011070104.11; // 20110701 = branching date YYYYMMDD - do not modify!
$version = 2011070104.12; // 20110701 = branching date YYYYMMDD - do not modify!
// RR = release increments - 00 in DEV branches
// .XX = incremental changes

Expand Down

0 comments on commit 33bd4e0

Please sign in to comment.