Profile.php 992 B

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