Skip to content

Commit

Permalink
Merge branch 'MDL-48010' of git://github.com/timhunt/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
Damyon Wiese committed Nov 3, 2014
2 parents 1993cc0 + f9476f4 commit ac87cab
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
14 changes: 7 additions & 7 deletions grade/import/xml/import.php
Expand Up @@ -19,11 +19,11 @@
require_once 'lib.php';
require_once $CFG->libdir.'/filelib.php';

$url = required_param('url', PARAM_URL); // only real urls here
$gradesurl = required_param('url', PARAM_URL); // only real urls here
$id = required_param('id', PARAM_INT); // course id
$feedback = optional_param('feedback', 0, PARAM_BOOL);

$url = new moodle_url('/grade/import/xml/import.php', array('id'=>$id,'url'=>$url));
$url = new moodle_url('/grade/import/xml/import.php', array('id' => $id,'url' => $gradesurl));
if ($feedback !== 0) {
$url->param('feedback', $feedback);
}
Expand All @@ -46,9 +46,10 @@
core_php_time_limit::raise();
raise_memory_limit(MEMORY_EXTRA);

$text = download_file_content($url);
$text = download_file_content($gradesurl);
if ($text === false) {
print_error('cannotreadfile');
print_error('cannotreadfile', 'error',
$CFG->wwwroot . '/grade/import/xml/index.php?id=' . $id, $gradesurl);
}

$error = '';
Expand All @@ -75,7 +76,6 @@
}

} else {
print_error('error', 'gradeimport_xml');
print_error('errorduringimport', 'gradeimport_xml',
$CFG->wwwroot . '/grade/import/xml/index.php?id=' . $id, $error);
}


1 change: 1 addition & 0 deletions grade/import/xml/lang/en/gradeimport_xml.php
Expand Up @@ -30,6 +30,7 @@
$string['errincorrectidnumber'] = 'Error - incorrect idnumber';
$string['errincorrectuseridnumber'] = 'Error - idnumber \'{$a}\' from the import file does not match any user.';
$string['error'] = 'Errors occur';
$string['errorduringimport'] = 'An error occurred when trying to import: {$a}';
$string['fileurl'] = 'Remote file URL';
$string['pluginname'] = 'XML file';
$string['xml:publish'] = 'Publish import grades from XML';
Expand Down

0 comments on commit ac87cab

Please sign in to comment.