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) |
|
|
|
|
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) |
|
|
|
|
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) |
|
|
|
|
68
|
|
|
{ |
69
|
|
|
header('location: ./modules/yogurt/index.php' . (empty($_SERVER['QUERY_STRING']) ? '' : '?' . $_SERVER['QUERY_STRING'])); |
70
|
|
|
exit(); |
71
|
|
|
} |
72
|
|
|
|
73
|
|
|
} |
74
|
|
|
|
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.