You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
2.7KB

  1. <?php
  2. /*
  3. The MIT License
  4. Copyright (c) <2006-208> <Jim Hu>
  5. Permission is hereby granted, free of charge, to any person obtaining a copy
  6. of this software and associated documentation files (the "Software"), to deal
  7. in the Software without restriction, including without limitation the rights
  8. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9. copies of the Software, and to permit persons to whom the Software is
  10. furnished to do so, subject to the following conditions:
  11. The above copyright notice and this permission notice shall be included in
  12. all copies or substantial portions of the Software.
  13. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  15. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  16. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  17. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  18. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  19. THE SOFTWARE.
  20. Versions
  21. 0.51 patch for 1.13
  22. 0.5 release for 1.12
  23. 0.41 add db tablename lookup for better compatibility with installations not using MySQL
  24. 0.4 change base class and fix injection vulnerability
  25. more bug fixes
  26. 0.3 change database calls to more standard MW usage
  27. add russian translation
  28. 0.22 shading alternate rows
  29. 0.21 added return true to fix MW1.11 problems
  30. 0.2 fixed some unset variable problems
  31. */
  32. # Not a valid entry point, skip unless MEDIAWIKI is defined
  33. if (!defined('MEDIAWIKI')) {
  34. echo <<<EOT
  35. To install this extension, put the following line in LocalSettings.php:
  36. require_once( "$IP/extensions/UserRightsList/UserRightsList.php" );
  37. EOT;
  38. exit( 1 );
  39. }
  40. $wgExtensionCredits['specialpage'][] = array(
  41. 'name' => 'UserRightsList',
  42. 'author' => 'Jim Hu',
  43. 'version'=>'0.51',
  44. 'description' => 'list-based user rights management',
  45. 'url' => 'http://www.mediawiki.org/wiki/Extension:UserRightsList'
  46. );
  47. $wgAutoloadClasses['UserRightsList'] = dirname(__FILE__) . '/SpecialUserRightsList.body.php';
  48. $wgSpecialPages['UserRightsList'] = 'UserRightsList';
  49. $wgHooks['LoadAllMessages'][] = 'UserRightsList::loadMessages';
  50. $wgHooks['LangugeGetSpecialPageAliases'][] = 'UserRightsListLocalizedPageName';
  51. function UserRightsListLocalizedPageName(&$specialPageArray, $code) {
  52. # The localized title of the special page is among the messages of the
  53. # extension:
  54. UserRightsList::loadMessages();
  55. $text = wfMsg('userrightslist');
  56. # Convert from title in text form to DBKey and put it into the alias array:
  57. $title = Title::newFromText($text);
  58. $specialPageArray['UserRightsList'][] = $title->getDBKey();
  59. return true;
  60. }
  61. ?>