Skip to content

Commit

Permalink
MDL-22061 converting auths to pluginname and deprecating old method f…
Browse files Browse the repository at this point in the history
…or getting auth names

AMOS START
 MOV [auth_castitle,auth_cas],[pluginname,auth_cas]
 MOV [auth_dbtitle,auth_db],[pluginname,auth_db]
 MOV [auth_emailtitle,auth_email],[pluginname,auth_email]
 MOV [auth_fctitle,auth_fc],[pluginname,auth_fc]
 MOV [auth_imaptitle,auth_imap],[pluginname,auth_imap]
 MOV [auth_ldaptitle,auth_ldap],[pluginname,auth_ldap]
 MOV [auth_manualtitle,auth_manul],[pluginname,auth_manul]
 MOV [auth_mnettitle,auth_mnet],[pluginname,auth_mnet]
 MOV [auth_nntptitle,auth_nntp],[pluginname,auth_nntp]
 MOV [auth_nologintitle,auth_nologin],[pluginname,auth_nologin]
 MOV [auth_nonetitle,auth_none],[pluginname,auth_none]
 MOV [auth_pamtitle,auth_pam],[pluginname,auth_pam]
 MOV [auth_pop3title,auth_pop3],[pluginname,auth_pop3]
 MOV [auth_radiustitle,auth_radius],[pluginname,auth_radius]
 MOV [auth_shibbolethtitle,auth_shibboleth],[pluginname,auth_shibboleth]
 MOV [auth_webservicetitle,auth_webservice],[pluginname,auth_webservice]
AMOS END
  • Loading branch information
skodak committed Apr 11, 2010
1 parent f496ada commit 370f10b
Show file tree
Hide file tree
Showing 23 changed files with 33 additions and 31 deletions.
2 changes: 1 addition & 1 deletion admin/settings/users.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
$authbyname = array();

foreach ($auths as $auth => $authdir) {
$strauthname = auth_get_plugin_title($auth);
$strauthname = get_string('pluginname', "auth_{$auth}");
$authbyname[$strauthname] = $auth;
}
ksort($authbyname);
Expand Down
2 changes: 1 addition & 1 deletion admin/uploaduser.php
Original file line number Diff line number Diff line change
Expand Up @@ -1154,7 +1154,7 @@ function uu_allowed_auths() {
$plugins = get_enabled_auth_plugins();
$choices = array();
foreach ($plugins as $plugin) {
$choices[$plugin] = auth_get_plugin_title ($plugin);
$choices[$plugin] = get_string('pluginname', "auth_{$plugin}");
}

return $choices;
Expand Down
2 changes: 1 addition & 1 deletion auth/cas/lang/en/auth_cas.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
$string['auth_cas_proxycas_key'] = 'Proxy mode';
$string['auth_cas_server_settings'] = 'CAS server configuration';
$string['auth_cas_text'] = 'Secure connection';
$string['auth_castitle'] = 'CAS server (SSO)';
$string['auth_cas_use_cas'] = 'Use CAS';
$string['auth_cas_version'] = 'Version of CAS';
$string['CASform'] = 'Authentication choice';
$string['pluginname'] = 'CAS server (SSO)';
2 changes: 1 addition & 1 deletion auth/db/lang/en/auth_db.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
$string['auth_dbsybasequotinghelp'] = 'Sybase style single quote escaping - needed for Oracle, MS SQL and some other databases. Do not use for MySQL!';
$string['auth_dbtable'] = 'Name of the table in the database';
$string['auth_dbtable_key'] = 'Table';
$string['auth_dbtitle'] = 'External database';
$string['auth_dbtype'] = 'The database type (See the <a href="../lib/adodb/readme.htm#drivers">ADOdb documentation</a> for details)';
$string['auth_dbtype_key'] = 'Database';
$string['auth_dbupdatinguser'] = 'Updating user {$a->name} id {$a->id}';
Expand All @@ -66,3 +65,4 @@
$string['auth_dbusernotexist'] = 'Cannot update non-existent user: {$a}';
$string['auth_dbuserstoadd'] = 'User entries to add: {$a}';
$string['auth_dbuserstoremove'] = 'User entries to remove: {$a}';
$string['pluginname'] = 'External database';
2 changes: 1 addition & 1 deletion auth/email/lang/en/auth_email.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
$string['auth_emailrecaptcha'] = 'Adds a visual/audio confirmation form element to the signup page for email self-registering users. This protects your site against spammers and contributes to a worthwhile cause. See http://recaptcha.net/learnmore.html for more details. <br /><em>PHP cURL extension is required.</em>';
$string['auth_emailrecaptcha_key'] = 'Enable reCAPTCHA element';
$string['auth_emailsettings'] = 'Settings';
$string['auth_emailtitle'] = 'Email-based self-registration';
$string['auth_emailupdate'] = 'Email address update';
$string['auth_emailupdatemessage'] = 'Dear {$a->fullname},
Expand All @@ -44,3 +43,4 @@
$string['auth_changingemailaddress'] = 'You have requested a change of email address, from {$a->oldemail} to {$a->newemail}. For security reasons, we are sending you an email message at the new address to confirm that it belongs to you. Your email address will be updated as soon as you open the URL sent to you in that message.';
$string['auth_invalidnewemailkey'] = 'Error: if you are trying to confirm a change of email address, you may have made a mistake in copying the URL we sent you by email. Please copy the address and try again.';
$string['auth_outofnewemailupdateattempts'] = 'You have run out of allowed attempts to update your email address. Your update request has been cancelled.';
$string['pluginname'] = 'Email-based self-registration';
2 changes: 1 addition & 1 deletion auth/fc/lang/en/auth_fc.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
$string['auth_fcchangepasswordurl'] = 'Password-change URL';
$string['auth_fcpasswd'] = 'Password for the account above.';
$string['auth_fcpasswd_key'] = 'Password';
$string['auth_fctitle'] = 'FirstClass server';
$string['auth_fcuserid'] = 'Userid for FirstClass account with privilege \'Subadministrator\' set.';
$string['auth_fcuserid_key'] = 'User ID';
$string['auth_fchost'] = 'The FirstClass server address. Use the IP number or DNS name.';
$string['auth_fchost_key'] = 'Host';
$string['pluginname'] = 'FirstClass server';
2 changes: 1 addition & 1 deletion auth/imap/lang/en/auth_imap.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@
$string['auth_imapnotinstalled'] = 'Cannot use IMAP authentication. The PHP IMAP module is not installed.';
$string['auth_imapport'] = 'IMAP server port number. Usually this is 143 or 993.';
$string['auth_imapport_key'] = 'Port';
$string['auth_imaptitle'] = '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['pluginname'] = 'IMAP server';
2 changes: 1 addition & 1 deletion auth/ldap/lang/en/auth_ldap.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@
$string['auth_ldap_search_sub'] = 'Search users from subcontexts.';
$string['auth_ldap_search_sub_key'] = 'Search subcontexts';
$string['auth_ldap_server_settings'] = 'LDAP server settings';
$string['auth_ldaptitle'] = 'LDAP server';
$string['auth_ldap_unsupportedusertype'] = 'auth: ldap user_create() does not support selected usertype: {$a} (..yet)';
$string['auth_ldap_update_userinfo'] = 'Update user information (firstname, lastname, address..) from LDAP to Moodle. Specify "Data mapping" settings as you need.';
$string['auth_ldap_user_attribute'] = 'Optional: Overrides the attribute used to name/search users. Usually \'cn\'.';
Expand All @@ -111,3 +110,4 @@
$string['ntlmsso_attempting'] = 'Attempting Single Sign On via NTLM...';
$string['ntlmsso_failed'] = 'Auto-login failed, try the normal login page...';
$string['ntlmsso_isdisabled'] = 'NTLM SSO is disabled.';
$string['pluginname'] = 'LDAP server';
2 changes: 1 addition & 1 deletion auth/manual/lang/en/auth_manual.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@
*/

$string['auth_manualdescription'] = 'This method removes any way for users to create their own accounts. All accounts must be manually created by the admin user.';
$string['auth_manualtitle'] = 'Manual accounts';
$string['pluginname'] = 'Manual accounts';
2 changes: 1 addition & 1 deletion auth/mnet/lang/en/auth_mnet.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
$string['auth_mnet_roamin'] = 'These host\'s users can roam in to your site';
$string['auth_mnet_roamout'] = 'Your users can roam out to these hosts';
$string['auth_mnet_rpc_negotiation_timeout'] = 'The timeout in seconds for authentication over the XMLRPC transport.';
$string['auth_mnettitle'] = 'Moodle Network authentication';
$string['auto_add_remote_users'] = 'Auto add remote users';
$string['rpc_negotiation_timeout'] = 'RPC negotiation timeout';
$string['sso_idp_description'] = 'Publish this service to allow your users to roam to the {$a} Moodle site without having to re-login there. <ul><li><em>Dependency</em>: You must also <strong>subscribe</strong> to the SSO (Service Provider) service on {$a}.</li></ul><br />Subscribe to this service to allow authenticated users from {$a} to access your site without having to re-login. <ul><li><em>Dependency</em>: You must also <strong>publish</strong> the SSO (Service Provider) service to {$a}.</li></ul><br />';
$string['sso_idp_name'] = 'SSO (Identity Provider)';
$string['sso_mnet_login_refused'] = 'Username {$a->user} is not permitted to login from {$a->host}.';
$string['sso_sp_description'] = 'Publish this service to allow authenticated users from {$a} to access your site without having to re-login. <ul><li><em>Dependency</em>: You must also <strong>subscribe</strong> to the SSO (Identity Provider) service on {$a}.</li></ul><br />Subscribe to this service to allow your users to roam to the {$a} Moodle site without having to re-login there. <ul><li><em>Dependency</em>: You must also <strong>publish</strong> the SSO (Identity Provider) service to {$a}.</li></ul><br />';
$string['sso_sp_name'] = 'SSO (Service Provider)';
$string['pluginname'] = 'Moodle Network authentication';
2 changes: 1 addition & 1 deletion auth/nntp/lang/en/auth_nntp.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@
$string['auth_nntpnotinstalled'] = 'Cannot use NNTP authentication. The PHP IMAP module is not installed.';
$string['auth_nntpport'] = 'Server port (119 is the most common)';
$string['auth_nntpport_key'] = 'Port';
$string['auth_nntptitle'] = 'NNTP server';
$string['pluginname'] = 'NNTP server';
2 changes: 1 addition & 1 deletion auth/nologin/lang/en/auth_nologin.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@
*/

$string['auth_nologindescription'] = 'Auxiliary plugin that prevents user to login into system and also discards any mail sent to the user. Can be used to <em>suspend</em> user accounts.';
$string['auth_nologintitle'] = 'No login';
$string['pluginname'] = 'No login';
2 changes: 1 addition & 1 deletion auth/none/lang/en/auth_none.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@
*/

$string['auth_nonedescription'] = 'Users can sign in and create valid accounts immediately, with no authentication against an external server and no confirmation via email. Be careful using this option - think of the security and administration problems this could cause.';
$string['auth_nonetitle'] = 'No authentication';
$string['pluginname'] = 'No authentication';
2 changes: 1 addition & 1 deletion auth/pam/lang/en/auth_pam.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
*/

$string['auth_pamdescription'] = 'This method uses PAM to access the native usernames on this server. You have to install <a href="http://www.math.ohio-state.edu/~ccunning/pam_auth/">PHP4 PAM Authentication</a> in order to use this module.';
$string['auth_pamtitle'] = 'PAM (Pluggable Authentication Modules)';
$string['auth_passwordisexpired'] = 'Your password is expired. Do you want change your password now?';
$string['auth_passwordwillexpire'] = 'Your password will expire in {$a} days. Do you want change your password now?';
$string['pluginname'] = 'PAM (Pluggable Authentication Modules)';
2 changes: 1 addition & 1 deletion auth/pop3/lang/en/auth_pop3.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@
$string['auth_pop3notinstalled'] = 'Cannot use POP3 authentication. The PHP IMAP module is not installed.';
$string['auth_pop3port'] = 'Server port (110 is the most common, 995 is common for SSL)';
$string['auth_pop3port_key'] = 'Port';
$string['auth_pop3title'] = 'POP3 server';
$string['auth_pop3type'] = 'Server type. If your server uses certificate security, choose pop3cert.';
$string['auth_pop3type_key'] = 'Type';
$string['pluginname'] = 'POP3 server';
2 changes: 1 addition & 1 deletion auth/radius/lang/en/auth_radius.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@
$string['auth_radiusnasport_key'] = 'Port';
$string['auth_radiussecret'] = 'Shared secret';
$string['auth_radiussecret_key'] = 'Secret';
$string['auth_radiustitle'] = 'RADIUS server';
$string['auth_radiustype'] = 'Choose an authentication scheme to use with the RADIUS server.';
$string['auth_radiustypechapmd5'] = 'CHAP MD5';
$string['auth_radiustype_key'] = 'Authentication';
$string['auth_radiustypemschapv1'] = 'Microsoft CHAP version 1';
$string['auth_radiustypemschapv2'] = 'Microsoft CHAP version 2';
$string['auth_radiustypepap'] = 'PAP';
$string['pluginname'] = 'RADIUS server';
2 changes: 1 addition & 1 deletion auth/shibboleth/lang/en/auth_shibboleth.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
$string['auth_shibboleth_manual_login'] = 'Manual Login';
$string['auth_shibboleth_select_member'] = 'I\'m a member of ...';
$string['auth_shibboleth_select_organization'] = 'For authentication via Shibboleth, please select your organization from the drop down list:';
$string['auth_shibbolethtitle'] = 'Shibboleth';
$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">README</a> for further instructions.';
$string['auth_shib_convert_data_warning'] = 'The file does not exist or is not readable by the webserver process!';
Expand All @@ -55,3 +54,4 @@
$string['shib_no_attributes_error'] = 'You seem to be Shibboleth authenticated but Moodle didn\'t receive any user attributes. Please check that your Identity Provider releases the necessary attributes ({$a}) to the Service Provider Moodle is running on or inform the webmaster of this server.';
$string['shib_not_all_attributes_error'] = 'Moodle needs certain Shibboleth attributes which are not present in your case. The attributes are: {$a}<br />Please contact the webmaster of this server or your Identity Provider.';
$string['shib_not_set_up_error'] = 'Shibboleth authentication doesn\'t seem to be set up correctly because no Shibboleth environment variables are present for this page. Please consult the <a href="README.txt">README</a> for further instructions on how to set up Shibboleth authentication or contact the webmaster of this Moodle installation.';
$string['pluginname'] = 'Shibboleth';
2 changes: 1 addition & 1 deletion auth/webservice/lang/en/auth_webservice.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@
*/

$string['auth_webservicedescription'] = 'This authentication method should be used for accounts that are exclusively for use by web service clients.';
$string['auth_webservicetitle'] = 'Web services authentication';
$string['pluginname'] = 'Web services authentication';
2 changes: 1 addition & 1 deletion lib/authlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ function ignore_timeout_hook($user, $sid, $timecreated, $timemodified) {
* @todo Document this function
*/
function get_title() {
return auth_get_plugin_title($this->authtype);
return get_string('pluginname', "auth_{$this->authtype}");
}

/**
Expand Down
12 changes: 12 additions & 0 deletions lib/deprecatedlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,18 @@
* @deprecated
*/

/**
* Return the authentication plugin title
*
* @param string $authtype plugin type
* @return string
*/
function auth_get_plugin_title($authtype) {
debugging('Function auth_get_plugin_title() is deprecated, please use standard get_string("pluginname", "auth_'.$authtype.'")!');
return get_string('pluginname', "auth_{$authtype}");
}


/**
* @deprecated
*/
Expand Down
10 changes: 0 additions & 10 deletions lib/weblib.php
Original file line number Diff line number Diff line change
Expand Up @@ -3432,16 +3432,6 @@ public function finished() {
}
}

/**
* Return the authentication plugin title
*
* @param string $authtype plugin type
* @return string
*/
function auth_get_plugin_title($authtype) {
return get_string("auth_{$authtype}title", "auth_{$authtype}");
}

/**
* Returns a localized sentence in the current language summarizing the current password policy
*
Expand Down
2 changes: 1 addition & 1 deletion user/editadvanced_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function definition() {
$auths = get_plugin_list('auth');
$auth_options = array();
foreach ($auths as $auth => $unused) {
$auth_options[$auth] = auth_get_plugin_title($auth);
$auth_options[$auth] = get_string('pluginname', "auth_{$auth}");
}
$mform->addElement('select', 'auth', get_string('chooseauthmethod','auth'), $auth_options);
$mform->setHelpButton('auth', array('authchange', get_string('chooseauthmethod','auth')));
Expand Down
2 changes: 1 addition & 1 deletion user/filters/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ function get_field($fieldname, $advanced) {
$plugins = get_plugin_list('auth');
$choices = array();
foreach ($plugins as $auth => $unused) {
$choices[$auth] = auth_get_plugin_title ($auth);
$choices[$auth] = get_string('pluginname', "auth_{$auth}");
}
return new user_filter_simpleselect('auth', get_string('authentication'), $advanced, 'auth', $choices);

Expand Down

0 comments on commit 370f10b

Please sign in to comment.