🤖 Rector and PHPCS fixes
[dokuwiki.git] / inc / Action / Profile.php
blob41615af070a31c0ba818cab59c8c2b2b6f71d1ec
1 <?php
3 namespace dokuwiki\Action;
5 use dokuwiki\Ui\UserProfile;
6 use dokuwiki\Action\Exception\ActionAbort;
7 use dokuwiki\Action\Exception\ActionDisabledException;
8 use dokuwiki\Extension\AuthPlugin;
9 use dokuwiki\Ui;
11 /**
12 * Class Profile
14 * Handle the profile form
16 * @package dokuwiki\Action
18 class Profile extends AbstractUserAction
20 /** @inheritdoc */
21 public function minimumPermission()
23 return AUTH_NONE;
26 /** @inheritdoc */
27 public function checkPreconditions()
29 parent::checkPreconditions();
31 /** @var AuthPlugin $auth */
32 global $auth;
33 if (!$auth->canDo('Profile')) throw new ActionDisabledException();
36 /** @inheritdoc */
37 public function preProcess()
39 global $lang;
40 if (updateprofile()) {
41 msg($lang['profchanged'], 1);
42 throw new ActionAbort('show');
46 /** @inheritdoc */
47 public function tplContent()
49 (new UserProfile())->show();