From: donal72 Date: Thu, 11 Jan 2007 00:05:47 +0000 (+0000) Subject: Auth: Replace hardcoded strings: MDL-8069 X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=e8b9d76a3f3f8e2039aa1752e37fac08c654e8a6;p=moodle.git Auth: Replace hardcoded strings: MDL-8069 --- diff --git a/auth/imap/config.html b/auth/imap/config.html index 6ce0de0b79..658107675e 100644 --- a/auth/imap/config.html +++ b/auth/imap/config.html @@ -18,7 +18,7 @@ if (!isset($config->changepasswordurl)) { - + - + - + - + '; + notify(get_string('auth_ldap_noextension','auth')); } ?> diff --git a/lang/en_utf8/auth.php b/lang/en_utf8/auth.php index 5dfff34054..01fd52031c 100644 --- a/lang/en_utf8/auth.php +++ b/lang/en_utf8/auth.php @@ -112,6 +112,10 @@ $string['auth_imaphost'] = 'The IMAP server address. Use the IP number, not DNS $string['auth_imapport'] = 'IMAP server port number. Usually this is 143 or 993.'; $string['auth_imaptitle'] = 'Use an IMAP server'; $string['auth_imaptype'] = 'The IMAP server type. IMAP servers can have different types of authentication and negotiation.'; +$string['auth_imaptype_key'] = 'Type'; +$string['auth_imaphost_key'] = 'Host'; +$string['auth_imapport_key'] = 'Port'; +$string['auth_imapchangepasswordurl_key'] = 'Password-change URL'; // LDAP plugin $string['auth_ldap_bind_dn'] = 'If you want to use bind-user to search users, specify it here. Something like \'cn=ldapuser,ou=public,o=org\''; @@ -169,6 +173,12 @@ $string['auth_ldap_gracelogin_key'] = 'Grace login attribute'; $string['auth_ldap_auth_user_create_key'] = 'Create users externally'; $string['auth_ldap_create_context_key'] = 'Context for new users'; $string['auth_ldap_creators_key'] = 'Creators'; +$string['auth_ldap_noconnect'] = 'LDAP-module cannot connect to server: $a'; +$string['auth_ldap_noconnect_all'] = 'LDAP-module cannot connect to any servers: $a'; +$string['auth_ldap_unsupportedusertype'] = 'auth: ldap user_create() does not support selected usertype:"$a" (..yet)'; +$string['auth_ldap_usertypeundefined'] = 'config.user_type not defined or function ldap_expirationtime2unix does not support selected type!'; +$string['auth_ldap_usertypeundefined2'] = 'config.user_type not defined or function ldap_unixi2expirationtime does not support selected type!'; +$string['auth_ldap_noextension'] = 'Warning: The PHP LDAP module does not seem to be present. Please ensure it is installed and enabled.'; $string['auth_ldapextrafields'] = 'These fields are optional. You can choose to pre-fill some Moodle user fields with information from the LDAP fields that you specify here.

If you leave these fields blank, then nothing will be transferred from LDAP and Moodle defaults will be used instead.

In either case, the user will be able to edit all of these fields after they log in.

'; $string['auth_ldaptitle'] = 'Use an LDAP server';
host: : changepasswordurl)) {
type: : changepasswordurl)) {
port: : changepasswordurl)) {
changepasswordurl: : config->host_url"); + print_error('auth_ldap_noconnect','auth',$this->config->host_url); } return false; } @@ -249,7 +249,7 @@ class auth_plugin_ldap { $newuser['userpassword']=$plainpass; break; default: - error('auth: ldap user_create() does not support selected usertype:"'.$this->config->user_type.'" (..yet)'); + print_error('auth_ldap_unsupportedusertype','auth',$this->config->user_type); } $uadd = $this->ldap_add($ldapconnection, "{$this->config->user_attribute}={$userobject->username},{$this->config->create_context}", $newuser); ldap_close($ldapconnection); @@ -428,7 +428,7 @@ class auth_plugin_ldap { if (!$ldapconnection) { @ldap_close($ldapconnection); - notify("LDAP-module cannot connect to server: $CFG->ldap_host_url"); + notify(get_string('auth_ldap_noconnect','auth',$this->config->host_url)); return false; } @@ -1224,7 +1224,7 @@ class auth_plugin_ldap { $result = $time * DAYSECS; //The shadowExpire contains the number of DAYS between 01/01/1970 and the actual expiration date break; default: - error('config.user_type not defined or function ldap_expirationtime2unix does not support selected type!'); + print_error('auth_ldap_usertypeundefined', 'auth'); } return $result; } @@ -1245,7 +1245,7 @@ class auth_plugin_ldap { $result = $time ; //Already in correct format break; default: - error('config.user_type not defined or function ldap_unixi2expirationtime does not support selected type!'); + print_error('auth_ldap_usertypeundefined2', 'auth'); } return $result; @@ -1366,7 +1366,7 @@ class auth_plugin_ldap { } //If any of servers are alive we have already returned connection - error("LDAP-module cannot connect any LDAP servers : $debuginfo"); + print_error('auth_ldap_noconnect_all','auth',$this->config->user_type); return false; } diff --git a/auth/ldap/config.html b/auth/ldap/config.html index 42b80f6aae..8b946ed71e 100644 --- a/auth/ldap/config.html +++ b/auth/ldap/config.html @@ -54,9 +54,7 @@ $yesno = array( get_string('no'), get_string('yes') ); if (!function_exists('ldap_connect')) { // Is php4-ldap really there? - print '

Warning: - The PHP LDAP module does not seem to be present. - Please ensure it is installed and enabled.