]> git.mjollnir.org Git - moodle.git/commitdiff
authentication MDL-18273 Custom Authentication Plugin title can be retrieved from...
authorjerome <jerome>
Thu, 14 May 2009 07:03:27 +0000 (07:03 +0000)
committerjerome <jerome>
Thu, 14 May 2009 07:03:27 +0000 (07:03 +0000)
admin/settings/users.php
admin/uploaduser.php
lib/authlib.php
lib/weblib.php
user/editadvanced_form.php
user/filters/lib.php

index 01b141cd64f89aa571be4e4ce27a438e3ad9e4e9..c725cf4e1c88c72c58e28dcd9f78c5017800fde3 100644 (file)
@@ -41,10 +41,7 @@ if ($hassiteconfig
         $authbyname = array();
 
         foreach ($auths as $auth) {
-            $strauthname = get_string("auth_{$auth}title", "auth");
-            if ($strauthname == "[[auth_{$auth}title]]") {
-                $strauthname = get_string("auth_{$auth}title", "auth_{$auth}");
-            }
+            $strauthname = auth_get_plugin_title($auth);
             $authbyname[$strauthname] = $auth;
         }
         ksort($authbyname);
index 67516cc8a7eaace34d60bbf05813c88e2cc176ca..9b55b3c484c975b4a3337d9019a61b5e0c3b8ebb 100755 (executable)
@@ -979,7 +979,7 @@ function uu_allowed_auths() {
     $plugins = get_enabled_auth_plugins();
     $choices = array();
     foreach ($plugins as $plugin) {
-        $choices[$plugin] = get_string('auth_'.$plugin.'title', 'auth');
+        $choices[$plugin] = auth_get_plugin_title ($plugin);
     }
 
     return $choices;
index 1e143884d92fab35f725f39102db6e9cf73d47ca..2a35e462de6ff23283291e0a776599a4f21a85e6 100644 (file)
@@ -360,11 +360,7 @@ class auth_plugin_base {
      * Return the properly translated human-friendly title of this auth plugin
      */
     function get_title() {
-        $authtitle = get_string("auth_{$this->authtype}title", "auth");
-        if ($authtitle == "[[auth_{$this->authtype}title]]") {
-            $authtitle = get_string("auth_{$this->authtype}title", "auth_{$this->authtype}");
-        }
-        return $authtitle;
+        return auth_get_plugin_title($this->authtype);
     }
 
     /**
index 2c67564d7f1e553010c5ec6deea79be64d687c71..a547edcaf97c441c1cdec124bfa7036f23355431 100644 (file)
@@ -7324,5 +7324,18 @@ class html_list_progress_trace extends moodle_progress_trace {
     }
 }
 
+/**
+ * Return the authentication plugin title
+ * @param string $authtype plugin type
+ * @return string
+ */
+function auth_get_plugin_title ($authtype) {
+    $authtitle = get_string("auth_{$authtype}title", "auth");
+    if ($authtitle == "[[auth_{$authtype}title]]") {
+        $authtitle = get_string("auth_{$authtype}title", "auth_{$authtype}");
+    }
+    return $authtitle;
+}
+
 // vim:autoindent:expandtab:shiftwidth=4:tabstop=4:tw=140:
 ?>
index 0824340df782adfd62fa5c6dad69abafcb6f0c95..e498ed02442380a40ab0aa7d2ccdfe6595a1f789 100644 (file)
@@ -27,7 +27,7 @@ class user_editadvanced_form extends moodleform {
         $modules = get_list_of_plugins('auth');
         $auth_options = array();
         foreach ($modules as $module) {
-            $auth_options[$module] = get_string("auth_$module"."title", "auth");
+            $auth_options[$module] = auth_get_plugin_title ($module);
         }
         $mform->addElement('select', 'auth', get_string('chooseauthmethod','auth'), $auth_options);
         $mform->setHelpButton('auth', array('authchange', get_string('chooseauthmethod','auth')));
index 7adb207f7cf8e7556c8c7196a7a706f04e59bdfa..a71db1583fdc96dd2a25cc28b09825b860f0b548 100644 (file)
@@ -118,7 +118,7 @@ class user_filtering {
                 $plugins = get_list_of_plugins('auth');
                 $choices = array();
                 foreach ($plugins as $auth) {
-                    $choices[$auth] = get_string("auth_{$auth}title", 'auth');
+                    $choices[$auth] = auth_get_plugin_title ($auth);
                 }
                 return new user_filter_simpleselect('auth', get_string('authentication'), $advanced, 'auth', $choices);