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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
|
<?php /* $Id: do_editprofile.php,v 1.1.1.1 2002/10/28 19:13:46 pbaecher Exp $ */ /* ThWboard - PHP/MySQL Bulletin Board System ============================================== (c) 2000, 2001 by Paul Baecher <paul@thewall.de> Felix Gonschorek <funner@thewall.de>
download the latest version: http://www.thwboard.de
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.
==============================================
*/ include "./inc/header.inc.php";
// http://www.securiteam.com/securitynews/5FP0C204KE.html $user = $HTTP_POST_VARS['user'];
function EditboxDecode($string) { $string = str_replace('&', '&', $string); $string = str_replace('"', '"', $string); $string = str_replace('<', '<', $string); $string = str_replace('>', '>', $string);
return $string; }
function check_siglen($string) { global $config;
// lines $a_line = explode("\n", $string); if( count($a_line) > $config['sig_maxlines'] ) { return 0; }
// len $length = 0; if( $a_line ) { while( list(, $line) = each($a_line) ) { $length += strlen(ereg_replace('\[([^\[]*)\]', '', $line)); } } if( $length > $config['sig_maxlen'] ) { return 0; } return 1; }
$navpath .= "Profil modifizieren"; if( $g_user['userid'] == 0 ) { message('Fehler', 'Beim Ausführen dieses Befehls ist ein Fehler aufgetreten. Entweder sind Sie nicht eingeloggt, oder haben versucht, sich widerrechtlich Zugang zu Ihnen nicht zugänglichen Funktionen zu schaffen.<br>Bitte kontaktieren Sie den Administrator dieses Boards, wenn Sie Probleme oder Fragen haben.'); }
if( $user['styleid'] != 0 ) { // verify that the user selected a public style .. $r_style = thwb_query("SELECT styleispublic FROM ".$pref."style WHERE styleid=$user[styleid]"); $tstyle = mysql_fetch_array($r_style); if( $tstyle['styleispublic'] != 1 ) { message('Fehler', 'Der von Ihnen gewählte Style ist leider nicht gültig.'); } }
unset($error_msg);
if( md5($user['userpassword']) != $g_user['userpassword'] ) { $err_msg .= "Das angegebene (derzeitige) Passwort ist nicht korrekt!<br>"; } if( $user['usernewpassword'] || $user['usernewpassword2'] ) { if ( $user['usernewpassword'] != $user['usernewpassword2'] ) { $err_msg .= "Bei dem Versuch das Passwort zu ändern muss ein Tippfehler vorgekommen sein. Bitte achten Sie auf Gross- und Kleinschreibung<br>"; } else { $user['userpassword'] = md5($user['usernewpassword']); } } else { $user['userpassword'] = $g_user['userpassword']; }
$user['userhomepage'] = EditboxDecode($user['userhomepage']); if( substr($user['userhomepage'], 0, 7) != "http://" ) { $user['userhomepage'] = "http://" . $user['userhomepage']; } $user['userlocation'] = EditboxDecode($user['userlocation']); $user['useroccupation'] = EditboxDecode($user['useroccupation']);
if ( $user['useravatar'] == "notallowed" ) { $user['useravatar'] = ""; }
if ( $config['useravatar'] == 1 ) { if ( $intavatar == "avatar/noavatar.gif" ) { $user['useravatar'] = ""; } else { $user['useravatar'] = $intavatar; } } elseif ( $config['useravatar'] == 2 ) { if ( $user['useravatar'] ) { checksize($user['useravatar']); } } elseif ( $config['useravatar'] == 3 ) { if( ( $intavatar != "avatar/noavatar.gif" ) && ( !$user['useravatar'] ) ) { $user['useravatar'] = $intavatar; } elseif ( $user['useravatar'] ) { checksize($user['useravatar']); } else { $user['useravatar'] = ""; } } else { $user['useravatar'] = ""; }
// check signature length. if( $config['sig_restrict'] ) { if( !check_siglen(preparse_code($user['usersignature'])) ) { $err_msg .= 'Ihre Signatur enthält zuviele Zeichen (max. '.$config['sig_maxlen'].') oder besteht aus zu vielen Linien (max. '.$config['sig_maxlines'].').'; } }
if( !$user['userpassword'] ) { $err_msg .= 'Bitte geben Sie ein Passwort an'; }
if( strlen($err_msg)>0 ) { message("Fehler","Es sind leider folgende Fehler aufgetreten:<br><br><font color='$style[color_err]'>$err_msg</font>"); } else { if( $user['userhomepage'] == 'http://' ) { $user['userhomepage'] = ''; }
if( $user['userbday_day'] == 0 || $user['userbday_month'] == 0 || $user['userbday_year'] == 0 ) { $user['userbday'] = '0000-00-00'; } else { $user['userbday'] = sprintf('%04d-%02d-%02d', $user['userbday_year'], $user['userbday_month'], $user['userbday_day']); } if( !thwb_query("UPDATE ".$pref."user SET userpassword='".addslashes($user['userpassword'])."', userhomepage='".addslashes($user['userhomepage'])."', userlocation='".addslashes($user['userlocation'])."', usericq='".addslashes($user['usericq'])."', useraim='".addslashes($user['useraim'])."', usermsn='".addslashes($user['usermsn'])."', userbday='".addslashes($user['userbday'])."', useroccupation='".addslashes($user['useroccupation'])."', useravatar='" .addslashes($user['useravatar']). "', userinterests='".addslashes($user['userinterests'])."', usersignature='".addslashes(preparse_code($user['usersignature']))."', userhideemail='".intval($user['userhideemail'])."', userinvisible='".intval($user['userinvisible'])."', usernoding='".intval($user['usernoding'])."', styleid='".intval($user['styleid'])."', userhidesig='".intval($user['userhidesig'])."' WHERE userid='$g_user[userid]'") ) { message("Fehler","Interner Fehler!"); } }
// *try* to reset password if( $user['usernewpassword'] || $user['usernewpassword2'] ) { setcookie("thwb_cookie", $user['userpassword'] . $g_user['userid'], (time() + 60 * 60 * 24 * 365)); }
message("Update erfolgreich!","Das Update war erfolgreich!");
?>
|