config_plugin work

* lang updates and lang-related fixes
 * auth/db uses the new convention
This commit is contained in:
martinlanghoff
2005-06-01 06:01:29 +00:00
parent 3d7a1cbf2b
commit 2ba609cc8c
4 changed files with 20 additions and 97 deletions
+1 -1
View File
@@ -226,7 +226,7 @@ function print_auth_lock_options ($auth, $user_fields, $helptext, $retrieveopts,
'unlockedifempty' => get_string('unlockedifempty', 'auth'),
'locked' => get_string('locked', 'auth'));
$updatelocaloptions = array('oncreate' => get_string('update_oncreate', 'auth'),
'onlogin' => get_string('update_onogin', 'auth'));
'onlogin' => get_string('update_onlogin', 'auth'));
$updateextoptions = array('0' => get_string('update_never', 'auth'),
'1' => get_string('update_onupdate', 'auth'));
+1 -88
View File
@@ -135,94 +135,7 @@
</td>
</tr>
<tr>
<td align="right"><?php print_string("firstname") ?>:</td>
<td>
<input name="auth_user_firstname" type="text" size="30" value="<?php echo $config->auth_user_firstname?>" />
</td>
<td rowspan="12" valign="middle">
<?php print_string("auth_dbextrafields","auth") ?>
</td>
</tr>
<tr valign="top">
<td align="right"><?php print_string("lastname") ?>:</td>
<td>
<input name="auth_user_lastname" type="text" size="30" value="<?php echo $config->auth_user_lastname?>" />
</td>
</tr>
<tr valign="top">
<td align="right"><?php print_string("email") ?>:</td>
<td>
<input name="auth_user_email" type="text" size="30" value="<?php echo $config->auth_user_email?>" />
</td>
</tr>
<tr valign="top">
<td align="right"><?php print_string("phone") ?> 1:</td>
<td>
<input name="auth_user_phone1" type="text" size="30" value="<?php echo $config->auth_user_phone1?>" />
</td>
</tr>
<tr valign="top">
<td align="right"><?php print_string("phone") ?> 2:</td>
<td>
<input name="auth_user_phone2" type="text" size="30" value="<?php echo $config->auth_user_phone2?>" />
</td>
</tr>
<tr valign="top">
<td align="right"><?php print_string("department") ?>:</td>
<td>
<input name="auth_user_department" type="text" size="30" value="<?php echo $config->auth_user_department?>" />
</td>
</tr>
<tr valign="top">
<td align="right"><?php print_string("address") ?>:</td>
<td>
<input name="auth_user_address" type="text" size="30" value="<?php echo $config->auth_user_address?>" />
</td>
</tr>
<tr valign="top">
<td align="right"><?php print_string("city") ?>:</td>
<td>
<input name="auth_user_city" type="text" size="30" value="<?php echo $config->auth_user_city?>" />
</td>
</tr>
<tr valign="top">
<td align="right"><?php print_string("country") ?>:</td>
<td>
<input name="auth_user_country" type="text" size="30" value="<?php echo $config->auth_user_country?>" />
</td>
</tr>
<tr valign="top">
<td align="right"><?php print_string("description") ?>:</td>
<td>
<input name="auth_user_description" type="text" size="30" value="<?php echo $config->auth_user_description?>" />
</td>
</tr>
<tr valign="top">
<td align="right"><?php print_string("idnumber") ?>:</td>
<td>
<input name="auth_user_idnumber" type="text" size="30" value="<?php echo $config->auth_user_idnumber?>" />
</td>
</tr>
<tr valign="top">
<td align="right"><?php print_string("language") ?>:</td>
<td>
<input name="auth_user_lang" type="text" size="30" value="<?php echo $config->auth_user_lang?>" />
</td>
</tr>
<?php print_auth_lock_options($auth, $user_fields, get_string("auth_dbextrafields","auth"), true, false); ?>
<tr valign="top">
<td align="right"><?php print_string("instructions", "auth") ?>:</td>
+5 -2
View File
@@ -58,6 +58,9 @@ function auth_get_userinfo($username){
$config = (array) $CFG;
$pcfg = get_config('auth/db');
$pcfg = (array) $pcfg;
ADOLoadCode($CFG->auth_dbtype);
$authdb = &ADONewConnection();
$authdb->PConnect($CFG->auth_dbhost,$CFG->auth_dbuser,$CFG->auth_dbpass,$CFG->auth_dbname);
@@ -69,8 +72,8 @@ function auth_get_userinfo($username){
$result = array();
foreach ($fields as $field) {
if ($config["auth_user_$field"]) {
if ($rs = $authdb->Execute("SELECT ".$config["auth_user_$field"]." FROM $CFG->auth_dbtable
if ($pcfg["field_map_$field"]) {
if ($rs = $authdb->Execute("SELECT ".$pcfg["field_map_$field"]." FROM $CFG->auth_dbtable
WHERE $CFG->auth_dbfielduser = '$username'")) {
if ( $rs->RecordCount() == 1 ) {
$result["$field"] = $rs->fields[0];
+13 -6
View File
@@ -31,8 +31,8 @@ $string['auth_dbtable'] = 'Name of the table in the database';
$string['auth_dbtitle'] = 'Use an external database';
$string['auth_dbtype'] = 'The database type (See the <a href=\"../lib/adodb/readme.htm#drivers\">ADOdb documentation</a> for details)';
$string['auth_dbuser'] = 'Username with read access to the database';
$string['auth_editlock'] = 'Lock value';
$string['auth_editlock_expl'] = '<p><b>Lock value:</b> If enabled, will prevent Moodle users and admins from editing the field directly. Use this option if you are maintaining this data in the external auth system. </p>';
$string['auth_fieldlock'] = 'Lock value';
$string['auth_fieldlock_expl'] = '<p><b>Lock value:</b> If enabled, will prevent Moodle users and admins from editing the field directly. Use this option if you are maintaining this data in the external auth system. </p>';
$string['auth_emaildescription'] = 'Email confirmation is the default authentication method. When the user signs up, choosing their own new username and password, a confirmation email is sent to the user\'s email address. This email contains a secure link to a page where the user can confirm their account. Future logins just check the username and password against the stored values in the Moodle database.';
$string['auth_emailtitle'] = 'Email-based authentication';
$string['auth_fccreators'] = 'List of groups whose members are allowed to create new courses. Separate multiple groups with \';\'. Names must be spelled exactly as on FirstClass server. System is case-sensitive.';
@@ -113,10 +113,10 @@ $string['auth_shib_convert_data'] = 'Data modification API';
$string['auth_shib_convert_data_description'] = 'You can use this API to further modify the data provided by Shibboleth. Read the <a href=\"../auth/shibboleth/README.txt\" target=\"_blank\">README</a> for further instructions.';
$string['auth_shib_instructions_help'] = 'Here you should provide custom instructions for your users to explain Shibboleth. It will be shown on the login page in the instructions section. It should include a link to a Shibboleth-protected resource that redirects users to \"<b>$a</b>\" so that Shibboleth users can login in Moodle. If you leave it blank, then standard instructions will be used (not Shibboleth-specific)';
$string['auth_shib_convert_data_warning'] = 'The file does not exist or is not readable by the webserver process!';
$string['auth_updatelocal'] = 'Update local data';
$string['auth_updatelocal_expl'] = '<p><b>Update local data:</b> If enabled, the field will be updated (from external auth) every time the user logs in or there is a user synchronization. Fields set to update locally should be locked.</p>';
$string['auth_updateremote'] = 'Update external data';
$string['auth_updateremote_expl'] = '<p><b>Update external data:</b> If enabled, the external auth will be updated when the user record is updated. Fields should be unlocked to allow edits.</p>';
$string['auth_updatelocal'] = 'Update local';
$string['auth_updatelocal_expl'] = '<p><b>Update local:</b> If enabled, the field will be updated (from external auth) every time the user logs in or there is a user synchronization. Fields set to update locally should be locked.</p>';
$string['auth_updateremote'] = 'Update external';
$string['auth_updateremote_expl'] = '<p><b>Update external:</b> If enabled, the external auth will be updated when the user record is updated. Fields should be unlocked to allow edits.</p>';
$string['auth_updateremote_ldap'] = '<p><b>Note:</b> Updating external LDAP data requires that you set binddn and bindpw to a bind-user with editing privileges to all the user records. It currently does not preserve multi-valued attributes, and will remove extra values on update. </p>';
$string['auth_user_create'] = 'Enable user creation';
$string['auth_user_creation'] = 'New (anonymous) users can create user accounts on the external authentication source and confirmed via email. If you enable this , remember to also configure module-specific options for user creation.';
@@ -137,5 +137,12 @@ $string['showguestlogin'] = 'You can hide or show the guest login button on the
$string['stdchangepassword'] = 'Use standard Change Password Page';
$string['stdchangepassword_expl'] = 'If the external authentication system allows password changes through Moodle, switch this to Yes. This setting overrides \'Change Password URL\'.';
$string['stdchangepassword_explldap'] = 'NOTE: It is recommended that you use LDAP over an SSL encrypted tunnel (ldaps://) if the LDAP server is remote.';
$string['update_oncreate'] = 'On creation';
$string['update_onlogin'] = 'On every login';
$string['update_onupdate'] = 'On update';
$string['update_never'] = 'Never';
$string['unlocked'] = 'Unlocked';
$string['unlockedifempty'] = 'Unlocked if empty';
$string['locked'] = 'Locked';
?>