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
946 B

  1. <?php
  2. namespace dokuwiki\Action;
  3. use dokuwiki\Action\Exception\ActionAbort;
  4. use dokuwiki\Action\Exception\ActionDisabledException;
  5. use dokuwiki\Extension\AuthPlugin;
  6. /**
  7. * Class ProfileDelete
  8. *
  9. * Delete a user account
  10. *
  11. * @package dokuwiki\Action
  12. */
  13. class ProfileDelete extends AbstractUserAction
  14. {
  15. /** @inheritdoc */
  16. public function minimumPermission()
  17. {
  18. return AUTH_NONE;
  19. }
  20. /** @inheritdoc */
  21. public function checkPreconditions()
  22. {
  23. parent::checkPreconditions();
  24. /** @var AuthPlugin $auth */
  25. global $auth;
  26. if (!$auth->canDo('delUser')) throw new ActionDisabledException();
  27. }
  28. /** @inheritdoc */
  29. public function preProcess()
  30. {
  31. global $lang;
  32. if (auth_deleteprofile()) {
  33. msg($lang['profdeleted'], 1);
  34. throw new ActionAbort('show');
  35. } else {
  36. throw new ActionAbort('profile');
  37. }
  38. }
  39. }