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