SsoController   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 25
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A actionOutput() 0 3 1
1
<?php
2
/**
3
 * Vanillaforums plugin for Craft CMS 3.x
4
 *
5
 * Single Sign On plugin for VanillaForums/jsConnect and CraftCMS
6
 *
7
 * @link      https://nystudio107.com/
8
 * @copyright Copyright (c) 2019 nystudio107
9
 */
10
11
namespace nystudio107\vanillaforums\controllers;
12
13
use nystudio107\vanillaforums\Vanillaforums;
14
15
use craft\web\Controller;
16
17
/**
18
 * @author    nystudio107
19
 * @package   Vanillaforums
20
 * @since     3.0.0
21
 */
22
class SsoController extends Controller
23
{
24
    // Protected Properties
25
    // =========================================================================
26
27
    /**
28
     * @var    bool|array Allows anonymous access to this controller's actions.
29
     *         The actions must be in 'kebab-case'
30
     * @access protected
31
     */
32
    protected $allowAnonymous = ['output'];
33
34
    // Public Methods
35
    // =========================================================================
36
37
    /**
38
     * Generate the jsConnect string for single sign on
39
     *
40
     * @param int $userId
41
     *
42
     * @throws \yii\base\ExitException
43
     */
44
    public function actionOutput(int $userId = 0)
45
    {
46
        Vanillaforums::$plugin->sso->output($userId);
47
    }
48
}
49