From f94d44dfe9f5c7b60ba2af4bed74e43ed1e8960e Mon Sep 17 00:00:00 2001 From: Charles Melbye Date: Sat, 1 Nov 2008 04:39:31 +0000 Subject: [PATCH] Added a new configuration option: $wgAllowUserSkin --- RELEASE-NOTES | 3 +++ includes/DefaultSettings.php | 3 +++ includes/User.php | 13 ++++++++++--- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index aa9e55fd90..3e609f7498 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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: diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 7fa87dab7a..75bc1ed7e9 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -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. diff --git a/includes/User.php b/includes/User.php index 1cfd8d5e07..13ed0be939 100644 --- a/includes/User.php +++ b/includes/User.php @@ -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 ); -- 2.20.1