Skip to content

Commit

Permalink
"MDL-14129, fix print_error"
Browse files Browse the repository at this point in the history
  • Loading branch information
dongsheng committed May 14, 2008
1 parent 8337d39 commit 9b6a1a4
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions grade/export/key.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,22 @@

if ($id) {
if (!$key = get_record('user_private_key', 'id', $id)) {
print_error('Group ID was incorrect');
print_error('invalidgroupid');
}
if (empty($courseid)) {
$courseid = $key->instance;

} else if ($courseid != $key->instance) {
print_error('Course ID was incorrect');
print_error('invalidcourseid');
}

if (!$course = get_record('course', 'id', $courseid)) {
print_error('Course ID was incorrect');
print_error('invalidcourseid');
}

} else {
if (!$course = get_record('course', 'id', $courseid)) {
print_error('Course ID was incorrect');
print_error('invalidcourseid');
}
$key = new object();
}
Expand All @@ -62,7 +62,7 @@

// extra security check
if (!empty($key->userid) and $USER->id != $key->userid) {
print_error('You are not owner of this key');
print_error('notownerofkey');
}

$returnurl = $CFG->wwwroot.'/grade/export/keymanager.php?id='.$course->id;
Expand Down
2 changes: 1 addition & 1 deletion grade/export/ods/dump.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
require_user_key_login('grade/export', $id); // we want different keys for each course

if (empty($CFG->gradepublishing)) {
print_error('Grade publishing disabled');
print_error('gradepubdisable');
}

$context = get_context_instance(CONTEXT_COURSE, $id);
Expand Down
2 changes: 1 addition & 1 deletion grade/export/txt/dump.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
require_user_key_login('grade/export', $id); // we want different keys for each course

if (empty($CFG->gradepublishing)) {
print_error('Grade publishing disabled');
print_error('gradepubdisable');
}

$context = get_context_instance(CONTEXT_COURSE, $id);
Expand Down
2 changes: 1 addition & 1 deletion grade/export/xls/dump.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
require_user_key_login('grade/export', $id); // we want different keys for each course

if (empty($CFG->gradepublishing)) {
print_error('Grade publishing disabled');
print_error('gradepubdisable');
}

$context = get_context_instance(CONTEXT_COURSE, $id);
Expand Down
2 changes: 1 addition & 1 deletion grade/export/xml/dump.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
require_user_key_login('grade/export', $id); // we want different keys for each course

if (empty($CFG->gradepublishing)) {
print_error('Grade publishing disabled');
print_error('gradepubdisable');
}

$context = get_context_instance(CONTEXT_COURSE, $id);
Expand Down
2 changes: 1 addition & 1 deletion grade/export/xml/grade_export_xml.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function print_grades($feedback = false) {
make_upload_directory('temp/gradeexport', false);
$tempfilename = $CFG->dataroot .'/temp/gradeexport/'. md5(sesskey().microtime().$downloadfilename);
if (!$handle = fopen($tempfilename, 'w+b')) {
print_error("Could not create a temporary file into which to dump the XML data.");
print_error('cannotcreatetempdir');
return false;
}

Expand Down

0 comments on commit 9b6a1a4

Please sign in to comment.