From 7c80a6cfd04308a8da467906b27c07affee5ced4 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Sat, 2 Aug 2008 13:06:08 +0000 Subject: [PATCH] Fixes for r38424: * $wgAddGroups[$group] can be true if the user can add all rights, show this in Special:ListGroupRights * added messages to messages.inc Somehow related: * Setting $wgAddGroups = $wgRemoveGroups = array(); in DefaultSettings.php seems to put a reference between these two variables. --- includes/DefaultSettings.php | 4 ++-- includes/specials/SpecialListgrouprights.php | 8 ++++++-- languages/messages/MessagesEn.php | 20 +++++++++++--------- maintenance/language/messages.inc | 4 ++++ 4 files changed, 23 insertions(+), 13 deletions(-) diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index d16af0ef9d..f83fa7a659 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -1301,8 +1301,8 @@ $wgAutopromote = array( * // Sysops can disable other sysops in an emergency, and disable bots * $wgRemoveGroups['sysop'] = array( 'sysop', 'bot' ); */ -$wgAddGroups = $wgRemoveGroups = array(); - +$wgAddGroups = array(); +$wgRemoveGroups = array(); /** * A list of available rights, in addition to the ones defined by the core. diff --git a/includes/specials/SpecialListgrouprights.php b/includes/specials/SpecialListgrouprights.php index 077c09e887..8b12da92a3 100644 --- a/includes/specials/SpecialListgrouprights.php +++ b/includes/specials/SpecialListgrouprights.php @@ -108,10 +108,14 @@ class SpecialListGroupRights extends SpecialPage { } } sort( $r ); - if( $add ) { + if( $add === true ){ + $r[] = wfMsgHTML( 'listgrouprights-addgroup-all' ); + } else if( is_array( $add ) && count( $add ) ) { $r[] = wfMsgHTML( 'listgrouprights-addgroup', $wgLang->listToText( $add ) ); } - if( $remove ) { + if( $remove === true ){ + $r[] = wfMsgHTML( 'listgrouprights-removegroup-all' ); + } else if( is_array( $remove ) && count( $remove ) ) { $r[] = wfMsgHTML( 'listgrouprights-removegroup', $wgLang->listToText( $remove ) ); } if( empty( $r ) ) { diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 19ca2835e0..db990bcf55 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -2021,16 +2021,18 @@ It may contain one or more characters which cannot be used in titles.', 'listusers-noresult' => 'No user found.', # Special:Listgrouprights -'listgrouprights' => 'User group rights', -'listgrouprights-summary' => 'The following is a list of user groups defined on this wiki, with their associated access rights. +'listgrouprights' => 'User group rights', +'listgrouprights-summary' => 'The following is a list of user groups defined on this wiki, with their associated access rights. There may be [[{{MediaWiki:Listgrouprights-helppage}}|additional information]] about individual rights.', -'listgrouprights-group' => 'Group', -'listgrouprights-rights' => 'Rights', -'listgrouprights-helppage' => 'Help:Group rights', -'listgrouprights-members' => '(list of members)', -'listgrouprights-right-display' => '$1 ($2)', # only translate this message to other languages if you have to change it -'listgrouprights-addgroup' => 'Can add groups: $1', -'listgrouprights-removegroup' => 'Can remove groups: $1', +'listgrouprights-group' => 'Group', +'listgrouprights-rights' => 'Rights', +'listgrouprights-helppage' => 'Help:Group rights', +'listgrouprights-members' => '(list of members)', +'listgrouprights-right-display' => '$1 ($2)', # only translate this message to other languages if you have to change it +'listgrouprights-addgroup' => 'Can add groups: $1', +'listgrouprights-removegroup' => 'Can remove groups: $1', +'listgrouprights-addgroup-all' => 'Can add all groups', +'listgrouprights-removegroup-all' => 'Can remove all groups', # E-mail user 'mailnologin' => 'No send address', diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index af9d392fbc..ffa5b137b9 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -1311,6 +1311,10 @@ $wgMessageStructure = array( 'listgrouprights-helppage', 'listgrouprights-members', 'listgrouprights-right-display', + 'listgrouprights-addgroup', + 'listgrouprights-removegroup', + 'listgrouprights-addgroup-all', + 'listgrouprights-removegroup-all', ), 'emailuser' => array( 'mailnologin', -- 2.20.1