Denied.php 992 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. namespace dokuwiki\Action;
  3. use dokuwiki\Extension\Event;
  4. use dokuwiki\Ui;
  5. /**
  6. * Class Denied
  7. *
  8. * Show the access denied screen
  9. *
  10. * @package dokuwiki\Action
  11. */
  12. class Denied extends AbstractAction
  13. {
  14. /** @inheritdoc */
  15. public function minimumPermission()
  16. {
  17. return AUTH_NONE;
  18. }
  19. /** @inheritdoc */
  20. public function tplContent()
  21. {
  22. $this->showBanner();
  23. $data = null;
  24. $event = new Event('ACTION_DENIED_TPLCONTENT', $data);
  25. if ($event->advise_before()) {
  26. global $INPUT;
  27. if (empty($INPUT->server->str('REMOTE_USER')) && actionOK('login')) {
  28. (new Ui\Login)->show();
  29. }
  30. }
  31. $event->advise_after();
  32. }
  33. /**
  34. * Display error on denied pages
  35. *
  36. * @author Andreas Gohr <andi@splitbrain.org>
  37. *
  38. * @return void
  39. */
  40. public function showBanner()
  41. {
  42. // print intro
  43. print p_locale_xhtml('denied');
  44. }
  45. }