Index: trunk/extensions/CentralAuth/CentralAuthUser.php |
— | — | @@ -163,15 +163,18 @@ |
164 | 164 | $globaluser = $dbr->tableName( 'globaluser' ); |
165 | 165 | $localuser = $dbr->tableName( 'localuser' ); |
166 | 166 | |
167 | | - $sql = |
168 | | - "SELECT gu_id, lu_wiki, gu_salt, gu_password,gu_auth_token, " . |
169 | | - "gu_locked,gu_hidden, gu_registration, gu_email, " . |
170 | | - "gu_email_authenticated, gu_home_db " . |
171 | | - "FROM $globaluser " . |
172 | | - "LEFT OUTER JOIN $localuser ON gu_name=lu_name AND lu_wiki=? " . |
173 | | - "WHERE gu_name=?"; |
174 | | - $result = $dbr->safeQuery( $sql, wfWikiID(), $this->mName ); |
175 | | - $row = $dbr->fetchObject( $result ); |
| 167 | + $row = $dbr->selectRow( |
| 168 | + array( 'globaluser', 'localuser' ), |
| 169 | + array( |
| 170 | + 'gu_id', 'lu_wiki', 'gu_salt', 'gu_password', 'gu_auth_token', |
| 171 | + 'gu_locked', 'gu_hidden', 'gu_registration', 'gu_email', |
| 172 | + 'gu_email_authenticated', 'gu_home_db' |
| 173 | + ), |
| 174 | + array( 'gu_name' => $this->mName ), |
| 175 | + __METHOD__, |
| 176 | + array(), |
| 177 | + array( 'localuser' => array( 'LEFT OUTER JOIN', array( 'gu_name=lu_name', 'lu_wiki' => wfWikiID() ) ) ) |
| 178 | + ); |
176 | 179 | |
177 | 180 | $this->loadFromRow( $row, true ); |
178 | 181 | $this->saveToCache(); |
— | — | @@ -1401,14 +1404,14 @@ |
1402 | 1405 | function doListUnattached() { |
1403 | 1406 | $dbw = self::getCentralDB(); |
1404 | 1407 | |
1405 | | - $sql = " |
1406 | | - SELECT ln_wiki |
1407 | | - FROM localnames |
1408 | | - LEFT OUTER JOIN localuser |
1409 | | - ON ln_wiki=lu_wiki AND ln_name=lu_name |
1410 | | - WHERE ln_name=? AND lu_name IS NULL |
1411 | | - "; |
1412 | | - $result = $dbw->safeQuery( $sql, $this->mName ); |
| 1408 | + $result = $dbw->select( |
| 1409 | + array( 'localnames', 'localuser' ), |
| 1410 | + array( 'ln_wiki' ), |
| 1411 | + array( 'ln_name' => $this->mName, 'lu_name IS NULL' ), |
| 1412 | + __METHOD__, |
| 1413 | + array(), |
| 1414 | + array( 'localuser' => array( 'LEFT OUTER JOIN', array( 'ln_wiki=lu_wiki', 'ln_name=lu_name' ) ) ) |
| 1415 | + ); |
1413 | 1416 | |
1414 | 1417 | $dbs = array(); |
1415 | 1418 | foreach ( $result as $row ) { |