1: <?php
2: /**
3: * Extended User Profile
4: *
5: * You may not change or alter any portion of this comment or credits
6: * of supporting developers from this source code or any supporting source code
7: * which is considered copyrighted (c) material of the original comment or credit authors.
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: * @copyright (c) 2000-2016 XOOPS Project (www.xoops.org)
13: * @license GNU GPL 2 (https://www.gnu.org/licenses/gpl-2.0.html)
14: * @package profile
15: * @since 2.4.0
16: * @author trabis <lusopoemas@gmail.com>
17: */
18:
19: use Xmf\Request;
20:
21: // defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined');
22:
23: /**
24: * Profile core preloads
25: *
26: * @copyright (c) 2000-2016 XOOPS Project (www.xoops.org)
27: * @license GNU GPL 2 (https://www.gnu.org/licenses/gpl-2.0.html)
28: * @author trabis <lusopoemas@gmail.com>
29: */
30: class ProfileCorePreload extends XoopsPreloadItem
31: {
32: /**
33: * @param $args
34: */
35: public static function eventCoreUserStart($args)
36: {
37: $op = 'main';
38: if (isset($_POST['op'])) {
39: $op = Request::getString('op', '', 'POST');
40: } elseif (isset($_GET['op'])) {
41: $op = Request::getString('op', '', 'GET');
42: }
43: if ($op !== 'login' && (empty($_GET['from']) || 'profile' !== $_GET['from'])) {
44: header('location: ./modules/profile/user.php' . (empty($_SERVER['QUERY_STRING']) ? '' : '?' . $_SERVER['QUERY_STRING']));
45: exit();
46: }
47: }
48:
49: /**
50: * @param $args
51: */
52: public static function eventCoreEdituserStart($args)
53: {
54: header('location: ./modules/profile/edituser.php' . (empty($_SERVER['QUERY_STRING']) ? '' : '?' . $_SERVER['QUERY_STRING']));
55: exit();
56: }
57:
58: /**
59: * @param $args
60: */
61: public static function eventCoreLostpassStart($args)
62: {
63: $email = Request::getEmail('email', '', 'GET');
64: $email = Request::getEmail('email', $email, 'POST');
65: header("location: ./modules/profile/lostpass.php?email={$email}" . (empty($_GET['code']) ? '' : '&code=' . Request::getString('code', '', 'GET')));
66: exit();
67: }
68:
69: /**
70: * @param $args
71: */
72: public static function eventCoreRegisterStart($args)
73: {
74: header('location: ./modules/profile/register.php' . (empty($_SERVER['QUERY_STRING']) ? '' : '?' . $_SERVER['QUERY_STRING']));
75: exit();
76: }
77:
78: /**
79: * @param $args
80: */
81: public static function eventCoreUserinfoStart($args)
82: {
83: header('location: ./modules/profile/userinfo.php' . (empty($_SERVER['QUERY_STRING']) ? '' : '?' . $_SERVER['QUERY_STRING']));
84: exit();
85: }
86: }
87: