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