-
Notifications
You must be signed in to change notification settings - Fork 0
/
profile.php
156 lines (141 loc) · 4.62 KB
/
profile.php
1
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
<?php
/***************************************************************************
* profile.php
* -------------------
* begin : Saturday, Feb 13, 2001
* copyright : (C) 2001 The phpBB Group
* email : [email protected]
*
* $Id: profile.php,v 1.193.2.5 2004/11/18 17:49:37 acydburn Exp $
*
*
***************************************************************************/
/***************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
***************************************************************************/
define('IN_PHPBB', true);
if ( (isset($HTTP_GET_VARS['mode']) && ($HTTP_GET_VARS['mode'] == 'viewprofile')) || (isset($HTTP_POST_VARS['mode']) && ($HTTP_POST_VARS['mode'] == 'viewprofile')) )
{
define('IN_CASHMOD', true);
define('CM_VIEWPROFILE',true);
}
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_PROFILE);
init_userprefs($userdata);
//
// End session management
//
// session id check
if (!empty($HTTP_POST_VARS['sid']) || !empty($HTTP_GET_VARS['sid']))
{
$sid = (!empty($HTTP_POST_VARS['sid'])) ? $HTTP_POST_VARS['sid'] : $HTTP_GET_VARS['sid'];
}
else
{
$sid = '';
}
//
// Set default email variables
//
$script_name = preg_replace('/^\/?(.*?)\/?$/', '\1', trim($board_config['script_path']));
$script_name = ( $script_name != '' ) ? $script_name . '/profile.'.$phpEx : 'profile.'.$phpEx;
$server_name = trim($board_config['server_name']);
$server_protocol = ( $board_config['cookie_secure'] ) ? 'https://' : 'http://';
$server_port = ( $board_config['server_port'] <> 80 ) ? ':' . trim($board_config['server_port']) . '/' : '/';
$server_url = $server_protocol . $server_name . $server_port . $script_name;
// -----------------------
// Page specific functions
//
function gen_rand_string($hash)
{ $rand_str = dss_rand();
return ( $hash ) ? md5($rand_str) : substr($rand_str, 0, 8);
}
//
// End page specific functions
// ---------------------------
//
// Start of program proper
//
if ( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) )
{
$mode = ( isset($HTTP_GET_VARS['mode']) ) ? $HTTP_GET_VARS['mode'] : $HTTP_POST_VARS['mode'];
$mode = htmlspecialchars($mode);
if ( $mode == 'viewprofile' )
{
include($phpbb_root_path . 'includes/usercp_viewprofile.'.$phpEx);
exit;
}
else if ( $mode == 'editprofile' || $mode == 'register' )
{
if ( !$userdata['session_logged_in'] && $mode == 'editprofile' )
{
redirect(append_sid("login.$phpEx?redirect=profile.$phpEx&mode=editprofile", true));
}
include($phpbb_root_path . 'includes/usercp_register.'.$phpEx);
exit;
}
//-- mod : signature editor preview deluxe -------------------------------------
//-- add
else if ( $mode == 'signature' )
{
if ( !$userdata['session_logged_in'] && $mode == 'signature' )
{
$header_location = ( @preg_match("/Microsoft|WebSTAR|Xitami/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: ";
header($header_location . append_sid('login.' . $phpEx . '?redirect=profile.' . $phpEx . '&mode=signature', true));
exit;
}
include_once($phpbb_root_path . 'includes/bbc_box_tags.'.$phpEx);
include($phpbb_root_path . 'includes/usercp_signature.'.$phpEx);
exit;
}
//-- fin mod : signature editor preview deluxe ---------------------------------
else if ( $mode == 'confirm' )
{
// Visual Confirmation
if ( $userdata['session_logged_in'] && (htmlspecialchars($HTTP_GET_VARS['id']) != 'Admin'))
{
exit;
}
include($phpbb_root_path . 'includes/usercp_confirm.'.$phpEx);
exit;
}
else if ( $mode == 'sendpassword' )
{
include($phpbb_root_path . 'includes/usercp_sendpasswd.'.$phpEx);
exit;
}
else if ( $mode == 'activate' )
{
include($phpbb_root_path . 'includes/usercp_activate.'.$phpEx);
exit;
}
/**
* Olympus Style Login Screen 3.2.0, Afterlife(69) of www.afterlife69.com
* @ Author : (1) Afterlife_69
* @ Website : http://www.afterlife69.com
*/
/* --- ADD --- */
else if ( $mode == 'resendactivation' )
{
include($phpbb_root_path . 'includes/usercp_sendactivation.' . $phpEx);
exit;
}
/* --- END --- */
else if ( $mode == 'email' )
{
include($phpbb_root_path . 'includes/usercp_email.'.$phpEx);
exit;
}
}
redirect(append_sid("index.$phpEx", true));
?>