r56683 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r56682‎ | r56683 | r56684 >
Date:18:53, 20 September 2009
Author:happy-melon
Status:reverted
Tags:
Comment:
New function for ExternalUser to get the local User corresponding to the external one.
Modified paths:
  • /trunk/phase3/includes/ExternalUser.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/ExternalUser.php
@@ -285,4 +285,22 @@
286286 'eu_external_id' => $this->getId() ),
287287 __METHOD__ );
288288 }
 289+
 290+ /**
 291+ * Check whether this external user id is already linked with
 292+ * a local user.
 293+ * @return Mixed User if the account is linked, Null otherwise.
 294+ */
 295+ public final function getLocalUser(){
 296+ $dbr = wfGetDb( DB_SLAVE );
 297+ $row = $dbr->selectRow(
 298+ 'external_user',
 299+ '*',
 300+ array( 'eu_external_id' => $this->getId() )
 301+ );
 302+ return $row
 303+ ? User::newFromId( $row->fetchObject()->eu_wiki_id )
 304+ : null;
 305+ }
 306+
289307 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r56703Follow-up to r56683 - unnecessary abstractionhappy-melon14:18, 21 September 2009
r56937Revert broken rewrite of login system; totally broken....brion00:49, 26 September 2009
r57024Recommit some of the 'backend' stuff from the Login branch, after talking wit...happy-melon19:04, 28 September 2009

Status & tagging log