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.
 
 
 
 
 

52 lines
1020 B

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