]> git.mjollnir.org Git - moodle.git/commitdiff
"MDL-14129, fix print_error calls"
authordongsheng <dongsheng>
Wed, 7 May 2008 06:19:59 +0000 (06:19 +0000)
committerdongsheng <dongsheng>
Wed, 7 May 2008 06:19:59 +0000 (06:19 +0000)
enrol/manual/enrol.php
enrol/mnet/enrol.php
error/index.php
lang/en_utf8/debug.php
lang/en_utf8/error.php

index 1081db5ea35df089df5a9da770bc7895485f4366..c71bf047f708a9dfc72352a4e2e55e3bf46bdabc 100644 (file)
@@ -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);
index dcb6f639a8b0ad8130da6cd54b4bbd22e26acf50..d98a97607b809594d68d26fd02f4f5bd2e37170e 100644 (file)
@@ -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:<br/>$errormessage<br/>";
             }
-            print_error("RPC enrol/mnet/available_courses:<br/>$message");
+            print_error("rpcerror", '', '', $message);
         }
         return false;
     }
index 602d0fef1bc2348bd493d201261b6e5962146ca2..02865a5a206429bb2c8d9d9f78e664454162e631 100644 (file)
@@ -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;
index e148f4f7486bc8c05888e2a084c7587ce814833c..9369db2c8aaa4b1dc517fdb3f1a77c6548aa2cac 100644 (file)
@@ -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)';
index a944754f6f30ec705e39b47151f9e686c4ec15a3..f6ce1d41adbbc75cd01d9a2572f8bb411175e113 100644 (file)
@@ -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.<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';