- $other =& $this->get_user($canonical);
-
- if ($other) {
- $this->message(_t('This OpenID is already associated with user "') . $other->nickname . _t('"'));
- } else {
- $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.'));
+ $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'));