$this->setArticleRelated( false );
$this->mBodytext = '';
- $group = '';
+ $groups = array();
foreach( $wgGroupPermissions as $key => $value ) {
if( isset( $value[$permission] ) && $value[$permission] == true ) {
- $group = $key;
- break;
+ $groupName = User::getGroupName( $key );
+ $groupPage = User::getGroupPage( $key );
+ if( $groupPage ) {
+ $skin =& $wgUser->getSkin();
+ $groups[] = '"'.$skin->makeLinkObj( $groupPage, $groupName ).'"';
+ } else {
+ $groups[] = '"'.$groupName.'"';
+ }
}
}
- if( $group == '' ) {
- $message = wfMsgHtml( 'badaccess-nogroup' );
- } else {
- $groupName = User::getGroupName( $group );
- $groupPage = User::getGroupPage( $group );
- if( $groupPage ) {
- $skin =& $wgUser->getSkin();
- $groupLink = $skin->makeLinkObj( $groupPage, $groupName );
- } else {
- $groupLink = $groupName;
- }
- $message = wfMsgHtml( 'badaccess-group', $groupLink );
+ $n = count( $groups );
+ $groups = implode( ', ', $groups );
+ switch( $n ) {
+ case 0:
+ case 1:
+ case 2:
+ $message = wfMsgHtml( "badaccess-group$n", $groups );
+ break;
+ default:
+ $message = wfMsgHtml( 'badaccess-groups', $groups );
}
$this->addHtml( $message );
$this->returnToMain( false );
'jumptonavigation' => 'navigation',
'jumptosearch' => 'search',
-'badaccess' => 'Permission error',
-'badaccess-group' => 'The action you have requested is limited to users in the group "$1".',
-'badaccess-nogroup' => 'You are not allowed to execute the action you have requested.',
+'badaccess' => 'Permission error',
+'badaccess-group0' => 'You are not allowed to execute the action you have requested.',
+'badaccess-group1' => 'The action you have requested is limited to users in the group $1.',
+'badaccess-group2' => 'The action you have requested is limited to users in one of the groups $1.',
+'badaccess-groups' => 'The action you have requested is limited to users in one of the groups $1.',
'versionrequired' => 'Version $1 of MediaWiki required',
'versionrequiredtext' => 'Version $1 of MediaWiki is required to use this page. See [[Special:Version]]',
"jumptonavigation" => "ניווט",
"jumptosearch" => "חיפוש",
-"badaccess" => "שגיאה בהרשאות",
-"badaccess-group" => 'הפעולה שביקשתם לבצע מוגבלת למשתמשים בקבוצה "$1".',
-"badaccess-nogroup" => "אינכם מורשים לבצע את הפעולה שביקשתם.",
+"badaccess" => "שגיאה בהרשאות",
+"badaccess-group0" => "אינכם מורשים לבצע את הפעולה שביקשתם.",
+"badaccess-group1" => "הפעולה שביקשתם לבצע מוגבלת למשתמשים בקבוצה $1.",
+"badaccess-group2" => "הפעולה שביקשתם לבצע מוגבלת למשתמשים באחת הקבוצות $1.",
+"badaccess-groups" => "הפעולה שביקשתם לבצע מוגבלת למשתמשים באחת הקבוצות $1.",
"versionrequired" => "נדרשת גרסה $1 של מדיה־ויקי",
"versionrequiredtext" => 'גרסה $1 של מדיה־ויקי נדרשת לשימוש בדף זה.