Added a new configuration option: $wgAllowUserSkin
authorCharles Melbye <charlie@users.mediawiki.org>
Sat, 1 Nov 2008 04:39:31 +0000 (04:39 +0000)
committerCharles Melbye <charlie@users.mediawiki.org>
Sat, 1 Nov 2008 04:39:31 +0000 (04:39 +0000)
RELEASE-NOTES
includes/DefaultSettings.php
includes/User.php

index aa9e55f..3e609f7 100644 (file)
@@ -53,6 +53,9 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   write actions using the API.
 * Added $wgRC2UDPInterwikiPrefix which adds an interwiki prefix
   ($wgLocalInterwiki) onto the page names in the UDP feed.
+* Added $wgAllowUserSkin to let the wiki's owner disable user selectable skins
+  on the wiki. If it's set to true, then the skin used will *always* be
+  $wgDefaultSkin.
 
 === Migrated extensions ===
 The following extensions are migrated into MediaWiki 1.14:
index 7fa87da..75bc1ed 100644 (file)
@@ -2222,6 +2222,9 @@ $wgValidateAllHtml = false;
 /** See list of skins and their symbolic names in languages/Language.php */
 $wgDefaultSkin = 'monobook';
 
+/** Should we allow the user's to select their own skin that will override the default? */
+$wgAllowUserSkin = true;
+
 /**
  * Optionally, we can specify a stylesheet to use for media="handheld".
  * This is recognized by some, but not all, handheld/mobile/PDA browsers.
index 1cfd8d5..13ed0be 100644 (file)
@@ -2104,12 +2104,19 @@ class User {
         * @todo FIXME : need to check the old failback system [AV]
         */
        function &getSkin() {
-               global $wgRequest;
+               global $wgRequest, $wgAllowUserSkin, $wgDefaultSkin;
                if ( ! isset( $this->mSkin ) ) {
                        wfProfileIn( __METHOD__ );
 
-                       # get the user skin
-                       $userSkin = $this->getOption( 'skin' );
+                       if( $wgAllowUserSkin ) {
+                               # get the user skin
+                               $userSkin = $this->getOption( 'skin' );
+                       } 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 );