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

Authtoken   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 0
Metric Value
dl 0
loc 23
rs 10
c 0
b 0
f 0
wmc 4
lcom 0
cbo 4

3 Methods

Rating   Name   Duplication   Size   Complexity  
A minimumPermission() 0 3 1
A checkPreconditions() 0 5 2
A preProcess() 0 7 1
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