Index: trunk/phase3/maintenance/language/messages.inc |
— | — | @@ -1535,6 +1535,11 @@ |
1536 | 1536 | 'listgrouprights-removegroup', |
1537 | 1537 | 'listgrouprights-addgroup-all', |
1538 | 1538 | 'listgrouprights-removegroup-all', |
| 1539 | + 'listgrouprights-addgroup-self', |
| 1540 | + 'listgrouprights-removegroup-self', |
| 1541 | + 'listgrouprights-addgroup-self-all', |
| 1542 | + 'listgrouprights-removegroup-self-all', |
| 1543 | + |
1539 | 1544 | ), |
1540 | 1545 | 'emailuser' => array( |
1541 | 1546 | 'mailnologin', |
Index: trunk/phase3/includes/specials/SpecialListgrouprights.php |
— | — | @@ -26,6 +26,7 @@ |
27 | 27 | public function execute( $par ) { |
28 | 28 | global $wgOut, $wgImplicitGroups, $wgMessageCache; |
29 | 29 | global $wgGroupPermissions, $wgAddGroups, $wgRemoveGroups; |
| 30 | + global $wgGroupsAddToSelf, $wgGroupsRemoveFromSelf; |
30 | 31 | $wgMessageCache->loadAllMessages(); |
31 | 32 | |
32 | 33 | $this->setHeaders(); |
— | — | @@ -76,13 +77,16 @@ |
77 | 78 | $addgroups = isset( $wgAddGroups[$group] ) ? $wgAddGroups[$group] : array(); |
78 | 79 | $removegroups = isset( $wgRemoveGroups[$group] ) ? $wgRemoveGroups[$group] : array(); |
79 | 80 | |
| 81 | + $addgroupsSelf = isset( $wgGroupsAddToSelf[$group] ) ? $wgGroupsAddToSelf[$group] : array(); |
| 82 | + $removegroupsSelf = isset( $wgGroupsRemoveFromSelf[$group] ) ? $wgGroupsRemoveFromSelf[$group] : array(); |
| 83 | + |
80 | 84 | $wgOut->addHTML( |
81 | 85 | '<tr> |
82 | 86 | <td>' . |
83 | 87 | $grouppage . $grouplink . |
84 | 88 | '</td> |
85 | 89 | <td>' . |
86 | | - self::formatPermissions( $permissions, $addgroups, $removegroups ) . |
| 90 | + self::formatPermissions( $permissions, $addgroups, $removegroups, $addgroupsSelf, $removegroupsSelf ) . |
87 | 91 | '</td> |
88 | 92 | </tr>' |
89 | 93 | ); |
— | — | @@ -98,7 +102,7 @@ |
99 | 103 | * @param $permissions Array of permission => bool (from $wgGroupPermissions items) |
100 | 104 | * @return string List of all granted permissions, separated by comma separator |
101 | 105 | */ |
102 | | - private static function formatPermissions( $permissions, $add, $remove ) { |
| 106 | + private static function formatPermissions( $permissions, $add, $remove, $addSelf, $removeSelf ) { |
103 | 107 | global $wgLang; |
104 | 108 | $r = array(); |
105 | 109 | foreach( $permissions as $permission => $granted ) { |
— | — | @@ -121,6 +125,16 @@ |
122 | 126 | } else if( is_array( $remove ) && count( $remove ) ) { |
123 | 127 | $r[] = wfMsgExt( 'listgrouprights-removegroup', array( 'parseinline' ), $wgLang->listToText( array_map( array( 'User', 'makeGroupLinkWiki' ), $remove ) ), count( $remove ) ); |
124 | 128 | } |
| 129 | + if( $addSelf === true ){ |
| 130 | + $r[] = wfMsgExt( 'listgrouprights-addgroup-self-all', array( 'escape' ) ); |
| 131 | + } else if( is_array( $addSelf ) && count( $addSelf ) ) { |
| 132 | + $r[] = wfMsgExt( 'listgrouprights-addgroup-self', array( 'parseinline' ), $wgLang->listToText( array_map( array( 'User', 'makeGroupLinkWiki' ), $addSelf ) ), count( $addSelf ) ); |
| 133 | + } |
| 134 | + if( $removeSelf === true ){ |
| 135 | + $r[] = wfMsgExt( 'listgrouprights-removegroup-self-all', array( 'escape' ) ); |
| 136 | + } else if( is_array( $removeSelf ) && count( $removeSelf ) ) { |
| 137 | + $r[] = wfMsgExt( 'listgrouprights-removegroup-self', array( 'parseinline' ), $wgLang->listToText( array_map( array( 'User', 'makeGroupLinkWiki' ), $removeSelf ) ), count( $removeSelf ) ); |
| 138 | + } |
125 | 139 | if( empty( $r ) ) { |
126 | 140 | return ''; |
127 | 141 | } else { |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -2286,6 +2286,10 @@ |
2287 | 2287 | 'listgrouprights-removegroup' => 'Can remove {{PLURAL:$2|group|groups}}: $1', |
2288 | 2288 | 'listgrouprights-addgroup-all' => 'Can add all groups', |
2289 | 2289 | 'listgrouprights-removegroup-all' => 'Can remove all groups', |
| 2290 | +'listgrouprights-addgroup-self' => 'Can add {{PLURAL:$2|group|groups}} to own account: $1', |
| 2291 | +'listgrouprights-removegroup-self' => 'Can remove {{PLURAL:$2|group|groups}} to own account: $1', |
| 2292 | +'listgrouprights-addgroup-self-all' => 'Can add all groups to own account', |
| 2293 | +'listgrouprights-removegroup-self-all' => 'Can remove all groups to own account', |
2290 | 2294 | |
2291 | 2295 | # E-mail user |
2292 | 2296 | 'mailnologin' => 'No send address', |