Failed Conditions
Push — tokenauth ( b0ac60 )
by Andreas
11:30 queued 08:14
created

Authtoken::minimumPermission()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
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