summaryrefslogtreecommitdiff
path: root/plugins/LdapAuthentication
diff options
context:
space:
mode:
authorCraig Andrews <candrews@integralblue.com>2010-01-29 20:43:16 -0500
committerCraig Andrews <candrews@integralblue.com>2010-01-29 20:43:16 -0500
commit61d4709eb855827e8d15a3e873760e4ad797b45b (patch)
tree81621241b77b5addfa65fff4db07304117e936ab /plugins/LdapAuthentication
parent01eb4e8f003bf62575ec16dfb6127d7534be9c88 (diff)
Pass username and nickname to autoregister so auth plugins can set the nickname correct when creating a new user.
Continues fixing what Eric Helgeson pointed out in 01eb4e8f003bf62575ec16dfb6127d7534be9c88
Diffstat (limited to 'plugins/LdapAuthentication')
-rw-r--r--plugins/LdapAuthentication/LdapAuthenticationPlugin.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/plugins/LdapAuthentication/LdapAuthenticationPlugin.php b/plugins/LdapAuthentication/LdapAuthenticationPlugin.php
index 1755033f1..768f0fe7f 100644
--- a/plugins/LdapAuthentication/LdapAuthenticationPlugin.php
+++ b/plugins/LdapAuthentication/LdapAuthenticationPlugin.php
@@ -96,8 +96,11 @@ class LdapAuthenticationPlugin extends AuthenticationPlugin
}
}
- function autoRegister($username)
+ function autoRegister($username, $nickname)
{
+ if(is_null($nickname)){
+ $nickname = $username;
+ }
$entry = $this->ldap_get_user($username,$this->attributes);
if($entry){
$registration_data = array();
@@ -107,6 +110,7 @@ class LdapAuthenticationPlugin extends AuthenticationPlugin
if(isset($registration_data['email']) && !empty($registration_data['email'])){
$registration_data['email_confirmed']=true;
}
+ $registration_data['nickname'] = $nickname;
//set the database saved password to a random string.
$registration_data['password']=common_good_rand(16);
return User::register($registration_data);