1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10:
11:
12: use Xoops\Core\PreloadItem;
13:
14: 15: 16: 17: 18: 19: 20: 21: 22: 23:
24:
25: 26: 27: 28: 29: 30: 31:
32: class ProfileCorePreload extends PreloadItem
33: {
34: 35: 36: 37:
38: static public function eventCoreUserStart($args)
39: {
40: $op = 'main';
41: if (isset($_POST['op'])) {
42: $op = trim($_POST['op']);
43: } else if (isset($_GET['op'])) {
44: $op = trim($_GET['op']);
45: }
46: if ($op !== 'login' && (empty($_GET['from']) || 'profile' !== $_GET['from'])) {
47: \Xoops::simpleRedirect("./modules/profile/user.php" . (empty($_SERVER['QUERY_STRING']) ? "" : "?" . $_SERVER['QUERY_STRING']));
48: }
49: }
50:
51: 52: 53: 54: 55:
56: static public function eventCoreEdituserStart($args)
57: {
58: \Xoops::simpleRedirect("./modules/profile/edituser.php" . (empty($_SERVER['QUERY_STRING']) ? "" : "?" . $_SERVER['QUERY_STRING']));
59: }
60:
61: 62: 63: 64: 65:
66: static function eventCoreLostpassStart($args)
67: {
68: $email = isset($_GET['email']) ? trim($_GET['email']) : '';
69: $email = isset($_POST['email']) ? trim($_POST['email']) : $email;
70: \Xoops::simpleRedirect("./modules/profile/lostpass.php?email={$email}" . (empty($_GET['code']) ? "" : "&" . $_GET['code']));
71: }
72:
73: 74: 75: 76: 77:
78: static function eventCoreRegisterStart($args)
79: {
80: \Xoops::simpleRedirect("./modules/profile/register.php" . (empty($_SERVER['QUERY_STRING']) ? "" : "?" . $_SERVER['QUERY_STRING']) );
81: }
82:
83: 84: 85: 86: 87:
88: static function eventCoreUserinfoStart($args)
89: {
90: \Xoops::simpleRedirect("./modules/profile/userinfo.php" . (empty($_SERVER['QUERY_STRING']) ? "" : "?" . $_SERVER['QUERY_STRING']) );
91: }
92: }
93: