summaryrefslogtreecommitdiff
path: root/plugins/Authentication/AuthenticationPlugin.php
diff options
context:
space:
mode:
authorCraig Andrews <candrews@integralblue.com>2009-11-13 13:11:28 -0500
committerCraig Andrews <candrews@integralblue.com>2009-11-13 13:11:28 -0500
commit5494eb61465595466b897fdd88efda250c1107e2 (patch)
treec7704867f5fac1c9cbb4cd98edccc3da0b2ba78f /plugins/Authentication/AuthenticationPlugin.php
parentb9562cbb18a7b8f3f01bcbc8540933c4dfc10fb9 (diff)
Refactor User_username object creation to reuse code
Diffstat (limited to 'plugins/Authentication/AuthenticationPlugin.php')
-rw-r--r--plugins/Authentication/AuthenticationPlugin.php14
1 files changed, 2 insertions, 12 deletions
diff --git a/plugins/Authentication/AuthenticationPlugin.php b/plugins/Authentication/AuthenticationPlugin.php
index f061e456d..a76848b04 100644
--- a/plugins/Authentication/AuthenticationPlugin.php
+++ b/plugins/Authentication/AuthenticationPlugin.php
@@ -122,12 +122,7 @@ abstract class AuthenticationPlugin extends Plugin
$authenticated = $this->checkPassword($nickname, $password);
if($authenticated){
$authenticatedUser = User::staticGet('nickname', $nickname);
- $user_username = new User_username();
- $user_username->user_id = $authenticatedUser->id;
- $user_username->provider_name = $this->provider_name;
- $user_username->username = $nickname;
- $user_username->created = DB_DataObject_Cast::dateTime();
- $user_username->insert();
+ User_username::register($authenticatedUser,$nickname,$this->provider_name);
return false;
}
}
@@ -138,12 +133,7 @@ abstract class AuthenticationPlugin extends Plugin
$user = $this->autoregister($nickname);
if($user){
$authenticatedUser = $user;
- $user_username = new User_username();
- $user_username->user_id = $authenticatedUser->id;
- $user_username->provider_name = $this->provider_name;
- $user_username->username = $nickname;
- $user_username->created = DB_DataObject_Cast::dateTime();
- $user_username->insert();
+ User_username::register($authenticatedUser,$nickname,$this->provider_name);
return false;
}
}