Skip to content

Commit 4e6aecd

Browse files
committed
Wikia: r47828: UserLogin: bugid 20806, 20611 - update getUser() in FBConnectDB class to sync local user. - support facebook proxy email. - update messages
(cherry picked from http://trac.wikia-code.com/changeset/47828)
1 parent 6bdf730 commit 4e6aecd

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

Facebook/FacebookDB.php

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,23 @@ public static function getUser( $fbid ) {
100100
__METHOD__
101101
);
102102
if ( $id ) {
103-
return User::newFromId( $id );
103+
/* Wikia change - begin */
104+
global $wgExternalAuthType;
105+
106+
$user = User::newFromId( $id );
107+
if ( $wgExternalAuthType ) {
108+
$user->load();
109+
if ( $user->getId() == 0 ) {
110+
$mExtUser = ExternalUser::newFromId( $id );
111+
if ( is_object( $mExtUser ) && ( $mExtUser->getId() != 0 ) ) {
112+
$mExtUser->linkToLocal( $mExtUser->getId() );
113+
$user->setId( $id );
114+
}
115+
}
116+
}
117+
118+
return $user;
119+
/* Wikia change - end */
104120
} else {
105121
return null;
106122
}

0 commit comments

Comments
 (0)