Displaying all the groups with the permission, not only the first defined one, in...
authorRotem Liss <rotem@users.mediawiki.org>
Tue, 8 Aug 2006 18:08:46 +0000 (18:08 +0000)
committerRotem Liss <rotem@users.mediawiki.org>
Tue, 8 Aug 2006 18:08:46 +0000 (18:08 +0000)
includes/OutputPage.php
languages/MessagesEn.php
languages/MessagesHe.php

index 6208310..6fc12f7 100644 (file)
@@ -726,25 +726,29 @@ class OutputPage {
                $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 );
index a83f701..a8f62a2 100644 (file)
@@ -510,9 +510,11 @@ parent class in order maintain consistency across languages.
 '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]]',
index ada799e..fe1c6ca 100644 (file)
@@ -354,9 +354,11 @@ $messages = array(
 "jumptonavigation"  => "ניווט",
 "jumptosearch"      => "חיפוש",
 
-"badaccess"         => "שגיאה בהרשאות",
-"badaccess-group"   => 'הפעולה שביקשתם לבצע מוגבלת למשתמשים בקבוצה "$1".',
-"badaccess-nogroup" => "אינכם מורשים לבצע את הפעולה שביקשתם.",
+"badaccess"        => "שגיאה בהרשאות",
+"badaccess-group0" => "אינכם מורשים לבצע את הפעולה שביקשתם.",
+"badaccess-group1" => "הפעולה שביקשתם לבצע מוגבלת למשתמשים בקבוצה $1.",
+"badaccess-group2" => "הפעולה שביקשתם לבצע מוגבלת למשתמשים באחת הקבוצות $1.",
+"badaccess-groups" => "הפעולה שביקשתם לבצע מוגבלת למשתמשים באחת הקבוצות $1.",
 
 "versionrequired"     => "נדרשת גרסה $1 של מדיה־ויקי",
 "versionrequiredtext" => 'גרסה $1 של מדיה־ויקי נדרשת לשימוש בדף זה.