Completed
Push — master ( 13ce47...b2c9cd )
by Andreas
10:39 queued 06:48
created

AbstractUserAction   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A checkPreconditions() 0 7 2
1
<?php
2
3
namespace dokuwiki\Action;
4
5
use 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
 */
14
abstract 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