Index: includes/DefaultSettings.php =================================================================== --- includes/DefaultSettings.php (revision 50673) +++ includes/DefaultSettings.php (working copy) @@ -2496,8 +2496,8 @@ 'disablemail' => 0, ); -/** Whether or not to allow and use real name fields. Defaults to true. */ -$wgAllowRealName = true; +/** An array of preferences to not show for the user */ +$wgHiddenPrefs = array(); /***************************************************************************** * Extensions Index: includes/Preferences.php =================================================================== --- includes/Preferences.php (revision 50674) +++ includes/Preferences.php (working copy) @@ -29,6 +29,14 @@ wfRunHooks( 'GetPreferences', array( $user, &$defaultPreferences ) ); + ## Remove preferences that wikis don't want to use + global $wgHiddenPrefs; + foreach ( $wgHiddenPrefs as $pref ) { + if ( isset( $defaultPreferences[$pref] ) ) { + unset( $defaultPreferences[ $pref ] ); + } + } + ## Prod in defaults from the user global $wgDefaultUserOptions; foreach( $defaultPreferences as $name => &$info ) { @@ -138,19 +146,16 @@ } // Actually changeable stuff - global $wgAllowRealName, $wgAuth; - if ($wgAllowRealName) { - $defaultPreferences['realname'] = - array( - 'type' => $wgAuth->allowRealNameChange() ? 'text' : 'info', - 'default' => $user->getRealName(), - 'section' => 'personal/info', - 'label-message' => 'yourrealname', - 'help-message' => 'prefs-help-realname', - ); - } + global $wgAuth; + $defaultPreferences['realname'] = + array( + 'type' => $wgAuth->allowRealNameChange() ? 'text' : 'info', + 'default' => $user->getRealName(), + 'section' => 'personal/info', + 'label-message' => 'yourrealname', + 'help-message' => 'prefs-help-realname', + ); - $defaultPreferences['gender'] = array( 'type' => 'select', Index: includes/Setup.php =================================================================== --- includes/Setup.php (revision 50673) +++ includes/Setup.php (working copy) @@ -201,6 +201,12 @@ # If file cache or squid cache is on, just disable this (DWIMD). if( $wgUseFileCache || $wgUseSquid ) $wgShowIPinHeader = false; +# $wgAllowRealName was removed in 1.15 in favor of $wgHiddenPrefs, +# handle b/c here +if( isset( $wgAllowRealName ) && !$wgAllowRealName ) { + $wgHiddenPrefs[] = 'realname'; +} + wfProfileOut( $fname.'-misc1' ); wfProfileIn( $fname.'-memcached' ); Index: RELEASE-NOTES =================================================================== --- RELEASE-NOTES (revision 50673) +++ RELEASE-NOTES (working copy) @@ -24,6 +24,10 @@ * $wgSessionHandler can be used to configure session.save_handler * $wgLocalFileRepo/$wgForeignFileRepos now have a 'fileMode' parameter to 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 === New features in 1.16 ===