Made it so that users can't test out skins if user skins are disabled (per
authorCharles Melbye <charlie@users.mediawiki.org>
Sat, 1 Nov 2008 06:09:08 +0000 (06:09 +0000)
committerCharles Melbye <charlie@users.mediawiki.org>
Sat, 1 Nov 2008 06:09:08 +0000 (06:09 +0000)
Werdna), and user skin selection has now been disabled on the preferences
special page, with a notice on top telling why that happened.

includes/User.php
includes/specials/SpecialPreferences.php
languages/messages/MessagesEn.php

index 13ed0be..00dcb4f 100644 (file)
@@ -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__ );
                }
index b18a9fa..bc9dbc9 100644 (file)
@@ -834,6 +834,12 @@ class PreferencesForm {
 
                # Skin
                #
+               global $wgAllowUserSkin;
+               
+               if( !$wgAllowUserSkin ) {
+                       $wgOut->addHTML( "<p><em>" . wfMsg('skin-override') . "</em></p>" );
+               }
+               
                $wgOut->addHTML( "<fieldset>\n<legend>\n" . wfMsg('skin') . "</legend>\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 = "(<a target='_blank' href=\"$mplink\">$previewtext</a>)";
index 32de666..0797299 100644 (file)
@@ -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',