xref: /dokuwiki/inc/Action/AbstractUserAction.php (revision 190782098e8a7ad5791f02d665fc23b8206667dd)
164ab5140SAndreas Gohr<?php
264ab5140SAndreas Gohr
364ab5140SAndreas Gohrnamespace dokuwiki\Action;
464ab5140SAndreas Gohr
5f21dad39SAndreas Gohruse dokuwiki\Action\Exception\ActionUserRequiredException;
664ab5140SAndreas Gohr
7ab583a1bSAndreas Gohr/**
8ab583a1bSAndreas Gohr * Class AbstractUserAction
9ab583a1bSAndreas Gohr *
10ab583a1bSAndreas Gohr * An action that requires a logged in user
11ab583a1bSAndreas Gohr *
12ab583a1bSAndreas Gohr * @package dokuwiki\Action
13ab583a1bSAndreas Gohr */
1464ab5140SAndreas Gohrabstract class AbstractUserAction extends AbstractAclAction {
1564ab5140SAndreas Gohr
1664ab5140SAndreas Gohr    /** @inheritdoc */
17b2c9cd19SAndreas Gohr    public function checkPreconditions() {
18b2c9cd19SAndreas Gohr        parent::checkPreconditions();
1964ab5140SAndreas Gohr        global $INPUT;
20*19078209SAndreas Gohr        if($INPUT->server->str('REMOTE_USER') === '') {
21f21dad39SAndreas Gohr            throw new ActionUserRequiredException();
2264ab5140SAndreas Gohr        }
2364ab5140SAndreas Gohr    }
2464ab5140SAndreas Gohr
2564ab5140SAndreas Gohr}
26