Index: trunk/phase3/maintenance/language/messages.inc |
— | — | @@ -1208,6 +1208,13 @@ |
1209 | 1209 | 'listusers-submit', |
1210 | 1210 | 'listusers-noresult', |
1211 | 1211 | ), |
| 1212 | + 'listgrouprights' => array( |
| 1213 | + 'listgrouprights', |
| 1214 | + 'listgrouprights-summary', |
| 1215 | + 'listgrouprights-group', |
| 1216 | + 'listgrouprights-rights', |
| 1217 | + 'listgrouprights-link', |
| 1218 | + ), |
1212 | 1219 | 'emailuser' => array( |
1213 | 1220 | 'mailnologin', |
1214 | 1221 | 'mailnologintext', |
— | — | @@ -2513,6 +2520,7 @@ |
2514 | 2521 | 'logpages' => 'Special:Log', |
2515 | 2522 | 'allpages' => 'Special:Allpages', |
2516 | 2523 | 'listusers' => 'Special:Listusers', |
| 2524 | + 'listgrouprights' => 'Special:Listgrouprights', |
2517 | 2525 | 'emailuser' => 'E-mail user', |
2518 | 2526 | 'watchlist' => 'Watchlist', |
2519 | 2527 | 'watching' => 'Displayed when you click the "watch" button and it is in the process of watching', |
Index: trunk/phase3/skins/common/shared.css |
— | — | @@ -122,3 +122,17 @@ |
123 | 123 | background-color: #f9f9f9; |
124 | 124 | border: 1px dashed #aaa; |
125 | 125 | } |
| 126 | + |
| 127 | +table.mw-listgrouprights-table { |
| 128 | + border: 1px solid #ccc; |
| 129 | + border-collapse: collapse; |
| 130 | +} |
| 131 | + |
| 132 | +table.mw-listgrouprights-table tr { |
| 133 | + vertical-align: top; |
| 134 | +} |
| 135 | + |
| 136 | +table.mw-listgrouprights-table td, table.mw-listgrouprights-table th { |
| 137 | + padding: 0.5em 0.2em 0.5em 0.2em; |
| 138 | + border: 1px solid #ccc; |
| 139 | +} |
Index: trunk/phase3/includes/SpecialListgrouprights.php |
— | — | @@ -0,0 +1,83 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +/** |
| 5 | + * This special page lists all defined user groups and the associated rights. |
| 6 | + * See also @ref $wgGroupPermissions. |
| 7 | + * |
| 8 | + * @addtogroup SpecialPage |
| 9 | + * @author Petr Kadlec <mormegil@centrum.cz> |
| 10 | + */ |
| 11 | +class SpecialListGroupRights extends SpecialPage { |
| 12 | + |
| 13 | + var $skin; |
| 14 | + |
| 15 | + /** |
| 16 | + * Constructor |
| 17 | + */ |
| 18 | + function __construct() { |
| 19 | + global $wgUser; |
| 20 | + parent::__construct( 'Listgrouprights' ); |
| 21 | + $this->skin = $wgUser->getSkin(); |
| 22 | + } |
| 23 | + |
| 24 | + /** |
| 25 | + * Show the special page |
| 26 | + */ |
| 27 | + public function execute( $par ) { |
| 28 | + global $wgOut, $wgGroupPermissions, $wgImplicitGroups; |
| 29 | + |
| 30 | + $this->setHeaders(); |
| 31 | + $this->outputHeader(); |
| 32 | + |
| 33 | + $wgOut->addHTML( |
| 34 | + Xml::openElement( 'table', array( 'class' => 'mw-listgrouprights-table' ) ) . |
| 35 | + '<tr>' . |
| 36 | + Xml::element( 'th', null, wfMsg( 'listgrouprights-group' ) ) . |
| 37 | + Xml::element( 'th', null, wfMsg( 'listgrouprights-rights' ) ) . |
| 38 | + '</tr>' |
| 39 | + ); |
| 40 | + |
| 41 | + foreach( $wgGroupPermissions as $group => $permissions ) { |
| 42 | + $groupname = htmlspecialchars( $group ); |
| 43 | + if ( in_array( $group, $wgImplicitGroups ) ) |
| 44 | + $grouplink = $groupname; |
| 45 | + else |
| 46 | + $grouplink = $this->skin->makeKnownLinkObj( SpecialPage::getTitleFor( 'Listusers' ), $groupname, 'group=' . $group ); |
| 47 | + |
| 48 | + $wgOut->addHTML( |
| 49 | + '<tr> |
| 50 | + <td>' . |
| 51 | + $grouplink . |
| 52 | + '</td> |
| 53 | + <td>' . |
| 54 | + SpecialListGroupRights::formatPermissions( $permissions ) . |
| 55 | + '</td> |
| 56 | + </tr>' |
| 57 | + ); |
| 58 | + } |
| 59 | + $wgOut->addHTML( |
| 60 | + Xml::closeElement( 'table' ) . "\n" |
| 61 | + ); |
| 62 | + } |
| 63 | + |
| 64 | + /** |
| 65 | + * Create a user-readable list of permissions from the given array. |
| 66 | + * |
| 67 | + * @param $permissions Array of permission => bool (from $wgGroupPermissions items) |
| 68 | + * @return string List of all granted permissions, separated by comma separator |
| 69 | + */ |
| 70 | + private static function formatPermissions( $permissions ) { |
| 71 | + global $wgUser; |
| 72 | + $r = array(); |
| 73 | + foreach( $permissions as $permission => $granted ) { |
| 74 | + if ( $granted ) { |
| 75 | + $permission = htmlspecialchars( $permission ); |
| 76 | + $r[] = wfMsgExt( 'listgrouprights-link', array( 'parseinline' ), $permission ); |
| 77 | + } |
| 78 | + } |
| 79 | + sort( $r ); |
| 80 | + $r = implode( wfMsg( 'comma-separator' ), $r ); |
| 81 | + |
| 82 | + return $r; |
| 83 | + } |
| 84 | +} |
Property changes on: trunk/phase3/includes/SpecialListgrouprights.php |
___________________________________________________________________ |
Name: svn:eol-style |
1 | 85 | + native |
Index: trunk/phase3/includes/AutoLoader.php |
— | — | @@ -234,6 +234,7 @@ |
235 | 235 | 'SkinTemplate' => 'includes/SkinTemplate.php', |
236 | 236 | 'SpecialAllpages' => 'includes/SpecialAllpages.php', |
237 | 237 | 'SpecialBookSources' => 'includes/SpecialBooksources.php', |
| 238 | + 'SpecialListGroupRights' => 'includes/SpecialListgrouprights.php', |
238 | 239 | 'SpecialMostlinkedtemplates' => 'includes/SpecialMostlinkedtemplates.php', |
239 | 240 | 'SpecialPage' => 'includes/SpecialPage.php', |
240 | 241 | 'SpecialPrefixindex' => 'includes/SpecialPrefixindex.php', |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -1342,7 +1342,7 @@ |
1343 | 1343 | * to ensure that client-side caches don't keep obsolete copies of global |
1344 | 1344 | * styles. |
1345 | 1345 | */ |
1346 | | -$wgStyleVersion = '132'; |
| 1346 | +$wgStyleVersion = '133'; |
1347 | 1347 | |
1348 | 1348 | |
1349 | 1349 | # Server-side caching: |
Index: trunk/phase3/includes/SpecialPage.php |
— | — | @@ -85,6 +85,7 @@ |
86 | 86 | 'Imagelist' => array( 'SpecialPage', 'Imagelist' ), |
87 | 87 | 'Newimages' => array( 'IncludableSpecialPage', 'Newimages' ), |
88 | 88 | 'Listusers' => array( 'SpecialPage', 'Listusers' ), |
| 89 | + 'Listgrouprights' => 'SpecialListGroupRights', |
89 | 90 | 'Statistics' => array( 'SpecialPage', 'Statistics' ), |
90 | 91 | 'Randompage' => 'Randompage', |
91 | 92 | 'Lonelypages' => array( 'SpecialPage', 'Lonelypages' ), |
Index: trunk/phase3/languages/messages/MessagesEn.php |
— | — | @@ -363,6 +363,7 @@ |
364 | 364 | 'Imagelist' => array( 'ImageList' ), |
365 | 365 | 'Newimages' => array( 'NewImages' ), |
366 | 366 | 'Listusers' => array( 'ListUsers', 'UserList' ), |
| 367 | + 'Listgrouprights' => array( 'ListGroupRights' ), |
367 | 368 | 'Statistics' => array( 'Statistics' ), |
368 | 369 | 'Randompage' => array( 'Random', 'RandomPage' ), |
369 | 370 | 'Lonelypages' => array( 'LonelyPages', 'OrphanedPages' ), |
— | — | @@ -1876,6 +1877,13 @@ |
1877 | 1878 | 'listusers-submit' => 'Show', |
1878 | 1879 | 'listusers-noresult' => 'No user found.', |
1879 | 1880 | |
| 1881 | +# Special:Listgrouprights |
| 1882 | +'listgrouprights' => 'User group rights', |
| 1883 | +'listgrouprights-summary' => 'The following is a list of user groups defined on this wiki, with their associated access rights.', |
| 1884 | +'listgrouprights-group' => 'Group', |
| 1885 | +'listgrouprights-rights' => 'Rights', |
| 1886 | +'listgrouprights-link' => "[[{{ns:help}}:Group rights#$1|$1]]", |
| 1887 | + |
1880 | 1888 | # E-mail user |
1881 | 1889 | 'mailnologin' => 'No send address', |
1882 | 1890 | 'mailnologintext' => 'You must be [[Special:Userlogin|logged in]] and have a valid e-mail address in your [[Special:Preferences|preferences]] to send e-mail to other users.', |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -64,8 +64,8 @@ |
65 | 65 | * Redesign of Special:Userrights |
66 | 66 | * Make rev_deleted log entries more intelligible. |
67 | 67 | * (bug 6943) Added PAGESINCATEGORY: magic word |
| 68 | +* (bug 13604) Added Special:ListGroupRights |
68 | 69 | |
69 | | - |
70 | 70 | === Bug fixes in 1.13 === |
71 | 71 | |
72 | 72 | * (bug 10677) Add link to the file description page on the shared repository |