From 3db241b342fdd1f445ef917afe5c8e3cad9e7fb9 Mon Sep 17 00:00:00 2001 From: dongsheng Date: Thu, 8 May 2008 06:27:28 +0000 Subject: [PATCH] "MDL-14129, fix print_error" --- admin/mnet/index.php | 2 +- auth/ldap/ntlmsso_attempt.php | 4 ++-- auth/ldap/ntlmsso_finish.php | 4 ++-- auth/mnet/auth.php | 6 +++--- auth/mnet/jump.php | 2 +- auth/mnet/land.php | 2 +- auth/shibboleth/login.php | 2 +- lang/en_utf8/error.php | 5 ++++- 8 files changed, 15 insertions(+), 12 deletions(-) diff --git a/admin/mnet/index.php b/admin/mnet/index.php index 65117677f4d..10e477c28d1 100644 --- a/admin/mnet/index.php +++ b/admin/mnet/index.php @@ -43,7 +43,7 @@ if (set_config('mnet_dispatcher_mode', $form->mode)) { redirect('index.php', get_string('changessaved')); } else { - print_error('Invalid action parameter.', '', 'index.php'); + print_error('invalidaction', '', 'index.php'); } } } elseif (!empty($form->submit) && $form->submit == get_string('delete')) { diff --git a/auth/ldap/ntlmsso_attempt.php b/auth/ldap/ntlmsso_attempt.php index 959f8dc6bf5..8f2325cf19c 100644 --- a/auth/ldap/ntlmsso_attempt.php +++ b/auth/ldap/ntlmsso_attempt.php @@ -7,7 +7,7 @@ httpsrequired(); /// Define variables used in page if (!$site = get_site()) { - print_error("No site found!"); + print_error("siteisnotdefined"); } $authsequence = get_enabled_auth_plugins(true); // auths, in sequence @@ -31,4 +31,4 @@ redirect($CFG->wwwroot . '/auth/ldap/ntlmsso_finish.php', $msg, 3); -?> \ No newline at end of file +?> diff --git a/auth/ldap/ntlmsso_finish.php b/auth/ldap/ntlmsso_finish.php index 92b22ee8e4d..1fdc5f43221 100644 --- a/auth/ldap/ntlmsso_finish.php +++ b/auth/ldap/ntlmsso_finish.php @@ -7,7 +7,7 @@ httpsrequired(); /// Define variables used in page if (!$site = get_site()) { - print_error("No site found!"); + print_error("siteisnotdefined", 'debug'); } $authsequence = get_enabled_auth_plugins(true); // auths, in sequence @@ -27,4 +27,4 @@ if (!$authplugin->ntlmsso_finish()) { redirect($CFG->wwwroot . '/login/index.php?authldap_skipntlmsso=1', get_string('ntlmsso_failed','auth'), 3); } -?> \ No newline at end of file +?> diff --git a/auth/mnet/auth.php b/auth/mnet/auth.php index 2381ca70fe8..9c001f1d1a5 100644 --- a/auth/mnet/auth.php +++ b/auth/mnet/auth.php @@ -62,7 +62,7 @@ class auth_plugin_mnet extends auth_plugin_base { * @return bool Authentication success or failure. */ function user_login($username, $password) { - return false; // print_error("Remote MNET users cannot login locally."); + return false; // print_error("mnetlocal"); } /** @@ -273,7 +273,7 @@ class auth_plugin_mnet extends auth_plugin_base { } $message .= "ERROR $code:
$errormessage
"; } - print_error("RPC auth/mnet/user_authorise:
$message"); + print_error("rpcerror", '', '', $message"); } unset($mnetrequest); @@ -372,7 +372,7 @@ class auth_plugin_mnet extends auth_plugin_base { if (!$bool) { // TODO: Jonathan to clean up mess // Actually, this should never happen (modulo race conditions) - ML - print_error("updating user failed in mnet/auth/confirm_mnet_session "); + print_error("cannotupdateuser"); } // set up the session diff --git a/auth/mnet/jump.php b/auth/mnet/jump.php index 2d03a6ba488..2504723de84 100644 --- a/auth/mnet/jump.php +++ b/auth/mnet/jump.php @@ -17,7 +17,7 @@ require_once dirname(dirname(dirname(__FILE__))) . '/config.php'; require_login(); if (!is_enabled_auth('mnet')) { - print_error('mnet is disabled'); + print_error('mnetdisable'); } // grab the GET params - wantsurl could be anything - take it diff --git a/auth/mnet/land.php b/auth/mnet/land.php index 3836d56e5ad..72e7f0a8024 100644 --- a/auth/mnet/land.php +++ b/auth/mnet/land.php @@ -20,7 +20,7 @@ if (!$site = get_site()) { } if (!is_enabled_auth('mnet')) { - print_error('mnet is disabled'); + print_error('mnetdisable'); } // grab the GET params $token = required_param('token', PARAM_BASE64); diff --git a/auth/shibboleth/login.php b/auth/shibboleth/login.php index e81b802224f..ff6de2dbf56 100644 --- a/auth/shibboleth/login.php +++ b/auth/shibboleth/login.php @@ -21,7 +21,7 @@ httpsrequired(); /// Define variables used in page if (!$site = get_site()) { - print_error("No site found!"); + print_error("siteisnotdefined", 'debug'); } if (empty($CFG->langmenu)) { diff --git a/lang/en_utf8/error.php b/lang/en_utf8/error.php index f6ce1d41adb..7aa9496c746 100644 --- a/lang/en_utf8/error.php +++ b/lang/en_utf8/error.php @@ -58,6 +58,7 @@ $string['cannotupdatecm'] = 'Could not update the course module with the correct $string['cannotupdatelevel'] = 'Could not update the indent level on that course module'; $string['cannotupdaterole'] = 'Cannot update role!'; $string['cannotupdatemod'] = 'Could not update the $a'; +$string['cannotupdateuser'] = 'updating user failed'; $stirng['cannotupdaterss'] = 'Cannot update rss'; $string['cannotupdatesummary'] = 'Could not update the summary!'; $string['cannotupdatesubcate'] = 'Could not update a child category!'; @@ -149,6 +150,8 @@ $string['missingfield'] = 'Field \"$a\" is missing.'; $string['missingrequiredfield'] = 'Some required field is missing'; $string['mimetexisnotexist'] = 'Your system is not configured to run mimeTeX. You need to download the appropriate executable for you PHP_OS platform from http://moodle.org/download/mimetex/, or obtain the C source from http://www.forkosh.com/mimetex.zip, compile it and put the executable into your moodle/filter/tex/ directory.'; $string['mimetexnotexecutable'] = 'Custom mimetex is not executable!'; +$string['mnetdisable'] = 'mnet is disabled'; +$string['mnetlocal'] = 'Remote MNET users cannot login locally.'; $string['moduledoesnotexist'] = 'This module does not exist'; $string['moduleinstancedoesnotexist'] = 'The instance of this module does not exist'; $string['moduledisable'] = 'This module ($a) has been disabled for this particular course'; @@ -187,7 +190,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['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';