summaryrefslogtreecommitdiff
path: root/plugins/LdapAuthentication/LdapAuthenticationPlugin.php
diff options
context:
space:
mode:
authorSarven Capadisli <csarven@status.net>2010-01-31 19:25:49 +0000
committerSarven Capadisli <csarven@status.net>2010-01-31 19:25:49 +0000
commit339eb1adadc7f3495ad31ef0a5cf20cdca47ce1f (patch)
treecf3fe727c56b5f8a2c241915dc04abd22d07ac50 /plugins/LdapAuthentication/LdapAuthenticationPlugin.php
parentedf99dc45bcb28f60ea260e2a2a1bad148971a97 (diff)
parentbd5278302574ae3af87f09e0d8191c95ab93582a (diff)
Merge branch '0.9.x' of git@gitorious.org:statusnet/mainline into 0.9.x
Diffstat (limited to 'plugins/LdapAuthentication/LdapAuthenticationPlugin.php')
-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);