From: Charles Melbye Date: Sat, 1 Nov 2008 06:09:08 +0000 (+0000) Subject: Made it so that users can't test out skins if user skins are disabled (per X-Git-Tag: 1.31.0-rc.0~44489 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dcompta/operations/modifier.php?a=commitdiff_plain;h=3eeefca79a5c93c3d1c6ca03a3ce1a6e9fcdb9b3;p=lhc%2Fweb%2Fwiklou.git Made it so that users can't test out skins if user skins are disabled (per Werdna), and user skin selection has now been disabled on the preferences special page, with a notice on top telling why that happened. --- diff --git a/includes/User.php b/includes/User.php index 13ed0be939..00dcb4f8c1 100644 --- a/includes/User.php +++ b/includes/User.php @@ -2111,14 +2111,12 @@ class User { if( $wgAllowUserSkin ) { # get the user skin $userSkin = $this->getOption( 'skin' ); + $userSkin = $wgRequest->getVal('useskin', $userSkin); } else { # if we're not allowing users to override, then use the default $userSkin = $wgDefaultSkin; } - # we'll allow skin "testing" regardless of the AllowUserSkin option - $userSkin = $wgRequest->getVal('useskin', $userSkin); - $this->mSkin =& Skin::newFromKey( $userSkin ); wfProfileOut( __METHOD__ ); } diff --git a/includes/specials/SpecialPreferences.php b/includes/specials/SpecialPreferences.php index b18a9fa0b9..bc9dbc9d31 100644 --- a/includes/specials/SpecialPreferences.php +++ b/includes/specials/SpecialPreferences.php @@ -834,6 +834,12 @@ class PreferencesForm { # Skin # + global $wgAllowUserSkin; + + if( !$wgAllowUserSkin ) { + $wgOut->addHTML( "

" . wfMsg('skin-override') . "

" ); + } + $wgOut->addHTML( "
\n\n" . wfMsg('skin') . "\n" ); $mptitle = Title::newMainPage(); $previewtext = wfMsg('skin-preview'); @@ -850,6 +856,8 @@ class PreferencesForm { asort($validSkinNames); foreach ($validSkinNames as $skinkey => $sn ) { $checked = $skinkey == $this->mSkin ? ' checked="checked"' : ''; + + $checked = $wgAllowUserSkin ? $checked . '' : $checked . ' disabled=\'disabled\''; $mplink = htmlspecialchars($mptitle->getLocalURL("useskin=$skinkey")); $previewlink = "($previewtext)"; diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 32de666c94..07972996fa 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -1493,6 +1493,7 @@ Note that their indexes of {{SITENAME}} content may be out of date.', 'qbsettings-floatingright' => 'Floating right', 'changepassword' => 'Change password', 'skin' => 'Skin', +'skin-override' => 'This form has been disabled, because this wiki overrides user skin settings with the default skin set by the administrator.', 'skin-preview' => 'Preview', 'math' => 'Math', 'dateformat' => 'Date format',