Passed
Push — master ( cf7dbc...eaf682 )
by Michael
43s queued 12s
created

YogurtCorePreload::eventCoreEdituserStart()   A

Complexity

Conditions 2
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 2
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 2
nc 1
nop 1
1
<?php declare(strict_types=1);
2
3
/*
4
 You may not change or alter any portion of this comment or credits
5
 of supporting developers from this source code or any supporting source code
6
 which is considered copyrighted (c) material of the original comment or credit authors.
7
8
 This program is distributed in the hope that it will be useful,
9
 but WITHOUT ANY WARRANTY; without even the implied warranty of
10
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11
*/
12
13
/**
14
 * @copyright       XOOPS Project (https://xoops.org)
15
 * @license         GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
16
 * @author          XOOPS Project <www.xoops.org> <www.xoops.ir>
17
 */
18
defined(
19
    'XOOPS_ROOT_PATH'
20
)
21
|| die('Restricted access.');
22
23
/**
24
 * Class YogurtCorePreload
25
 */
26
class YogurtCorePreload extends XoopsPreloadItem
27
{
28
    // to add PSR-4 autoloader
29
30
    /**
31
     * @param $args
32
     */
33
    public static function eventCoreIncludeCommonEnd($args)
34
    {
35
        require __DIR__ . '/autoloader.php';
36
    }
37
	
38
	/**
39
     * @param $args
40
     */
41
    public static function eventCoreUserStart($args)
0 ignored issues
show
Unused Code introduced by
The parameter $args is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

41
    public static function eventCoreUserStart(/** @scrutinizer ignore-unused */ $args)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
42
    {
43
        $op = 'main';
44
        if (isset($_POST['op'])) {
45
            $op = trim($_POST['op']);
46
        } elseif (isset($_GET['op'])) {
47
            $op = trim($_GET['op']);
48
        }
49
        if ($op !== 'login' && (empty($_GET['from']) || 'yogurt' !== $_GET['from'])) {
50
            header('location: ./modules/yogurt/user.php' . (empty($_SERVER['QUERY_STRING']) ? '' : '?' . $_SERVER['QUERY_STRING']));
51
            exit();
52
        }
53
    }
54
55
    /**
56
     * @param $args
57
     */
58
    public static function eventCoreEdituserStart($args)
0 ignored issues
show
Unused Code introduced by
The parameter $args is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

58
    public static function eventCoreEdituserStart(/** @scrutinizer ignore-unused */ $args)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
59
    {
60
        header('location: ./modules/yogurt/edituser.php' . (empty($_SERVER['QUERY_STRING']) ? '' : '?' . $_SERVER['QUERY_STRING']));
61
        exit();
62
    }
63
64
	/**
65
     * @param $args
66
     */
67
    public static function eventCoreUserinfoStart($args)
0 ignored issues
show
Unused Code introduced by
The parameter $args is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

67
    public static function eventCoreUserinfoStart(/** @scrutinizer ignore-unused */ $args)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
68
    {
69
        header('location: ./modules/yogurt/index.php' . (empty($_SERVER['QUERY_STRING']) ? '' : '?' . $_SERVER['QUERY_STRING']));
70
        exit();
71
    }
72
	
73
}
74