]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/LdapAuthentication/LdapAuthenticationPlugin.php
Merge branch 'testing' into 0.9.x
[quix0rs-gnu-social.git] / plugins / LdapAuthentication / LdapAuthenticationPlugin.php
index eb3a05117a4c72e2440190fce1dd8f90c7ffa87d..1755033f178a4bed7e38d728d5b092904c86fc9f 100644 (file)
@@ -153,6 +153,22 @@ class LdapAuthenticationPlugin extends AuthenticationPlugin
 
         return false;
     }
+
+    function suggestNicknameForUsername($username)
+    {
+        $entry = $this->ldap_get_user($username, $this->attributes);
+        if(!$entry){
+            //this really shouldn't happen
+            return $username;
+        }else{
+            $nickname = $entry->getValue($this->attributes['nickname'],'single');
+            if($nickname){
+                return $nickname;
+            }else{
+                return $username;
+            }
+        }
+    }
     
     //---utility functions---//
     function ldap_get_config(){