diff options
Diffstat (limited to 'actions/finishopenidlogin.php')
-rw-r--r-- | actions/finishopenidlogin.php | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/actions/finishopenidlogin.php b/actions/finishopenidlogin.php index 202520d54..3d0c8f277 100644 --- a/actions/finishopenidlogin.php +++ b/actions/finishopenidlogin.php @@ -264,15 +264,8 @@ class FinishopenidloginAction extends Action { $profile->delete(); } - $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) { + if (!oid_link_user($user->id, $canonical, $display) { # Try to clean up... $user->delete(); $profile->delete(); @@ -303,14 +296,10 @@ class FinishopenidloginAction extends Action { return; } - $oid = new User_openid(); - $oid->display = $display; - $oid->canonical = $canonical; - $oid->user_id = $user->id; - $oid->created = DB_DataObject_Cast::dateTime(); + $result = oid_link_user($user->id, $canonical, $display); - if (!$oid->insert()) { - common_server_error(_t('Error connecting OpenID.')); + if (!$result) { + common_server_error(_t('Error connecting user to OpenID.')); return; } |