summaryrefslogtreecommitdiff
path: root/actions/finishaddopenid.php
diff options
context:
space:
mode:
Diffstat (limited to 'actions/finishaddopenid.php')
-rw-r--r--actions/finishaddopenid.php23
1 files changed, 2 insertions, 21 deletions
diff --git a/actions/finishaddopenid.php b/actions/finishaddopenid.php
index 2b34b38ea..6a7bb3d24 100644
--- a/actions/finishaddopenid.php
+++ b/actions/finishaddopenid.php
@@ -64,7 +64,8 @@ class FinishaddopenidAction extends Action {
$this->message(_t('This OpenID is already associated with user "') . $user->nickname . _t('"'));
} else {
$cur = common_current_user();
- if (!$this->connect_user($cur, $display, $canonical)) {
+ $result = oid_link_user($cur->id, $display, $canonical);
+ if (!$result) {
$this->message(_t('Error connecting user'));
return;
}
@@ -136,24 +137,4 @@ class FinishaddopenidAction extends Action {
return true;
}
-
- function connect_user($user, $display, $canonical) {
-
- $id = $user->id;
-
- $oid = new User_openid();
- $oid->display = $display;
- $oid->canonical = $canonical;
- $oid->user_id = $id;
- $oid->created = DB_DataObject_Cast::dateTime();
-
- $result = $oid->insert();
-
- if (!$result) {
- $err = PEAR::getStaticProperty('DB_DataObject','lastError');
- common_debug('DB error ' . $err->code . ': ' . $err->message, __FILE__);
- return false;
- }
- return true;
- }
}