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.
 
 
 
 
 

46 lines
1.0 KiB

  1. <?php
  2. namespace dokuwiki\Action;
  3. use dokuwiki\Action\Exception\ActionException;
  4. use dokuwiki\Extension\AdminPlugin;
  5. /**
  6. * Class Admin
  7. *
  8. * Action to show the admin interface or admin plugins
  9. *
  10. * @package dokuwiki\Action
  11. */
  12. class Admin extends AbstractUserAction
  13. {
  14. /** @inheritdoc */
  15. public function minimumPermission()
  16. {
  17. return AUTH_READ; // let in check later
  18. }
  19. /** @inheritDoc */
  20. public function preProcess()
  21. {
  22. global $INPUT;
  23. // retrieve admin plugin name from $_REQUEST['page']
  24. if ($INPUT->str('page', '', true) != '') {
  25. /** @var AdminPlugin $plugin */
  26. if ($plugin = plugin_getRequestAdminPlugin()) { // FIXME this method does also permission checking
  27. if (!$plugin->isAccessibleByCurrentUser()) {
  28. throw new ActionException('denied');
  29. }
  30. $plugin->handle();
  31. }
  32. }
  33. }
  34. /** @inheritDoc */
  35. public function tplContent()
  36. {
  37. tpl_admin();
  38. }
  39. }