Failed Conditions
Push — tokenauth ( b0ac60 )
by Andreas
08:12
created

Authtoken::checkPreconditions()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 3
nc 2
nop 0
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace dokuwiki\Action;
4
5
use dokuwiki\Action\Exception\ActionAbort;
6
use dokuwiki\Action\Exception\ActionException;
7
use dokuwiki\AuthenticationToken;
8
9
class Authtoken extends AbstractUserAction {
10
11
    /** @inheritdoc */
12
    public function minimumPermission() {
13
        return AUTH_NONE;
14
    }
15
16
    /** @inheritdoc */
17
    public function checkPreconditions() {
18
        parent::checkPreconditions();
19
20
        if(!checkSecurityToken()) throw new ActionException('profile');
21
    }
22
23
    /** @inheritdoc */
24
    public function preProcess() {
25
        global $INPUT;
26
        parent::preProcess();
27
        $token = AuthenticationToken::fromUser($INPUT->server->str('REMOTE_USER'));
28
        $token->reset();
29
        throw new ActionAbort('profile');
30
    }
31
}
32