Index: trunk/extensions/CentralAuth/central-auth.sql |
— | — | @@ -28,11 +28,11 @@ |
29 | 29 | -- only existing databases not yet migrated have to be loaded. |
30 | 30 | -- |
31 | 31 | CREATE TABLE localnames ( |
32 | | - ln_wiki varchar(255) binary not null, |
| 32 | + ln_dbname varchar(255) binary not null, |
33 | 33 | ln_name varchar(255) binary not null, |
34 | 34 | |
35 | | - primary key (ln_wiki, ln_name), |
36 | | - key (ln_name, ln_wiki) |
| 35 | + primary key (ln_dbname, ln_name), |
| 36 | + key (ln_name, ln_dbname) |
37 | 37 | ) /*$wgDBTableOptions*/; |
38 | 38 | |
39 | 39 | -- |
— | — | @@ -96,7 +96,7 @@ |
97 | 97 | -- All local DBs will be swept on an opt-in check event. |
98 | 98 | -- |
99 | 99 | CREATE TABLE localuser ( |
100 | | - lu_wiki varchar(255) binary not null, |
| 100 | + lu_dbname varchar(255) binary not null, |
101 | 101 | lu_name varchar(255) binary not null, |
102 | 102 | |
103 | 103 | -- Migration status/logging information, to help diagnose issues |
— | — | @@ -110,8 +110,8 @@ |
111 | 111 | 'new', |
112 | 112 | 'login'), |
113 | 113 | |
114 | | - primary key (lu_wiki, lu_name), |
115 | | - key (lu_name, lu_wiki) |
| 114 | + primary key (lu_dbname, lu_name), |
| 115 | + key (lu_name, lu_dbname) |
116 | 116 | ) /*$wgDBTableOptions*/; |
117 | 117 | |
118 | 118 | |
Index: trunk/extensions/CentralAuth/db_patches/patch-lu_wiki.sql |
— | — | @@ -1,2 +0,0 @@ |
2 | | -ALTER TABLE localnames CHANGE ln_dbname ln_wiki varchar(255) binary not null; |
3 | | -ALTER TABLE localuser CHANGE lu_dbname lu_wiki varchar(255) binary not null; |
Index: trunk/extensions/CentralAuth/CentralAuthUserArray.php |
— | — | @@ -30,7 +30,7 @@ |
31 | 31 | array( |
32 | 32 | 'gu_name' => $names, |
33 | 33 | 'lu_name=gu_name', |
34 | | - 'lu_wiki' => wfWikiID() |
| 34 | + 'lu_dbname' => wfWikiID() |
35 | 35 | ), __METHOD__ ); |
36 | 36 | $this->globalData = array(); |
37 | 37 | foreach ( $caRes as $row ) { |
Index: trunk/extensions/CentralAuth/CentralAuthUser.php |
— | — | @@ -144,10 +144,10 @@ |
145 | 145 | $localuser = $dbr->tableName( 'localuser' ); |
146 | 146 | |
147 | 147 | $sql = |
148 | | - "SELECT gu_id, lu_wiki, gu_salt, gu_password,gu_auth_token, " . |
| 148 | + "SELECT gu_id, lu_dbname, gu_salt, gu_password,gu_auth_token, " . |
149 | 149 | "gu_locked,gu_hidden,gu_registration,gu_email,gu_email_authenticated " . |
150 | 150 | "FROM $globaluser " . |
151 | | - "LEFT OUTER JOIN $localuser ON gu_name=lu_name AND lu_wiki=? " . |
| 151 | + "LEFT OUTER JOIN $localuser ON gu_name=lu_name AND lu_dbname=? " . |
152 | 152 | "WHERE gu_name=?"; |
153 | 153 | $result = $dbr->safeQuery( $sql, wfWikiID(), $this->mName ); |
154 | 154 | $row = $dbr->fetchObject( $result ); |
— | — | @@ -197,7 +197,7 @@ |
198 | 198 | protected function loadFromRow( $row, $fromMaster = false ) { |
199 | 199 | if( $row ) { |
200 | 200 | $this->mGlobalId = intval( $row->gu_id ); |
201 | | - $this->mIsAttached = ($row->lu_wiki !== null); |
| 201 | + $this->mIsAttached = ($row->lu_dbname !== null); |
202 | 202 | $this->mSalt = $row->gu_salt; |
203 | 203 | $this->mPassword = $row->gu_password; |
204 | 204 | $this->mAuthToken = $row->gu_auth_token; |
— | — | @@ -427,7 +427,7 @@ |
428 | 428 | $tuples = array(); |
429 | 429 | foreach( $users as $name ) { |
430 | 430 | $tuples[] = array( |
431 | | - 'ln_wiki' => $wiki, |
| 431 | + 'ln_dbname' => $wiki, |
432 | 432 | 'ln_name' => $name ); |
433 | 433 | } |
434 | 434 | $dbw->insert( |
— | — | @@ -809,7 +809,7 @@ |
810 | 810 | $dbcw->delete( 'localuser', |
811 | 811 | array( |
812 | 812 | 'lu_name' => $this->mName, |
813 | | - 'lu_wiki' => $wikiName ), |
| 813 | + 'lu_dbname' => $wikiName ), |
814 | 814 | __METHOD__ ); |
815 | 815 | if ( !$dbcw->affectedRows() ) { |
816 | 816 | $wiki = WikiMap::getWiki( $wikiName ); |
— | — | @@ -909,7 +909,7 @@ |
910 | 910 | $dbw = self::getCentralDB(); |
911 | 911 | $dbw->insert( 'localuser', |
912 | 912 | array( |
913 | | - 'lu_wiki' => $wikiID, |
| 913 | + 'lu_dbname' => $wikiID, |
914 | 914 | 'lu_name' => $this->mName , |
915 | 915 | 'lu_attached_timestamp' => $dbw->timestamp(), |
916 | 916 | 'lu_attached_method' => $method ), |
— | — | @@ -1051,17 +1051,17 @@ |
1052 | 1052 | $dbw = self::getCentralDB(); |
1053 | 1053 | |
1054 | 1054 | $sql = " |
1055 | | - SELECT ln_wiki |
| 1055 | + SELECT ln_dbname |
1056 | 1056 | FROM localnames |
1057 | 1057 | LEFT OUTER JOIN localuser |
1058 | | - ON ln_wiki=lu_wiki AND ln_name=lu_name |
| 1058 | + ON ln_dbname=lu_dbname AND ln_name=lu_name |
1059 | 1059 | WHERE ln_name=? AND lu_name IS NULL |
1060 | 1060 | "; |
1061 | 1061 | $result = $dbw->safeQuery( $sql, $this->mName ); |
1062 | 1062 | |
1063 | 1063 | $dbs = array(); |
1064 | 1064 | while( $row = $dbw->fetchObject( $result ) ) { |
1065 | | - $dbs[] = $row->ln_wiki; |
| 1065 | + $dbs[] = $row->ln_dbname; |
1066 | 1066 | } |
1067 | 1067 | $dbw->freeResult( $result ); |
1068 | 1068 | |
— | — | @@ -1074,7 +1074,7 @@ |
1075 | 1075 | $this->lazyImportLocalNames(); |
1076 | 1076 | $dbw->insert( 'localnames', |
1077 | 1077 | array( |
1078 | | - 'ln_wiki' => $wikiID, |
| 1078 | + 'ln_dbname' => $wikiID, |
1079 | 1079 | 'ln_name' => $this->mName ), |
1080 | 1080 | __METHOD__, |
1081 | 1081 | array( 'IGNORE' ) ); |
— | — | @@ -1087,7 +1087,7 @@ |
1088 | 1088 | $this->lazyImportLocalNames(); |
1089 | 1089 | $dbw->delete( 'localnames', |
1090 | 1090 | array( |
1091 | | - 'ln_wiki' => $wikiID, |
| 1091 | + 'ln_dbname' => $wikiID, |
1092 | 1092 | 'ln_name' => $this->mName ), |
1093 | 1093 | __METHOD__ ); |
1094 | 1094 | $dbw->commit(); |
— | — | @@ -1129,7 +1129,7 @@ |
1130 | 1130 | __METHOD__ ); |
1131 | 1131 | if( $id ) { |
1132 | 1132 | $rows[] = array( |
1133 | | - 'ln_wiki' => $wikiID, |
| 1133 | + 'ln_dbname' => $wikiID, |
1134 | 1134 | 'ln_name' => $this->mName ); |
1135 | 1135 | } |
1136 | 1136 | $lb->reuseConnection( $dbr ); |
— | — | @@ -1177,13 +1177,13 @@ |
1178 | 1178 | $dbw = self::getCentralDB(); |
1179 | 1179 | |
1180 | 1180 | $result = $dbw->select( 'localuser', |
1181 | | - array( 'lu_wiki' ), |
| 1181 | + array( 'lu_dbname' ), |
1182 | 1182 | array( 'lu_name' => $this->mName ), |
1183 | 1183 | __METHOD__ ); |
1184 | 1184 | |
1185 | 1185 | $wikis = array(); |
1186 | 1186 | while( $row = $result->fetchObject() ) { |
1187 | | - $wikis[] = $row->lu_wiki; |
| 1187 | + $wikis[] = $row->lu_dbname; |
1188 | 1188 | } |
1189 | 1189 | $dbw->freeResult( $result ); |
1190 | 1190 | |
— | — | @@ -1217,7 +1217,7 @@ |
1218 | 1218 | $result = $dbw->select( |
1219 | 1219 | 'localuser', |
1220 | 1220 | array( |
1221 | | - 'lu_wiki', |
| 1221 | + 'lu_dbname', |
1222 | 1222 | 'lu_attached_timestamp', |
1223 | 1223 | 'lu_attached_method' ), |
1224 | 1224 | array( |
— | — | @@ -1226,8 +1226,8 @@ |
1227 | 1227 | |
1228 | 1228 | $wikis = array(); |
1229 | 1229 | while( $row = $dbw->fetchObject( $result ) ) { |
1230 | | - $wikis[$row->lu_wiki] = array( |
1231 | | - 'wiki' => $row->lu_wiki, |
| 1230 | + $wikis[$row->lu_dbname] = array( |
| 1231 | + 'wiki' => $row->lu_dbname, |
1232 | 1232 | 'attachedTimestamp' => wfTimestampOrNull( TS_MW, |
1233 | 1233 | $row->lu_attached_timestamp ), |
1234 | 1234 | 'attachedMethod' => $row->lu_attached_method, |
Index: trunk/extensions/CentralAuth/SpecialGlobalUsers.php |
— | — | @@ -76,7 +76,7 @@ |
77 | 77 | $conds[] = 'gu_name >= ' . $this->mDb->addQuotes( $this->mUsername ); |
78 | 78 | |
79 | 79 | return array( |
80 | | - 'tables' => " (globaluser LEFT JOIN localuser ON gu_name = lu_name AND lu_wiki = '{$localwiki}') LEFT JOIN global_user_groups ON gu_id = gug_user ", |
| 80 | + 'tables' => " (globaluser LEFT JOIN localuser ON gu_name = lu_name AND lu_dbname = '{$localwiki}') LEFT JOIN global_user_groups ON gu_id = gug_user ", |
81 | 81 | 'fields' => array( 'gu_id', 'gu_name', 'gu_locked', 'lu_attached_method', 'COUNT(gug_group) AS gug_numgroups', 'MAX(gug_group) AS gug_singlegroup' ), |
82 | 82 | 'conds' => $conds, |
83 | 83 | 'options' => array( 'GROUP BY' => 'gu_name' ), |