Skip to content

Commit

Permalink
backup MDL-22142 P19 - Moved optional_param call for backupid out of …
Browse files Browse the repository at this point in the history
…load controller static method and into backup.php
  • Loading branch information
Sam Hemelryk committed May 2, 2010
1 parent f6ae3f0 commit 8c6d7f3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 5 additions & 1 deletion backup/backup.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
$courseid = required_param('id', PARAM_INT);
$sectionid = optional_param('section', null, PARAM_INT);
$cmid = optional_param('cm', null, PARAM_INT);
/**
* Part of the forms in stages after initial, is POST never GET
*/
$backupid = optional_param('backup', false, PARAM_ALPHANUM);

$url = new moodle_url('/backup/backup.php', array('id'=>$courseid));
if ($sectionid !== null) {
Expand Down Expand Up @@ -72,7 +76,7 @@
print_error('unknownbackuptype');
}

if (!($bc = backup_ui::load_controller())) {
if (!($bc = backup_ui::load_controller($backupid))) {
$bc = new backup_controller($type, $id, backup::FORMAT_MOODLE,
backup::INTERACTIVE_YES, backup::MODE_GENERAL, $USER->id);
}
Expand Down
3 changes: 1 addition & 2 deletions backup/util/ui/backup_ui.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -293,9 +293,8 @@ public function enforce_changed_dependencies() {
* Loads the backup controller if we are tracking one
* @return backup_controller|false
*/
final public static function load_controller() {
final public static function load_controller($backupid=false) {
// Get the backup id optional param
$backupid = optional_param('backup', false, PARAM_ALPHANUM);
if ($backupid) {
try {
// Try to load the controller with it.
Expand Down

0 comments on commit 8c6d7f3

Please sign in to comment.