summaryrefslogtreecommitdiff
path: root/lib/authenticationplugin.php
diff options
context:
space:
mode:
authorZach Copley <zach@status.net>2010-03-05 03:56:04 +0000
committerZach Copley <zach@status.net>2010-03-05 03:56:04 +0000
commitb8001ea1079c4c8895fd2323e1e4a47c0d71fde3 (patch)
treeb732b239bf790c78c90f4c7d3be7044ce9f7da45 /lib/authenticationplugin.php
parente3c4b0c85d3fbae9604b22d3666fe36a3c1c7551 (diff)
parent064c45890f896f2af8a0231449fa5337bb79c509 (diff)
Merge branch '0.9.x' of git@gitorious.org:statusnet/mainline into 0.9.x
Diffstat (limited to 'lib/authenticationplugin.php')
-rw-r--r--lib/authenticationplugin.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/authenticationplugin.php b/lib/authenticationplugin.php
index 5be3ea5b9..0a3763e2e 100644
--- a/lib/authenticationplugin.php
+++ b/lib/authenticationplugin.php
@@ -79,7 +79,7 @@ abstract class AuthenticationPlugin extends Plugin
$nickname = $username;
}
$registration_data = array();
- $registration_data['nickname'] = $nickname ;
+ $registration_data['nickname'] = $nickname;
return User::register($registration_data);
}
@@ -101,12 +101,14 @@ abstract class AuthenticationPlugin extends Plugin
* Used during autoregistration
* Useful if your usernames are ugly, and you want to suggest
* nice looking nicknames when users initially sign on
+ * All nicknames returned by this function should be valid
+ * implementations may want to use common_nicknamize() to ensure validity
* @param username
* @return string nickname
*/
function suggestNicknameForUsername($username)
{
- return $username;
+ return common_nicknamize($username);
}
//------------Below are the methods that connect StatusNet to the implementing Auth plugin------------\\
@@ -129,7 +131,7 @@ abstract class AuthenticationPlugin extends Plugin
$test_user = User::staticGet('nickname', $suggested_nickname);
if($test_user) {
//someone already exists with the suggested nickname, so used the passed nickname
- $suggested_nickname = $nickname;
+ $suggested_nickname = common_nicknamize($nickname);
}
$test_user = User::staticGet('nickname', $suggested_nickname);
if($test_user) {