Index: trunk/phase3/includes/Setup.php |
— | — | @@ -201,6 +201,12 @@ |
202 | 202 | # If file cache or squid cache is on, just disable this (DWIMD). |
203 | 203 | if( $wgUseFileCache || $wgUseSquid ) $wgShowIPinHeader = false; |
204 | 204 | |
| 205 | +# $wgAllowRealName was removed in 1.16 in favor of $wgHiddenPrefs, |
| 206 | +# handle b/c here |
| 207 | +if( !$wgAllowRealName ) { |
| 208 | + $wgHiddenPrefs[] = 'realname'; |
| 209 | +} |
| 210 | + |
205 | 211 | wfProfileOut( $fname.'-misc1' ); |
206 | 212 | wfProfileIn( $fname.'-memcached' ); |
207 | 213 | |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -2496,9 +2496,15 @@ |
2497 | 2497 | 'disablemail' => 0, |
2498 | 2498 | ); |
2499 | 2499 | |
2500 | | -/** Whether or not to allow and use real name fields. Defaults to true. */ |
| 2500 | +/** |
| 2501 | + * Whether or not to allow and use real name fields. |
| 2502 | + * @deprecated in 1.16, use $wgHiddenPrefs[] = 'realname' below |
| 2503 | + */ |
2501 | 2504 | $wgAllowRealName = true; |
2502 | 2505 | |
| 2506 | +/** An array of preferences to not show for the user */ |
| 2507 | +$wgHiddenPrefs = array(); |
| 2508 | + |
2503 | 2509 | /***************************************************************************** |
2504 | 2510 | * Extensions |
2505 | 2511 | */ |
Index: trunk/phase3/includes/Preferences.php |
— | — | @@ -29,6 +29,14 @@ |
30 | 30 | |
31 | 31 | wfRunHooks( 'GetPreferences', array( $user, &$defaultPreferences ) ); |
32 | 32 | |
| 33 | + ## Remove preferences that wikis don't want to use |
| 34 | + global $wgHiddenPrefs; |
| 35 | + foreach ( $wgHiddenPrefs as $pref ) { |
| 36 | + if ( isset( $defaultPreferences[$pref] ) ) { |
| 37 | + unset( $defaultPreferences[ $pref ] ); |
| 38 | + } |
| 39 | + } |
| 40 | + |
33 | 41 | ## Prod in defaults from the user |
34 | 42 | global $wgDefaultUserOptions; |
35 | 43 | foreach( $defaultPreferences as $name => &$info ) { |
— | — | @@ -138,19 +146,16 @@ |
139 | 147 | } |
140 | 148 | |
141 | 149 | // Actually changeable stuff |
142 | | - global $wgAllowRealName, $wgAuth; |
143 | | - if ($wgAllowRealName) { |
144 | | - $defaultPreferences['realname'] = |
145 | | - array( |
146 | | - 'type' => $wgAuth->allowPropChange( 'realname' ) ? 'text' : 'info', |
147 | | - 'default' => $user->getRealName(), |
148 | | - 'section' => 'personal/info', |
149 | | - 'label-message' => 'yourrealname', |
150 | | - 'help-message' => 'prefs-help-realname', |
151 | | - ); |
152 | | - } |
153 | | - |
154 | | - |
| 150 | + global $wgAuth; |
| 151 | + $defaultPreferences['realname'] = |
| 152 | + array( |
| 153 | + 'type' => $wgAuth->allowPropChange( 'realname' ) ? 'text' : 'info', |
| 154 | + 'default' => $user->getRealName(), |
| 155 | + 'section' => 'personal/info', |
| 156 | + 'label-message' => 'yourrealname', |
| 157 | + 'help-message' => 'prefs-help-realname', |
| 158 | + ); |
| 159 | + |
155 | 160 | $defaultPreferences['gender'] = |
156 | 161 | array( |
157 | 162 | 'type' => 'select', |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -24,6 +24,10 @@ |
25 | 25 | * $wgSessionHandler can be used to configure session.save_handler |
26 | 26 | * $wgLocalFileRepo/$wgForeignFileRepos now have a 'fileMode' parameter to |
27 | 27 | be used when uploading/moving files |
| 28 | +* (bug 18761) $wgHiddenPrefs is a new array for specifying preferences not |
| 29 | + to be shown to users |
| 30 | +* $wgAllowRealName was deprecated in favor of $wgHiddenPrefs[] = 'realname', |
| 31 | + but the former is still retained for backwards-compatibility |
28 | 32 | |
29 | 33 | === New features in 1.16 === |
30 | 34 | |