From f945d59b8f2cea83f88b8d1b55b6bd8f11c22e42 Mon Sep 17 00:00:00 2001 From: dongsheng Date: Wed, 7 May 2008 06:19:59 +0000 Subject: [PATCH] "MDL-14129, fix print_error calls" --- enrol/manual/enrol.php | 2 +- enrol/mnet/enrol.php | 4 ++-- error/index.php | 2 +- lang/en_utf8/debug.php | 1 + lang/en_utf8/error.php | 2 ++ 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/enrol/manual/enrol.php b/enrol/manual/enrol.php index 1081db5ea3..c71bf047f7 100644 --- a/enrol/manual/enrol.php +++ b/enrol/manual/enrol.php @@ -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); diff --git a/enrol/mnet/enrol.php b/enrol/mnet/enrol.php index dcb6f639a8..d98a97607b 100644 --- a/enrol/mnet/enrol.php +++ b/enrol/mnet/enrol.php @@ -363,7 +363,7 @@ class enrolment_plugin_mnet { // 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; @@ -500,7 +500,7 @@ class enrolment_plugin_mnet { list($code, $errormessage) = array_map('trim',explode(':', $errormessage, 2)); $message .= "ERROR $code:
$errormessage
"; } - print_error("RPC enrol/mnet/available_courses:
$message"); + print_error("rpcerror", '', '', $message); } return false; } diff --git a/error/index.php b/error/index.php index 602d0fef1b..02865a5a20 100644 --- a/error/index.php +++ b/error/index.php @@ -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; diff --git a/lang/en_utf8/debug.php b/lang/en_utf8/debug.php index e148f4f748..9369db2c8a 100644 --- a/lang/en_utf8/debug.php +++ b/lang/en_utf8/debug.php @@ -6,6 +6,7 @@ $string['cannotupgradecapabilities'] = 'Had trouble upgrading the core capabilit $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)'; diff --git a/lang/en_utf8/error.php b/lang/en_utf8/error.php index a944754f6f..f6ce1d41ad 100644 --- a/lang/en_utf8/error.php +++ b/lang/en_utf8/error.php @@ -111,6 +111,7 @@ $string['invalidcourseid'] = 'You are tring to use an invalid course ID: ($a)'; $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'; @@ -186,6 +187,7 @@ $string['processingstops'] = 'Processing stops here. Remaining records ignored.' $string['remotedownloaderror'] = 'Download of component to your server failed, please verify proxy settings, PHP cURL extension is highly recommended.

You must download the url\">$a->url 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).

You must download the url\">$a->url 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:
($a)'; $string['scheduledbackupsdisabled'] = 'Scheduled backups have been disabled by the server admin'; $string['sectionnotexist'] = 'This section does not exist'; $string['sendmessage'] = 'Send Message'; -- 2.39.5