xref: /dokuwiki/inc/Action/AbstractUserAction.php (revision e86f6b02caa7933ce6a8a2358ceb43ed6a3eccff)
1<?php
2
3namespace dokuwiki\Action;
4
5use dokuwiki\Action\Exception\ActionUserRequiredException;
6
7/**
8 * Class AbstractUserAction
9 *
10 * An action that requires a logged in user
11 *
12 * @package dokuwiki\Action
13 */
14abstract class AbstractUserAction extends AbstractAclAction {
15
16    /** @inheritdoc */
17    public function checkPreconditions() {
18        parent::checkPreconditions();
19        global $INPUT;
20        if(!$INPUT->server->str('REMOTE_USER')) {
21            throw new ActionUserRequiredException();
22        }
23    }
24
25}
26