Skip to content

Commit

Permalink
MDL-60969 auth_ldap: replace hardcoded strings in config settings
Browse files Browse the repository at this point in the history
  • Loading branch information
mdjnelson committed Dec 7, 2017
1 parent 1bc5a5a commit 7a06e15
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion auth/ldap/lang/en/auth_ldap.php
Expand Up @@ -41,7 +41,7 @@
entry in its database. This module can read user attributes from LDAP and prefill
wanted fields in Moodle. For following logins only the username and
password are checked.';
$string['auth_ldap_expiration_desc'] = 'Select No to disable expired password checking or LDAP to read passwordexpiration time directly from LDAP';
$string['auth_ldap_expiration_desc'] = 'Select \'{$a->no}\' to disable expired password checking or \'{$a->ldapserver}\' to read the password expiration time directly from the LDAP server';
$string['auth_ldap_expiration_key'] = 'Expiration';
$string['auth_ldap_expiration_warning_desc'] = 'Number of days before password expiration warning is issued.';
$string['auth_ldap_expiration_warning_key'] = 'Expiration warning';
Expand Down
18 changes: 15 additions & 3 deletions auth/ldap/settings.php
Expand Up @@ -185,12 +185,24 @@
new lang_string('auth_ldap_passwdexpire_settings', 'auth_ldap'), ''));

// Password Expiration.

// Create the description lang_string object.
$strno = get_string('no');
$strldapserver = get_string('pluginname', 'auth_ldap');
$langobject = new stdClass();
$langobject->no = $strno;
$langobject->ldapserver = $strldapserver;
$description = new lang_string('auth_ldap_expiration_desc', 'auth_ldap', $langobject);

// Now create the options.
$expiration = array();
$expiration['0'] = 'no';
$expiration['1'] = 'LDAP';
$expiration['0'] = $strno;
$expiration['1'] = $strldapserver;

// Add the setting.
$settings->add(new admin_setting_configselect('auth_ldap/expiration',
new lang_string('auth_ldap_expiration_key', 'auth_ldap'),
new lang_string('auth_ldap_expiration_desc', 'auth_ldap'), 0 , $expiration));
$description, 0 , $expiration));

// Password Expiration warning.
$settings->add(new admin_setting_configtext('auth_ldap/expiration_warning',
Expand Down

0 comments on commit 7a06e15

Please sign in to comment.