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.
 
 
 
 
 

27 lines
642 B

  1. <?php
  2. namespace dokuwiki\Action;
  3. use dokuwiki\Action\Exception\ActionAclRequiredException;
  4. use dokuwiki\Extension\AuthPlugin;
  5. /**
  6. * Class AbstractAclAction
  7. *
  8. * An action that requires the ACL subsystem to be enabled (eg. useacl=1)
  9. *
  10. * @package dokuwiki\Action
  11. */
  12. abstract class AbstractAclAction extends AbstractAction
  13. {
  14. /** @inheritdoc */
  15. public function checkPreconditions()
  16. {
  17. parent::checkPreconditions();
  18. global $conf;
  19. global $auth;
  20. if (!$conf['useacl']) throw new ActionAclRequiredException();
  21. if (!$auth instanceof AuthPlugin) throw new ActionAclRequiredException();
  22. }
  23. }