Index: trunk/phase3/includes/User.php |
— | — | @@ -2149,16 +2149,18 @@ |
2150 | 2150 | * @todo FIXME : need to check the old failback system [AV] |
2151 | 2151 | */ |
2152 | 2152 | function &getSkin( $t = null ) { |
2153 | | - global $wgRequest, $wgAllowUserSkin, $wgDefaultSkin; |
2154 | 2153 | if ( ! isset( $this->mSkin ) ) { |
2155 | 2154 | wfProfileIn( __METHOD__ ); |
2156 | 2155 | |
2157 | | - if( $wgAllowUserSkin ) { |
| 2156 | + global $wgHiddenPrefs; |
| 2157 | + if( !in_array( 'skin', $wgHiddenPrefs ) ) { |
2158 | 2158 | # get the user skin |
| 2159 | + global $wgRequest; |
2159 | 2160 | $userSkin = $this->getOption( 'skin' ); |
2160 | 2161 | $userSkin = $wgRequest->getVal('useskin', $userSkin); |
2161 | 2162 | } else { |
2162 | 2163 | # if we're not allowing users to override, then use the default |
| 2164 | + global $wgDefaultSkin; |
2163 | 2165 | $userSkin = $wgDefaultSkin; |
2164 | 2166 | } |
2165 | 2167 | |
Index: trunk/phase3/includes/Setup.php |
— | — | @@ -201,12 +201,16 @@ |
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 |
| 205 | +# $wgAllowRealName and $wgAllowUserSkin were removed in 1.16 |
| 206 | +# in favor of $wgHiddenPrefs, handle b/c here |
207 | 207 | if( !$wgAllowRealName ) { |
208 | 208 | $wgHiddenPrefs[] = 'realname'; |
209 | 209 | } |
210 | 210 | |
| 211 | +if( !$wgAllowUserSkin ) { |
| 212 | + $wgHiddenPrefs[] = 'skin'; |
| 213 | +} |
| 214 | + |
211 | 215 | wfProfileOut( $fname.'-misc1' ); |
212 | 216 | wfProfileIn( $fname.'-memcached' ); |
213 | 217 | |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -2398,7 +2398,10 @@ |
2399 | 2399 | /** See list of skins and their symbolic names in languages/Language.php */ |
2400 | 2400 | $wgDefaultSkin = 'monobook'; |
2401 | 2401 | |
2402 | | -/** Should we allow the user's to select their own skin that will override the default? */ |
| 2402 | +/** |
| 2403 | +* Should we allow the user's to select their own skin that will override the default? |
| 2404 | +* @deprecated in 1.16, use $wgHiddenPrefs[] = 'skin' to disable it |
| 2405 | +*/ |
2403 | 2406 | $wgAllowUserSkin = true; |
2404 | 2407 | |
2405 | 2408 | /** |
Index: trunk/phase3/includes/specials/SpecialUserlogin.php |
— | — | @@ -44,7 +44,7 @@ |
45 | 45 | * @param WebRequest $request A WebRequest object passed by reference |
46 | 46 | */ |
47 | 47 | function LoginForm( &$request, $par = '' ) { |
48 | | - global $wgLang, $wgAllowRealName, $wgEnableEmail; |
| 48 | + global $wgLang, $wgHiddenPrefs, $wgEnableEmail; |
49 | 49 | global $wgAuth, $wgRedirectOnLogin; |
50 | 50 | |
51 | 51 | $this->mType = ( $par == 'signup' ) ? $par : $request->getText( 'type' ); # Check for [[Special:Userlogin/signup]] |
— | — | @@ -75,7 +75,7 @@ |
76 | 76 | } else { |
77 | 77 | $this->mEmail = ''; |
78 | 78 | } |
79 | | - if( $wgAllowRealName ) { |
| 79 | + if( !in_array( 'realname', $wgHiddenPrefs ) ) { |
80 | 80 | $this->mRealName = $request->getText( 'wpRealName' ); |
81 | 81 | } else { |
82 | 82 | $this->mRealName = ''; |
— | — | @@ -798,7 +798,7 @@ |
799 | 799 | * @private |
800 | 800 | */ |
801 | 801 | function mainLoginForm( $msg, $msgtype = 'error' ) { |
802 | | - global $wgUser, $wgOut, $wgAllowRealName, $wgEnableEmail; |
| 802 | + global $wgUser, $wgOut, $wgHiddenPrefs, $wgEnableEmail; |
803 | 803 | global $wgCookiePrefix, $wgLoginLanguageSelector; |
804 | 804 | global $wgAuth, $wgEmailConfirmToEdit, $wgCookieExpiration; |
805 | 805 | |
— | — | @@ -874,7 +874,7 @@ |
875 | 875 | $template->set( 'message', $msg ); |
876 | 876 | $template->set( 'messagetype', $msgtype ); |
877 | 877 | $template->set( 'createemail', $wgEnableEmail && $wgUser->isLoggedIn() ); |
878 | | - $template->set( 'userealname', $wgAllowRealName ); |
| 878 | + $template->set( 'userealname', !in_array( 'realname', $wgHiddenPrefs ) ); |
879 | 879 | $template->set( 'useemail', $wgEnableEmail ); |
880 | 880 | $template->set( 'emailrequired', $wgEmailConfirmToEdit ); |
881 | 881 | $template->set( 'canreset', $wgAuth->allowPasswordChange() ); |
Index: trunk/phase3/includes/Credits.php |
— | — | @@ -75,7 +75,7 @@ |
76 | 76 | * @param $article Article object |
77 | 77 | */ |
78 | 78 | protected static function getAuthor( Article $article ){ |
79 | | - global $wgLang, $wgAllowRealName; |
| 79 | + global $wgLang; |
80 | 80 | |
81 | 81 | $user = User::newFromId( $article->getUser() ); |
82 | 82 | |
— | — | @@ -98,7 +98,7 @@ |
99 | 99 | * @return String: html |
100 | 100 | */ |
101 | 101 | protected static function getContributors( Article $article, $cnt, $showIfMax ) { |
102 | | - global $wgLang, $wgAllowRealName; |
| 102 | + global $wgLang, $wgHiddenPrefs; |
103 | 103 | |
104 | 104 | $contributors = $article->getContributors(); |
105 | 105 | |
— | — | @@ -120,7 +120,7 @@ |
121 | 121 | $cnt--; |
122 | 122 | if( $user->isLoggedIn() ){ |
123 | 123 | $link = self::link( $user ); |
124 | | - if( $wgAllowRealName && $user->getRealName() ) |
| 124 | + if( !in_array( 'realname', $wgHiddenPrefs ) && $user->getRealName() ) |
125 | 125 | $real_names[] = $link; |
126 | 126 | else |
127 | 127 | $user_names[] = $link; |
— | — | @@ -162,15 +162,15 @@ |
163 | 163 | * @return String: html |
164 | 164 | */ |
165 | 165 | protected static function link( User $user ) { |
166 | | - global $wgUser, $wgAllowRealName; |
167 | | - if( $wgAllowRealName ) |
| 166 | + global $wgHiddenPrefs; |
| 167 | + if( !in_array( 'realname', $wgHiddenPrefs ) ) |
168 | 168 | $real = $user->getRealName(); |
169 | 169 | else |
170 | 170 | $real = false; |
171 | 171 | |
172 | | - $skin = $wgUser->getSkin(); |
| 172 | + $skin = $user->getSkin(); |
173 | 173 | $page = $user->getUserPage(); |
174 | | - |
| 174 | + |
175 | 175 | return $skin->link( $page, htmlspecialchars( $real ? $real : $user->getName() ) ); |
176 | 176 | } |
177 | 177 | |
— | — | @@ -181,12 +181,12 @@ |
182 | 182 | * @return String: html |
183 | 183 | */ |
184 | 184 | protected static function userLink( User $user ) { |
185 | | - global $wgUser, $wgAllowRealName; |
186 | 185 | if( $user->isAnon() ){ |
187 | 186 | return wfMsgExt( 'anonymous', array( 'parseinline' ), 1 ); |
188 | 187 | } else { |
| 188 | + global $wgHiddenPrefs; |
189 | 189 | $link = self::link( $user ); |
190 | | - if( $wgAllowRealName && $user->getRealName() ) |
| 190 | + if( !in_array( 'realname', $wgHiddenPrefs ) && $user->getRealName() ) |
191 | 191 | return $link; |
192 | 192 | else |
193 | 193 | return wfMsgExt( 'siteuser', array( 'parseinline', 'replaceafter' ), $link ); |
Index: trunk/phase3/includes/Preferences.php |
— | — | @@ -379,20 +379,17 @@ |
380 | 380 | |
381 | 381 | static function skinPreferences( $user, &$defaultPreferences ) { |
382 | 382 | ## Skin ##################################### |
383 | | - global $wgAllowUserSkin, $wgLang; |
| 383 | + $defaultPreferences['skin'] = |
| 384 | + array( |
| 385 | + 'type' => 'radio', |
| 386 | + 'options' => self::generateSkinOptions( $user ), |
| 387 | + 'label' => ' ', |
| 388 | + 'section' => 'rendering/skin', |
| 389 | + ); |
384 | 390 | |
385 | | - if ($wgAllowUserSkin) { |
386 | | - $defaultPreferences['skin'] = |
387 | | - array( |
388 | | - 'type' => 'radio', |
389 | | - 'options' => self::generateSkinOptions( $user ), |
390 | | - 'label' => ' ', |
391 | | - 'section' => 'rendering/skin', |
392 | | - ); |
393 | | - } |
394 | | - |
395 | 391 | $selectedSkin = $user->getOption( 'skin' ); |
396 | 392 | if ( in_array( $selectedSkin, array( 'cologneblue', 'standard' ) ) ) { |
| 393 | + global $wgLang; |
397 | 394 | $settings = array_flip($wgLang->getQuickbarSettings()); |
398 | 395 | |
399 | 396 | $defaultPreferences['quickbar'] = |
— | — | @@ -1151,8 +1148,8 @@ |
1152 | 1149 | } |
1153 | 1150 | |
1154 | 1151 | // Fortunately, the realname field is MUCH simpler |
1155 | | - global $wgAllowRealName; |
1156 | | - if ($wgAllowRealName) { |
| 1152 | + global $wgHiddenPrefs; |
| 1153 | + if ( !in_array( 'realname', $wgHiddenPrefs ) ) { |
1157 | 1154 | $realName = $formData['realname']; |
1158 | 1155 | $wgUser->setRealName( $realName ); |
1159 | 1156 | } |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -26,8 +26,9 @@ |
27 | 27 | be used when uploading/moving files |
28 | 28 | * (bug 18761) $wgHiddenPrefs is a new array for specifying preferences not |
29 | 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 |
| 30 | +* $wgAllowRealName and $wgAllowUserSkin were deprecated in favor of |
| 31 | + $wgHiddenPrefs[] = 'realname', but the former are still retained |
| 32 | + for backwards-compatibility |
32 | 33 | * (bug 9257) $wgRCMaxAge now defaults to three months |
33 | 34 | * $wgDevelopmentWarnings can be set to true to show warnings about deprecated |
34 | 35 | functions and other potential errors when developing. |