xref: /dokuwiki/inc/Action/Profile.php (revision 480336a332edb3421967e8a704976494c582e76c)
1f21dad39SAndreas Gohr<?php
2f21dad39SAndreas Gohr
3f21dad39SAndreas Gohrnamespace dokuwiki\Action;
4f21dad39SAndreas Gohr
5f21dad39SAndreas Gohruse dokuwiki\Action\Exception\ActionAbort;
6*480336a3SAndreas Gohruse dokuwiki\Action\Exception\ActionDisabledException;
7f21dad39SAndreas Gohr
8ab583a1bSAndreas Gohr/**
9ab583a1bSAndreas Gohr * Class Profile
10ab583a1bSAndreas Gohr *
11ab583a1bSAndreas Gohr * Handle the profile form
12ab583a1bSAndreas Gohr *
13ab583a1bSAndreas Gohr * @package dokuwiki\Action
14ab583a1bSAndreas Gohr */
15f21dad39SAndreas Gohrclass Profile extends AbstractUserAction {
16f21dad39SAndreas Gohr
17f21dad39SAndreas Gohr    /** @inheritdoc */
18ec701221SAndreas Gohr    public function minimumPermission() {
19f21dad39SAndreas Gohr        return AUTH_NONE;
20f21dad39SAndreas Gohr    }
21f21dad39SAndreas Gohr
22ab583a1bSAndreas Gohr    /** @inheritdoc */
23*480336a3SAndreas Gohr    public function checkPermissions() {
24*480336a3SAndreas Gohr        parent::checkPermissions();
25*480336a3SAndreas Gohr
26*480336a3SAndreas Gohr        /** @var \DokuWiki_Auth_Plugin $auth */
27*480336a3SAndreas Gohr        global $auth;
28*480336a3SAndreas Gohr        if(!$auth->canDo('Profile')) throw new ActionDisabledException();
29*480336a3SAndreas Gohr    }
30*480336a3SAndreas Gohr
31*480336a3SAndreas Gohr    /** @inheritdoc */
32f21dad39SAndreas Gohr    public function preProcess() {
33f21dad39SAndreas Gohr        global $lang;
34f21dad39SAndreas Gohr        if(updateprofile()) {
35f21dad39SAndreas Gohr            msg($lang['profchanged'], 1);
36f21dad39SAndreas Gohr            throw new ActionAbort('show');
37f21dad39SAndreas Gohr        }
38f21dad39SAndreas Gohr    }
39f21dad39SAndreas Gohr
40ab583a1bSAndreas Gohr    /** @inheritdoc */
41f21dad39SAndreas Gohr    public function tplContent() {
42f21dad39SAndreas Gohr        html_updateprofile();
43f21dad39SAndreas Gohr    }
44f21dad39SAndreas Gohr
45f21dad39SAndreas Gohr}
46