]> git.mjollnir.org Git - moodle.git/commitdiff
Auth: Replace hardcoded strings: MDL-8069
authordonal72 <donal72>
Thu, 11 Jan 2007 00:05:47 +0000 (00:05 +0000)
committerdonal72 <donal72>
Thu, 11 Jan 2007 00:05:47 +0000 (00:05 +0000)
auth/imap/config.html
auth/ldap/auth.php
auth/ldap/config.html
lang/en_utf8/auth.php

index 6ce0de0b79719cf4708be9fe10c2af712b378488..658107675ef90c2fd354cf5e4c756875355b4000 100644 (file)
@@ -18,7 +18,7 @@ if (!isset($config->changepasswordurl)) {
 <table cellspacing="0" cellpadding="5" border="0" align="center">
 
 <tr valign="top" class="required">
-    <td align="right"> host: </td>
+    <td align="right"><?php print_string('auth_imaphost_key', 'auth') ?>: </td>
     <td>
         <input name="host" type="text" size="30" value="<?php echo $config->host ?>" />
         <?php
@@ -40,7 +40,7 @@ if (!isset($config->changepasswordurl)) {
 </tr>
 
 <tr valign="top" class="required">
-    <td align="right"> type: </td>
+    <td align="right"><?php print_string('auth_imaptype_key', 'auth') ?>: </td>
     <td>
         <?php
 
@@ -56,7 +56,7 @@ if (!isset($config->changepasswordurl)) {
 </tr>
 
 <tr valign="top" class="required">
-    <td align="right"> port: </td>
+    <td align="right"><?php print_string('auth_imapport_key', 'auth') ?>: </td>
     <td>
         <input name="port" type="text" size="6" value="<?php echo $config->port ?>" />
         <?php
@@ -71,7 +71,7 @@ if (!isset($config->changepasswordurl)) {
 </tr>
 
 <tr valign="top">
-    <td align="right"> changepasswordurl: </td>
+    <td align="right"><?php print_string('auth_imapchangepasswordurl_key', 'auth') ?>: </td>
     <td>
         <input name="changepasswordurl" type="text" value="<?php echo $config->changepasswordurl ?>" />
         <?php
index 9187e7a8b516a16c0d36974d1fbbd30a32868424..301a580039d6cb8800fb1b781004d94f4fb66cd8 100644 (file)
@@ -82,7 +82,7 @@ class auth_plugin_ldap {
         }
         else {
             @ldap_close($ldapconnection);
-            error("LDAP-module cannot connect to server: $this->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;
     }
 
index 42b80f6aae0964608f068bf3a3e4c5da7dd1df2f..8b946ed71ef6f183886ef73cbd38742847aac24b 100644 (file)
@@ -54,9 +54,7 @@
     $yesno = array( get_string('no'), get_string('yes') );
     
 if (!function_exists('ldap_connect')) { // Is php4-ldap really there?
-    print '<tr><td><p align="center"><font color="red"><strong>Warning:
-           The PHP LDAP module does not seem to be present. 
-           Please ensure it is installed and enabled.</strong></font></p></td></tr>';
+    notify(get_string('auth_ldap_noextension','auth'));
 }
     
 ?>
index 5dfff3405482867519371621446c9ef47579325d..01fd52031c936b67cd3735cd95520cc1d72f1185 100644 (file)
@@ -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 <b>LDAP fields</b> that you specify here. <p>If you leave these fields blank, then nothing will be transferred from LDAP and Moodle defaults will be used instead.</p><p>In either case, the user will be able to edit all of these fields after they log in.</p>';
 $string['auth_ldaptitle'] = 'Use an LDAP server';