IndexController   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 20
rs 10
c 1
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A actionAccept() 0 7 1
A actionDecline() 0 4 1
1
<?php
2
3
namespace humhub\modules\privacybox\controllers;
4
5
use Yii;
6
use humhub\components\Controller;
7
8
class IndexController extends Controller
9
{
10
11
    /**
12
     * Configuration Action for Super Admins
13
     */
14
    public function actionAccept()
15
    {
16
        $settings = Yii::$app->getModule('privacybox')->settings;
17
        $settings->user()->set('timestamp', $settings->get('timestamp'));
18
        Yii::$app->response->format = 'json';
19
        return ['success' => true];
20
    }
21
22
    public function actionDecline()
23
    {
24
        return $this->redirect(['/user/auth/logout']);
25
    }
26
27
}
28
29
?>
30