Skip to content

Commit

Permalink
"MDL-14129, fix print_error calls"
Browse files Browse the repository at this point in the history
  • Loading branch information
dongsheng committed May 7, 2008
1 parent ba6018a commit f945d59
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion enrol/manual/enrol.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ function check_entry($form, $course) {
if (empty($course->password)) {
// do not allow entry when no course password set
// automatic login when manual primary, no login when secondary at all!!
print_error('illegal enrolment attempted');
print_error('invalidenrol');
}

$groupid = $this->check_group_entry($course->id, $form->password);
Expand Down
4 changes: 2 additions & 2 deletions enrol/mnet/enrol.php
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ function unenrol_user($user, $courseid) {
// require_capability('moodle/role:assign', $context, NULL, false);

if (!role_unassign(0, $userrecord->id, 0, $context->id)) {
print_error("An error occurred while trying to unenrol that person.");
print_error("unenrolerror");
}

return true;
Expand Down Expand Up @@ -500,7 +500,7 @@ function fetch_remote_courses($mnethostid) {
list($code, $errormessage) = array_map('trim',explode(':', $errormessage, 2));
$message .= "ERROR $code:<br/>$errormessage<br/>";
}
print_error("RPC enrol/mnet/available_courses:<br/>$message");
print_error("rpcerror", '', '', $message);
}
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion error/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

/// Work out who to send the message to
if (!$admin = get_admin() ) {
print_error('Could not find an admin user!');
print_error('cannotfindadmin', 'debug');
}

$supportuser = new object;
Expand Down
1 change: 1 addition & 0 deletions lang/en_utf8/debug.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
$string['cannotupdateversion'] = 'Upgrade failed! (Could not update version in config table)';
$string['cannotupdaterelease'] = 'ERROR: Could not update release version in database!!';
$string['cannotsetupsite'] = 'Serious Error! Could not set up the site!';
$string['cannotfindadmin'] = 'Could not find an admin user!';
$string['configmoodle'] = 'Moodle has not been configured yet. You need to edit config.php first.';
$string['dbnotinsert'] = 'Database error - Cannot insert ($a)';
$string['dbnotupdate'] = 'Database error - Cannot update ($a)';
Expand Down
2 changes: 2 additions & 0 deletions lang/en_utf8/error.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
$string['invalidcoursemodule'] = 'Invalid course module ID';
$string['invalidcontext'] = 'Invalid context';
$string['invaliddata'] = 'Data submitted is invalid.';
$string['invalidenrol'] = 'illegal enrolment attempted';
$string['invalidevent'] = 'Invalid event';
$string['invalidcoursenameshort'] = 'Invalid short course name';
$string['invalidevent'] = 'Invalid event';
Expand Down Expand Up @@ -186,6 +187,7 @@
$string['remotedownloaderror'] = 'Download of component to your server failed, please verify proxy settings, PHP cURL extension is highly recommended.<br /><br />You must download the <a href=\"$a->url\">$a->url</a> file manually, copy it to \"$a->dest\" in your server and unzip it there.';
$string['remotedownloadnotallowed'] = 'Download of components to your server isn\'t allowed (allow_url_fopen is disabled).<br /><br />You must download the <a href=\"$a->url\">$a->url</a> file manually, copy it to \"$a->dest\" in your server and unzip it there.';
$string['restricteduser'] = 'Sorry, but your current account \"$a\" is restricted from doing that.';
$string['rpcerror'] = 'RPC enrol/mnet/available_courses:<br/> ($a)';
$string['scheduledbackupsdisabled'] = 'Scheduled backups have been disabled by the server admin';
$string['sectionnotexist'] = 'This section does not exist';
$string['sendmessage'] = 'Send Message';
Expand Down

0 comments on commit f945d59

Please sign in to comment.