Index: trunk/extensions/CentralAuth/central-auth.sql |
— | — | @@ -164,13 +164,3 @@ |
165 | 165 | PRIMARY KEY (ggr_group), |
166 | 166 | KEY (ggr_set) |
167 | 167 | ) /*$wgDBTableOptions*/; |
168 | | - |
169 | | -CREATE TABLE global_preferences ( |
170 | | - gp_user int(11) NOT NULL, |
171 | | - gp_key varbinary(255) NOT NULL, |
172 | | - gp_value BLOB, |
173 | | - |
174 | | - PRIMARY KEY (up_user,up_property), |
175 | | - KEY (up_property) |
176 | | -) /*$wgDBTableOptions*/; |
Index: trunk/extensions/CentralAuth/db_patches/patch-global_properties.sql |
— | — | @@ -1,9 +0,0 @@ |
2 | | -CREATE TABLE global_user_properties ( |
3 | | - gp_user int NOT NULL, |
4 | | - gp_property varbinary(255) NOT NULL, |
5 | | - gp_value BLOB, |
6 | | - |
7 | | - PRIMARY KEY (gp_user,gp_property), |
8 | | - KEY (gp_property) |
9 | | -) /*$wgDBTableOptions*/; |
Index: trunk/extensions/CentralAuth/CentralAuthUser.php |
— | — | @@ -18,7 +18,7 @@ |
19 | 19 | */ |
20 | 20 | /*private*/ var $mName; |
21 | 21 | /*private*/ var $mStateDirty = false; |
22 | | - /*private*/ var $mVersion = 3; |
| 22 | + /*private*/ var $mVersion = 2; |
23 | 23 | /*private*/ var $mDelayInvalidation = 0; |
24 | 24 | |
25 | 25 | static $mCacheVars = array( |
— | — | @@ -33,7 +33,6 @@ |
34 | 34 | 'mAuthenticationTimestamp', |
35 | 35 | 'mGroups', |
36 | 36 | 'mRights', |
37 | | - 'mProperties', |
38 | 37 | |
39 | 38 | # Store the string list instead of the array, to save memory, and |
40 | 39 | # avoid unserialize() overhead |
— | — | @@ -90,11 +89,9 @@ |
91 | 90 | */ |
92 | 91 | protected function resetState() { |
93 | 92 | unset( $this->mGlobalId ); |
94 | | - unset( $this->mProperties ); |
95 | 93 | unset( $this->mGroups ); |
96 | 94 | unset( $this->mAttachedArray ); |
97 | 95 | unset( $this->mAttachedList ); |
98 | | - unset( $this->mProperties ); |
99 | 96 | } |
100 | 97 | |
101 | 98 | /** |
— | — | @@ -192,89 +189,6 @@ |
193 | 190 | $this->mRights = $rights; |
194 | 191 | $this->mGroups = array_keys($groups); |
195 | 192 | } |
196 | | - |
197 | | - /** |
198 | | - * Load user properties from the database. |
199 | | - */ |
200 | | - protected function loadProperties() { |
201 | | - if ( isset($this->mProperties) ) return; |
202 | | - |
203 | | - wfDebugLog( 'CentralAuth', "Loading properties for global user {$this->mName}" ); |
204 | | - |
205 | | - $dbr = self::getCentralDB(); |
206 | | - |
207 | | - $res = $dbr->select( |
208 | | - 'global_user_properties', array( 'gp_property', 'gp_value' ), |
209 | | - array( 'gp_user' => $this->getId() ), __METHOD__ ); |
210 | | - |
211 | | - $properties = array(); |
212 | | - |
213 | | - while( $row = $dbr->fetchObject( $res ) ) { |
214 | | - $properties[$row->gp_property] = $row->gp_value; |
215 | | - } |
216 | | - |
217 | | - $this->mProperties = $properties; |
218 | | - } |
219 | | - |
220 | | - function saveProperties() { |
221 | | - $this->loadProperties(); |
222 | | - $dbw = self::getCentralDB(); |
223 | | - |
224 | | - $insert_rows = array(); |
225 | | - |
226 | | - global $wgCentralAuthPropertySaveWhitelist; |
227 | | - foreach( $this->mProperties as $key => $value ) { |
228 | | - if ( ( is_null(User::getDefaultOption($key)) && |
229 | | - !( $value === false || is_null($value) ) ) || |
230 | | - $value != User::getDefaultOption( $key ) || |
231 | | - in_array( $key, $wgCentralAuthPropertySaveWhitelist ) ) { |
232 | | - $insert_rows[] = array( |
233 | | - 'gp_user' => $this->getId(), |
234 | | - 'gp_property' => $key, |
235 | | - 'gp_value' => $value, |
236 | | - ); |
237 | | - } |
238 | | - } |
239 | | - |
240 | | - $dbw->begin(); |
241 | | - |
242 | | - $dbw->delete( 'global_user_properties', |
243 | | - array( 'gp_user' => $this->getId() ), |
244 | | - __METHOD__ ); |
245 | | - $dbw->insert( 'global_user_properties', $insert_rows, __METHOD__ ); |
246 | | - |
247 | | - $dbw->commit(); |
248 | | - |
249 | | - $this->invalidateCache(); |
250 | | - } |
251 | | - |
252 | | - function setProperty( $key, $value ) { |
253 | | - $this->loadProperties(); |
254 | | - $this->mProperties[$key] = $value; |
255 | | - $this->mStateDirty = true; |
256 | | - } |
257 | | - |
258 | | - function setProperties( $properties, $method = 'replace' ) { |
259 | | - $this->loadProperties(); |
260 | | - if ($method == 'replace') { |
261 | | - $this->mProperties = $properties; |
262 | | - } elseif ($method == 'insert') { |
263 | | - $this->mProperties = array_merge( $this->mProperties, $properties ); |
264 | | - } |
265 | | - |
266 | | - $this->mStateDirty = true; |
267 | | - } |
268 | | - |
269 | | - function getProperties() { |
270 | | - $this->loadProperties(); |
271 | | - return $this->mProperties; |
272 | | - } |
273 | | - |
274 | | - function getProperty( $name ) { |
275 | | - $properties = $this->getProperties(); |
276 | | - |
277 | | - return $properties[$name]; |
278 | | - } |
279 | 193 | |
280 | 194 | /** |
281 | 195 | * Load user state from a joined globaluser/localuser row |
— | — | @@ -351,7 +265,6 @@ |
352 | 266 | $this->loadState(); |
353 | 267 | $this->loadAttached(); |
354 | 268 | $this->loadGroups(); |
355 | | - $this->loadProperties(); |
356 | 269 | |
357 | 270 | $obj = array(); |
358 | 271 | foreach( self::$mCacheVars as $var ) { |
Index: trunk/extensions/CentralAuth/CentralAuth.php |
— | — | @@ -126,12 +126,6 @@ |
127 | 127 | $wgCentralAuthUDPAddress = false; |
128 | 128 | $wgCentralAuthNew2UDPPrefix = ''; |
129 | 129 | |
130 | | -/** Settings which will always be saved to the DB, regardless of whether or not they |
131 | | - * match the local default. This should be mainly settings whose defaults change per-wiki. |
132 | | - */ |
133 | | -$wgCentralAuthPropertySaveWhitelist = |
134 | | - array( 'language', 'variant' ); |
135 | | - |
136 | 130 | /** |
137 | 131 | * Initialization of the autoloaders, and special extension pages. |
138 | 132 | */ |
— | — | @@ -174,8 +168,6 @@ |
175 | 169 | $wgHooks['UserLoadDefaults'][] = 'CentralAuthHooks::onUserLoadDefaults'; |
176 | 170 | $wgHooks['getUserPermissionsErrorsExpensive'][] = 'CentralAuthHooks::onGetUserPermissionsErrorsExpensive'; |
177 | 171 | $wgHooks['MakeGlobalVariablesScript'][] = 'CentralAuthHooks::onMakeGlobalVariablesScript'; |
178 | | -$wgHooks['UserSaveOptions'][] = 'CentralAuthHooks::onSavePreferences'; |
179 | | -$wgHooks['UserLoadOptions'][] = 'CentralAuthHooks::onUserLoadOptions'; |
180 | 172 | |
181 | 173 | // For interaction with the Special:Renameuser extension |
182 | 174 | $wgHooks['RenameUserWarning'][] = 'CentralAuthHooks::onRenameUserWarning'; |
— | — | @@ -223,8 +215,6 @@ |
224 | 216 | $wgLogActions['gblrights/groupprms3'] = 'centralauth-rightslog-entry-groupperms3'; |
225 | 217 | foreach( array( 'newset', 'setrename', 'setnewtype', 'setchange' ) as $type ) |
226 | 218 | $wgLogActionsHandlers["gblrights/{$type}"] = 'efHandleWikiSetLogEntry'; |
227 | | - |
228 | | -$wgDefaultUserOptions['globalpreferences'] = true; |
229 | 219 | |
230 | 220 | function efHandleWikiSetLogEntry( $type, $action, $title, $skin, $params, $filterWikilinks = false ) { |
231 | 221 | wfLoadExtensionMessages('SpecialCentralAuth'); |
Index: trunk/extensions/CentralAuth/CentralAuthHooks.php |
— | — | @@ -550,35 +550,4 @@ |
551 | 551 | } |
552 | 552 | return true; |
553 | 553 | } |
554 | | - |
555 | | - static function onSavePreferences( $user, &$preferences ) { |
556 | | - $centralUser = CentralAuthUser::getInstance( $user ); |
557 | | - |
558 | | - if ($centralUser->exists() && $centralUser->isAttached() && |
559 | | - !empty($preferences['globalpreferences']) ) { |
560 | | - // Save preferences into the global account. |
561 | | - |
562 | | - $centralUser->setProperties( $preferences, 'replace' ); |
563 | | - $centralUser->saveProperties(); |
564 | | - |
565 | | - $preferences = array( 'globalpreferences' => true ); |
566 | | - |
567 | | - return true; |
568 | | - } |
569 | | - |
570 | | - return true; |
571 | | - } |
572 | | - |
573 | | - static function onUserLoadOptions( $user, &$preferences ) { |
574 | | - $centralUser = CentralAuthUser::getInstance( $user ); |
575 | | - if ($centralUser->exists() && $centralUser->isAttached() && |
576 | | - !empty($preferences['globalpreferences']) ) { |
577 | | - // Pull preferences from global account |
578 | | - |
579 | | - $preferences = array_merge( $preferences, $centralUser->getProperties() ); |
580 | | - $preferences['globalpreferences'] = true; |
581 | | - } |
582 | | - |
583 | | - return true; |
584 | | - } |
585 | 554 | } |
Index: trunk/extensions/CentralAuth/CentralAuth.i18n.php |
— | — | @@ -196,7 +196,6 @@ |
197 | 197 | 'centralauth-prefs-count-unattached' => 'Unconfirmed accounts with your name remain on $1 {{PLURAL:$1|project|projects}}.', |
198 | 198 | 'centralauth-prefs-detail-unattached' => 'This project site has not been confirmed as belonging to the global account.', |
199 | 199 | 'centralauth-prefs-manage' => 'Manage your global account', |
200 | | - 'centralauth-prefs-global' => 'Use these preferences on all projects', |
201 | 200 | |
202 | 201 | // Interaction with Special:Renameuser |
203 | 202 | 'centralauth-renameuser-merged' => "User $1 has been migrated to the unified login system. |