MDL-34859 backup: add restore defaults

This commit is contained in:
Marina Glancy
2017-03-20 14:59:45 +08:00
parent f840bf03e0
commit 44e86fb3d5
15 changed files with 535 additions and 45 deletions
@@ -142,6 +142,9 @@ class restore_controller extends base_controller {
// Load plan
$this->load_plan();
// Apply all default settings (based on type/format/mode).
$this->apply_defaults();
// Perform all initial security checks and apply (2nd param) them to settings automatically
restore_check::check_security($this, true);
@@ -510,6 +513,15 @@ class restore_controller extends base_controller {
$this->plan->build(); // Build plan for this controller
$this->set_status(backup::STATUS_PLANNED);
}
/**
* Apply defaults from the global admin settings
*/
protected function apply_defaults() {
$this->log('applying restore defaults', backup::LOG_DEBUG);
restore_controller_dbops::apply_config_defaults($this);
$this->set_status(backup::STATUS_CONFIGURED);
}
}
/*