diff options
Diffstat (limited to 'lib/openid.php')
-rw-r--r-- | lib/openid.php | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/lib/openid.php b/lib/openid.php index 9128ecddc..c41b3424c 100644 --- a/lib/openid.php +++ b/lib/openid.php @@ -41,4 +41,21 @@ function oid_consumer() { $store = oid_store(); $consumer = new Auth_OpenID_Consumer($store); return $consumer; -}
\ No newline at end of file +} + +function oid_link_user($id, $canonical, $display) { + + $oid = new User_openid(); + $oid->user_id = $id; + $oid->canonical = $canonical; + $oid->display = $display; + $oid->created = DB_DataObject_Cast::dateTime(); + + if (!$oid->insert()) { + $err = PEAR::getStaticProperty('DB_DataObject','lastError'); + common_debug('DB error ' . $err->code . ': ' . $err->message, __FILE__); + return false; + } + + return true; +} |