Page Menu
Home
Phabricator
Suche
Configure Global Search
Log In
Files
F5677
diff.patch
Public
Actions
View File
Edit File
Delete File
View Transforms
Abonnieren
Mute Notifications
Award Token
Flag For Later
Authored By
•
bzimport
Nov 21 2014, 10:36 PM
2014-11-21 22:36:43 (UTC+0)
Size
3 KB
Referenced Files
None
Subscribers
None
diff.patch
View Options
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 ===
File Metadata
Details
Attached
Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5227
Default Alt Text
diff.patch (3 KB)
Attached To
Mode
T20761: Add setting to hide a list of preferences
Attached
Detach File
Event Timeline
Log In to Comment