be used when uploading/moving files
* (bug 18761) $wgHiddenPrefs is a new array for specifying preferences not
to be shown to users
-* $wgAllowRealName was deprecated in favor of $wgHiddenPrefs[] = 'realname',
- but the former is still retained for backwards-compatibility
+* $wgAllowRealName and $wgAllowUserSkin were deprecated in favor of
+ $wgHiddenPrefs[] = 'realname', but the former are still retained
+ for backwards-compatibility
* (bug 9257) $wgRCMaxAge now defaults to three months
* $wgDevelopmentWarnings can be set to true to show warnings about deprecated
functions and other potential errors when developing.
* @param $article Article object
*/
protected static function getAuthor( Article $article ){
- global $wgLang, $wgAllowRealName;
+ global $wgLang;
$user = User::newFromId( $article->getUser() );
* @return String: html
*/
protected static function getContributors( Article $article, $cnt, $showIfMax ) {
- global $wgLang, $wgAllowRealName;
+ global $wgLang, $wgHiddenPrefs;
$contributors = $article->getContributors();
$cnt--;
if( $user->isLoggedIn() ){
$link = self::link( $user );
- if( $wgAllowRealName && $user->getRealName() )
+ if( !in_array( 'realname', $wgHiddenPrefs ) && $user->getRealName() )
$real_names[] = $link;
else
$user_names[] = $link;
* @return String: html
*/
protected static function link( User $user ) {
- global $wgUser, $wgAllowRealName;
- if( $wgAllowRealName )
+ global $wgHiddenPrefs;
+ if( !in_array( 'realname', $wgHiddenPrefs ) )
$real = $user->getRealName();
else
$real = false;
- $skin = $wgUser->getSkin();
+ $skin = $user->getSkin();
$page = $user->getUserPage();
-
+
return $skin->link( $page, htmlspecialchars( $real ? $real : $user->getName() ) );
}
* @return String: html
*/
protected static function userLink( User $user ) {
- global $wgUser, $wgAllowRealName;
if( $user->isAnon() ){
return wfMsgExt( 'anonymous', array( 'parseinline' ), 1 );
} else {
+ global $wgHiddenPrefs;
$link = self::link( $user );
- if( $wgAllowRealName && $user->getRealName() )
+ if( !in_array( 'realname', $wgHiddenPrefs ) && $user->getRealName() )
return $link;
else
return wfMsgExt( 'siteuser', array( 'parseinline', 'replaceafter' ), $link );
/** 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? */
+/**
+* Should we allow the user's to select their own skin that will override the default?
+* @deprecated in 1.16, use $wgHiddenPrefs[] = 'skin' to disable it
+*/
$wgAllowUserSkin = true;
/**
static function skinPreferences( $user, &$defaultPreferences ) {
## Skin #####################################
- global $wgAllowUserSkin, $wgLang;
-
- if ($wgAllowUserSkin) {
- $defaultPreferences['skin'] =
- array(
- 'type' => 'radio',
- 'options' => self::generateSkinOptions( $user ),
- 'label' => ' ',
- 'section' => 'rendering/skin',
- );
- }
+ $defaultPreferences['skin'] =
+ array(
+ 'type' => 'radio',
+ 'options' => self::generateSkinOptions( $user ),
+ 'label' => ' ',
+ 'section' => 'rendering/skin',
+ );
$selectedSkin = $user->getOption( 'skin' );
if ( in_array( $selectedSkin, array( 'cologneblue', 'standard' ) ) ) {
+ global $wgLang;
$settings = array_flip($wgLang->getQuickbarSettings());
$defaultPreferences['quickbar'] =
}
// Fortunately, the realname field is MUCH simpler
- global $wgAllowRealName;
- if ($wgAllowRealName) {
+ global $wgHiddenPrefs;
+ if ( !in_array( 'realname', $wgHiddenPrefs ) ) {
$realName = $formData['realname'];
$wgUser->setRealName( $realName );
}
# If file cache or squid cache is on, just disable this (DWIMD).
if( $wgUseFileCache || $wgUseSquid ) $wgShowIPinHeader = false;
-# $wgAllowRealName was removed in 1.16 in favor of $wgHiddenPrefs,
-# handle b/c here
+# $wgAllowRealName and $wgAllowUserSkin were removed in 1.16
+# in favor of $wgHiddenPrefs, handle b/c here
if( !$wgAllowRealName ) {
$wgHiddenPrefs[] = 'realname';
}
+if( !$wgAllowUserSkin ) {
+ $wgHiddenPrefs[] = 'skin';
+}
+
wfProfileOut( $fname.'-misc1' );
wfProfileIn( $fname.'-memcached' );
* @todo FIXME : need to check the old failback system [AV]
*/
function &getSkin( $t = null ) {
- global $wgRequest, $wgAllowUserSkin, $wgDefaultSkin;
if ( ! isset( $this->mSkin ) ) {
wfProfileIn( __METHOD__ );
- if( $wgAllowUserSkin ) {
+ global $wgHiddenPrefs;
+ if( !in_array( 'skin', $wgHiddenPrefs ) ) {
# get the user skin
+ global $wgRequest;
$userSkin = $this->getOption( 'skin' );
$userSkin = $wgRequest->getVal('useskin', $userSkin);
} else {
# if we're not allowing users to override, then use the default
+ global $wgDefaultSkin;
$userSkin = $wgDefaultSkin;
}
* @param WebRequest $request A WebRequest object passed by reference
*/
function LoginForm( &$request, $par = '' ) {
- global $wgLang, $wgAllowRealName, $wgEnableEmail;
+ global $wgLang, $wgHiddenPrefs, $wgEnableEmail;
global $wgAuth, $wgRedirectOnLogin;
$this->mType = ( $par == 'signup' ) ? $par : $request->getText( 'type' ); # Check for [[Special:Userlogin/signup]]
} else {
$this->mEmail = '';
}
- if( $wgAllowRealName ) {
+ if( !in_array( 'realname', $wgHiddenPrefs ) ) {
$this->mRealName = $request->getText( 'wpRealName' );
} else {
$this->mRealName = '';
* @private
*/
function mainLoginForm( $msg, $msgtype = 'error' ) {
- global $wgUser, $wgOut, $wgAllowRealName, $wgEnableEmail;
+ global $wgUser, $wgOut, $wgHiddenPrefs, $wgEnableEmail;
global $wgCookiePrefix, $wgLoginLanguageSelector;
global $wgAuth, $wgEmailConfirmToEdit, $wgCookieExpiration;
$template->set( 'message', $msg );
$template->set( 'messagetype', $msgtype );
$template->set( 'createemail', $wgEnableEmail && $wgUser->isLoggedIn() );
- $template->set( 'userealname', $wgAllowRealName );
+ $template->set( 'userealname', !in_array( 'realname', $wgHiddenPrefs ) );
$template->set( 'useemail', $wgEnableEmail );
$template->set( 'emailrequired', $wgEmailConfirmToEdit );
$template->set( 'canreset', $wgAuth->allowPasswordChange() );