-
- $user = $this->get_user($canonical);
-
- if ($user) {
- $this->message(_t('This OpenID is already associated with user "') . $user->nickname . _t('"'));
- } else {
- $user = common_current_user();
- if (!$this->connect_user($user, $display, $canonical)) {
- $this->message(_t('Error connecting user'));
+
+ $cur =& common_current_user();
+ common_debug('cur = ' .print_r($cur, TRUE), __FILE__);
+ $result = oid_link_user($cur->id, $display, $canonical);
+
+ if (!$result) {
+ $this->message(_t('Error connecting user.'));
+ return;
+ }
+ if ($sreg) {
+ if (!$this->update_user($cur, $sreg)) {
+ $this->message(_t('Error updating profile'));