phpBB
Statistics
| Revision:

root / tags / milestone_3 / phpBB / adm / admin_users.php

History | View | Annotate | Download (76 kB)

1 3646 psotfx
<?php
2 5114 acydburn
/**
3 5114 acydburn
*
4 5114 acydburn
* @package acp
5 5114 acydburn
* @version $Id$
6 5114 acydburn
* @copyright (c) 2005 phpBB Group
7 5114 acydburn
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
8 5114 acydburn
*
9 5114 acydburn
*/
10 3646 psotfx
11 5114 acydburn
/**
12 5114 acydburn
*/
13 3646 psotfx
if (!empty($setmodules))
14 3646 psotfx
{
15 3646 psotfx
        if (!$auth->acl_gets('a_user', 'a_useradd', 'a_userdel'))
16 3646 psotfx
        {
17 3646 psotfx
                return;
18 3646 psotfx
        }
19 3646 psotfx
20 4642 psotfx
        $module['USER']['MANAGE_USERS'] = basename(__FILE__) . $SID;
21 3646 psotfx
22 3646 psotfx
        return;
23 3646 psotfx
}
24 3646 psotfx
25 3646 psotfx
define('IN_PHPBB', 1);
26 3646 psotfx
// Include files
27 3646 psotfx
$phpbb_root_path = '../';
28 4440 psotfx
$phpEx = substr(strrchr(__FILE__, '.'), 1);
29 3646 psotfx
require('pagestart.' . $phpEx);
30 4807 psotfx
include($phpbb_root_path.'includes/functions_user.'.$phpEx);
31 4812 psotfx
include($phpbb_root_path.'includes/functions_profile_fields.'.$phpEx);
32 3646 psotfx
33 5026 bartvb
$user->add_lang(array('posting', 'ucp'));
34 4844 acydburn
35 4807 psotfx
//
36 4807 psotfx
// Get and set basic vars
37 4807 psotfx
//
38 4841 psotfx
$mode                = request_var('mode', 'overview');
39 4841 psotfx
$action                = request_var('action', '');
40 4841 psotfx
41 4642 psotfx
$username        = request_var('username', '');
42 4642 psotfx
$user_id        = request_var('u', 0);
43 4841 psotfx
$gid                = request_var('g', 0);
44 4841 psotfx
45 4841 psotfx
$start                = request_var('start', 0);
46 4642 psotfx
$ip                        = request_var('ip', '');
47 4642 psotfx
$start                = request_var('start', 0);
48 4642 psotfx
$delete                = request_var('delete', '');
49 4812 psotfx
$deletetype        = request_var('deletetype', '');
50 4830 psotfx
$marked                = request_var('mark', 0);
51 4807 psotfx
$quicktools        = request_var('quicktools', '');
52 4823 psotfx
53 4841 psotfx
$st                        = request_var('st', 0);
54 4841 psotfx
$sk                        = request_var('sk', 'a');
55 4841 psotfx
$sd                        = request_var('sd', 'd');
56 4841 psotfx
57 4807 psotfx
$submit                = (isset($_POST['update'])) ? true : false;
58 4807 psotfx
$confirm        = (isset($_POST['confirm'])) ? true : false;
59 4807 psotfx
$cancel                = (isset($_POST['cancel'])) ? true : false;
60 4827 psotfx
$preview        = (isset($_POST['preview'])) ? true : false;
61 4830 psotfx
$deletemark = (isset($_POST['delmarked'])) ? true : false;
62 4830 psotfx
$deleteall        = (isset($_POST['delall'])) ? true : false;
63 4440 psotfx
64 4642 psotfx
$error = array();
65 4841 psotfx
$colspan = 0;
66 4642 psotfx
67 4807 psotfx
//
68 4807 psotfx
// Whois output
69 4807 psotfx
//
70 4642 psotfx
if ($action == 'whois')
71 3646 psotfx
{
72 4642 psotfx
        // Output relevant page
73 4642 psotfx
        adm_page_header($user->lang['WHOIS']);
74 4642 psotfx
75 4642 psotfx
        if ($ip && $domain = gethostbyaddr($ip))
76 3646 psotfx
        {
77 4642 psotfx
?>
78 3646 psotfx
79 4642 psotfx
<table class="bg" width="90%" cellspacing="1" cellpadding="4" border="0" align="center">
80 4642 psotfx
        <tr>
81 4642 psotfx
                <th>IP whois for <?php echo $domain; ?></th>
82 4642 psotfx
        </tr>
83 4642 psotfx
        <tr>
84 4642 psotfx
                <td class="row1"><?php
85 4642 psotfx
86 4812 psotfx
                if ($ipwhois = user_ipwhois($ip))
87 3646 psotfx
                {
88 4642 psotfx
                        $ipwhois = preg_replace('#(\s+?)([\w\-\._\+]+?@[\w\-\.]+?)(\s+?)#s', '\1<a href="mailto:\2">\2</a>\3', $ipwhois);
89 4642 psotfx
                        echo '<br /><pre align="left">' . trim($ipwhois) . '</pre>';
90 3646 psotfx
                }
91 4642 psotfx
92 4642 psotfx
?></td>
93 4642 psotfx
        </tr>
94 4642 psotfx
</table>
95 4642 psotfx
96 4642 psotfx
<br clear="all" />
97 4642 psotfx
98 4642 psotfx
<?php
99 4642 psotfx
100 3646 psotfx
        }
101 3646 psotfx
102 4642 psotfx
        adm_page_footer();
103 4642 psotfx
}
104 4642 psotfx
105 4807 psotfx
//
106 4807 psotfx
// Obtain user information if appropriate
107 4807 psotfx
//
108 4642 psotfx
if ($username || $user_id)
109 4642 psotfx
{
110 4807 psotfx
        $session_time = 0;
111 4807 psotfx
        $sql_where = ($user_id) ? "user_id = $user_id" : "username = '" . $db->sql_escape($username) . "'";
112 4841 psotfx
        $sql = ($action == 'overview') ? 'SELECT u.*, s.session_time, s.session_page, s.session_ip FROM (' . USERS_TABLE . ' u LEFT JOIN ' . SESSIONS_TABLE . " s ON s.session_user_id = u.user_id) WHERE u.$sql_where ORDER BY s.session_time DESC" : 'SELECT * FROM ' . USERS_TABLE . " WHERE $sql_where";
113 4807 psotfx
        $result = $db->sql_query($sql);
114 4807 psotfx
115 4807 psotfx
        if (!extract($db->sql_fetchrow($result)))
116 3646 psotfx
        {
117 4807 psotfx
                trigger_error($user->lang['NO_USER']);
118 4807 psotfx
        }
119 4807 psotfx
        $db->sql_freeresult($result);
120 4807 psotfx
121 4807 psotfx
        if ($session_time > $user_lastvisit)
122 4807 psotfx
        {
123 4807 psotfx
                $user_lastvisit = $session_time;
124 4807 psotfx
                $user_lastpage = $session_page;
125 4807 psotfx
        }
126 4807 psotfx
127 4807 psotfx
        $user_password = '';
128 4807 psotfx
}
129 4807 psotfx
130 4807 psotfx
// Output page
131 4807 psotfx
adm_page_header($user->lang['MANAGE']);
132 4807 psotfx
133 4841 psotfx
134 4807 psotfx
//
135 4841 psotfx
// Output forms
136 4807 psotfx
//
137 4841 psotfx
138 4841 psotfx
// Begin program
139 4841 psotfx
if ($username || $user_id)
140 4807 psotfx
{
141 4841 psotfx
        // Generate overall "header" for user admin
142 4841 psotfx
        $form_options = '';
143 4841 psotfx
        $forms_ary = array('overview' => 'OVERVIEW', 'feedback' => 'FEEDBACK', 'profile' => 'PROFILE', 'prefs' => 'PREFS', 'avatar' => 'AVATAR', 'sig' => 'SIG', 'groups' => 'GROUP', 'perm' => 'PERM', 'attach' => 'ATTACH');
144 4841 psotfx
145 4841 psotfx
        foreach ($forms_ary as $value => $lang)
146 4807 psotfx
        {
147 4841 psotfx
                $selected = ($mode == $value) ? ' selected="selected"' : '';
148 4841 psotfx
                $form_options .= '<option value="' . $value . '"' . $selected . '>' . $user->lang['USER_ADMIN_' . $lang]  . '</option>';
149 4841 psotfx
        }
150 4841 psotfx
151 4841 psotfx
        $pagination = '';
152 4841 psotfx
153 4841 psotfx
?>
154 4841 psotfx
155 4841 psotfx
<script language="javascript" type="text/javascript">
156 4841 psotfx
<!--
157 4841 psotfx
158 4841 psotfx
var form_name = 'admin';
159 4841 psotfx
var text_name = 'signature';
160 4841 psotfx
161 4841 psotfx
// Define the bbCode tags
162 4841 psotfx
bbcode = new Array();
163 4841 psotfx
bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]');
164 4841 psotfx
imageTag = false;
165 4841 psotfx
166 4841 psotfx
// Helpline messages
167 4841 psotfx
b_help = "<?php echo $user->lang['BBCODE_B_HELP']; ?>";
168 4841 psotfx
i_help = "<?php echo $user->lang['BBCODE_I_HELP']; ?>";
169 4841 psotfx
u_help = "<?php echo $user->lang['BBCODE_U_HELP']; ?>";
170 4841 psotfx
q_help = "<?php echo $user->lang['BBCODE_Q_HELP']; ?>";
171 4841 psotfx
c_help = "<?php echo $user->lang['BBCODE_C_HELP']; ?>";
172 4841 psotfx
l_help = "<?php echo $user->lang['BBCODE_L_HELP']; ?>";
173 4841 psotfx
o_help = "<?php echo $user->lang['BBCODE_O_HELP']; ?>";
174 4841 psotfx
p_help = "<?php echo $user->lang['BBCODE_P_HELP']; ?>";
175 4841 psotfx
w_help = "<?php echo $user->lang['BBCODE_W_HELP']; ?>";
176 4841 psotfx
a_help = "<?php echo $user->lang['BBCODE_A_HELP']; ?>";
177 4841 psotfx
s_help = "<?php echo $user->lang['BBCODE_S_HELP']; ?>";
178 4841 psotfx
f_help = "<?php echo $user->lang['BBCODE_F_HELP']; ?>";
179 4841 psotfx
e_help = "<?php echo $user->lang['BBCODE_E_HELP']; ?>";
180 4841 psotfx
181 4841 psotfx
//-->
182 4841 psotfx
</script>
183 4841 psotfx
<script language="javascript" type="text/javascript" src="editor.js"></script>
184 4841 psotfx
185 4841 psotfx
<h1><?php echo $user->lang['USER_ADMIN']; ?></h1>
186 4841 psotfx
187 4841 psotfx
<p><?php echo $user->lang['USER_ADMIN_EXPLAIN']; ?></p>
188 4841 psotfx
189 4841 psotfx
<form method="post" name="admin" action="<?php echo "admin_users.$phpEx$SID&amp;mode=$mode&amp;u=$user_id"; ?>"<?php echo ($file_uploads) ? ' enctype="multipart/form-data"' : ''; ?>><table width="100%" cellspacing="2" cellpadding="0" border="0" align="center">
190 4841 psotfx
        <tr>
191 4841 psotfx
                <td align="right"><?php echo $user->lang['SELECT_FORM']; ?>: <select name="mode" onchange="if (this.options[this.selectedIndex].value != '') this.form.submit();"><?php echo $form_options; ?></select></td>
192 4841 psotfx
        </tr>
193 4841 psotfx
        <tr>
194 4841 psotfx
                <td><table class="bg" width="100%" cellspacing="1" cellpadding="4" border="0">
195 4841 psotfx
<?php
196 4841 psotfx
197 4841 psotfx
        if (sizeof($error))
198 4841 psotfx
        {
199 4841 psotfx
200 4841 psotfx
?>
201 4841 psotfx
                        <tr>
202 4841 psotfx
                                <td class="row3" colspan="" align="center"><span class="error"><?php echo implode('<br />', $error); ?></span></td>
203 4841 psotfx
                        </tr>
204 4841 psotfx
<?php
205 4841 psotfx
206 4841 psotfx
        }
207 4841 psotfx
208 4841 psotfx
209 4841 psotfx
        switch ($mode)
210 4841 psotfx
        {
211 4807 psotfx
                case 'overview':
212 4807 psotfx
213 4841 psotfx
                        if ($submit)
214 4642 psotfx
                        {
215 4841 psotfx
                                if ($delete && $user_type != USER_FOUNDER)
216 4807 psotfx
                                {
217 4841 psotfx
                                        if (!$auth->acl_get('a_userdel'))
218 4841 psotfx
                                        {
219 4841 psotfx
                                                trigger_error($user->lang['NO_ADMIN']);
220 4841 psotfx
                                        }
221 4807 psotfx
222 4841 psotfx
                                        if (!$cancel && !$confirm)
223 4841 psotfx
                                        {
224 4841 psotfx
                                                adm_page_confirm($user->lang['CONFIRM'], $user->lang['CONFIRM_OPERATION']);
225 4841 psotfx
                                        }
226 4841 psotfx
                                        else if (!$cancel)
227 4841 psotfx
                                        {
228 4841 psotfx
                                                user_delete($deletetype, $user_id);
229 4807 psotfx
230 4841 psotfx
                                                add_log('admin', 'LOG_USER_DELETED', $username);
231 4841 psotfx
                                                trigger_error($user->lang['USER_DELETED']);
232 4841 psotfx
                                        }
233 4807 psotfx
                                }
234 3646 psotfx
235 4841 psotfx
                                // Handle quicktool actions
236 4841 psotfx
                                if ($quicktools && $user_type != USER_FOUNDER)
237 4807 psotfx
                                {
238 4841 psotfx
                                        switch ($quicktools)
239 4841 psotfx
                                        {
240 4841 psotfx
                                                case 'banuser':
241 4841 psotfx
                                                case 'banemail':
242 4841 psotfx
                                                case 'banip':
243 4841 psotfx
                                                        $ban = array();
244 3646 psotfx
245 4841 psotfx
                                                        switch ($quicktools)
246 4841 psotfx
                                                        {
247 4841 psotfx
                                                                case 'banuser':
248 4841 psotfx
                                                                        $ban[] = $username;
249 4841 psotfx
                                                                        $reason = 'USER_ADMIN_BAN_NAME_REASON';
250 4841 psotfx
                                                                        $log = 'LOG_BAN_USERNAME_USER';
251 4841 psotfx
                                                                        break;
252 4807 psotfx
253 4841 psotfx
                                                                case 'banemail':
254 4841 psotfx
                                                                        $ban[] = $user_email;
255 4841 psotfx
                                                                        $reason = 'USER_ADMIN_BAN_EMAIL_REASON';
256 4841 psotfx
                                                                        $log = 'LOG_BAN_EMAIL_USER';
257 4841 psotfx
                                                                        break;
258 4807 psotfx
259 4841 psotfx
                                                                case 'banip':
260 4841 psotfx
                                                                        $ban[] = $user_ip;
261 4807 psotfx
262 4841 psotfx
                                                                        $sql = 'SELECT DISTINCT poster_ip
263 4841 psotfx
                                                                                FROM ' . POSTS_TABLE . "
264 4841 psotfx
                                                                                WHERE poster_id = $user_id";
265 4841 psotfx
                                                                        $result = $db->sql_query($sql);
266 4807 psotfx
267 4841 psotfx
                                                                        while ($row = $db->sql_fetchrow($result))
268 4841 psotfx
                                                                        {
269 4841 psotfx
                                                                                $ban[] = $row['poster_ip'];
270 4841 psotfx
                                                                        }
271 4841 psotfx
                                                                        $db->sql_freeresult($result);
272 4807 psotfx
273 4841 psotfx
                                                                        $reason = 'USER_ADMIN_BAN_IP_REASON';
274 4841 psotfx
                                                                        $log = 'LOG_BAN_IP_USER';
275 4841 psotfx
                                                                        break;
276 4841 psotfx
                                                        }
277 4807 psotfx
278 4841 psotfx
                                                        user_ban(substr($quicktools, 3), $ban, 0, 0, 0, $user->lang[$reason]);
279 4807 psotfx
280 4841 psotfx
                                                        add_log('user', $user_id, $log);
281 4830 psotfx
282 4841 psotfx
                                                        trigger_error($user->lang['BAN_UPDATE_SUCESSFUL']);
283 4807 psotfx
284 4841 psotfx
                                                        break;
285 4807 psotfx
286 4841 psotfx
                                                case 'reactivate':
287 4807 psotfx
288 4841 psotfx
                                                        if ($config['email_enable'])
289 4841 psotfx
                                                        {
290 4841 psotfx
                                                                include_once($phpbb_root_path . 'includes/functions_messenger.'.$phpEx);
291 4807 psotfx
292 4841 psotfx
                                                                $user_actkey = gen_rand_string(10);
293 4841 psotfx
                                                                $key_len = 54 - (strlen($server_url));
294 4841 psotfx
                                                                $key_len = ($key_len > 6) ? $key_len : 6;
295 4841 psotfx
                                                                $user_actkey = substr($user_actkey, 0, $key_len);
296 4807 psotfx
297 4841 psotfx
                                                                user_active_flip($user_id, $user_type, $user_actkey, $username);
298 4807 psotfx
299 4841 psotfx
                                                                $messenger = new messenger();
300 4807 psotfx
301 4841 psotfx
                                                                $messenger->template('user_welcome_inactive', $user_lang);
302 4841 psotfx
                                                                $messenger->subject();
303 4807 psotfx
304 4841 psotfx
                                                                $messenger->replyto($config['board_contact']);
305 4841 psotfx
                                                                $messenger->to($user_email, $username);
306 4807 psotfx
307 4841 psotfx
                                                                $messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
308 4841 psotfx
                                                                $messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
309 4841 psotfx
                                                                $messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']);
310 4841 psotfx
                                                                $messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
311 4807 psotfx
312 4841 psotfx
                                                                $messenger->assign_vars(array(
313 4841 psotfx
                                                                        'SITENAME'                => $config['sitename'],
314 4841 psotfx
                                                                        'WELCOME_MSG'        => sprintf($user->lang['WELCOME_SUBJECT'], $config['sitename']),
315 4841 psotfx
                                                                        'USERNAME'                => $username,
316 4841 psotfx
                                                                        'PASSWORD'                => $password_confirm,
317 4841 psotfx
                                                                        'EMAIL_SIG'                => str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']),
318 4807 psotfx
319 4841 psotfx
                                                                        'U_ACTIVATE'        => generate_board_url() . "/ucp.$phpEx?mode=activate&u=$user_id&k=$user_actkey")
320 4841 psotfx
                                                                );
321 4807 psotfx
322 4841 psotfx
                                                                $messenger->send(NOTIFY_EMAIL);
323 5114 acydburn
                                                                $messenger->save_queue();
324 4830 psotfx
325 4841 psotfx
                                                                add_log('admin', 'LOG_USER_REACTIVATE', $username);
326 4841 psotfx
                                                                add_log('user', $user_id, 'LOG_USER_REACTIVATE_USER');
327 4830 psotfx
328 4841 psotfx
                                                                trigger_error($user->lang['USER_ADMIN_REACTIVATE']);
329 4841 psotfx
                                                        }
330 4807 psotfx
331 4841 psotfx
                                                        break;
332 4807 psotfx
333 4841 psotfx
                                                case 'active':
334 4807 psotfx
335 4841 psotfx
                                                        user_active_flip($user_id, $user_type, false, $username);
336 4807 psotfx
337 4841 psotfx
                                                        $message = ($user_type == USER_NORMAL) ? 'USER_ADMIN_INACTIVE' : 'USER_ADMIN_ACTIVE';
338 4841 psotfx
                                                        $log = ($user_type == USER_NORMAL) ? 'LOG_USER_INACTIVE' : 'LOG_USER_ACTIVE';
339 4830 psotfx
340 4841 psotfx
                                                        add_log('admin', $log, $username);
341 4841 psotfx
                                                        add_log('user', $user_id, $log . '_USER');
342 4830 psotfx
343 4841 psotfx
                                                        trigger_error($user->lang[$message]);
344 4841 psotfx
                                                        break;
345 4807 psotfx
346 4841 psotfx
                                                case 'moveposts':
347 4807 psotfx
348 4841 psotfx
                                                        if (!($new_forum_id = request_var('new_f', 0)))
349 4841 psotfx
                                                        {
350 4807 psotfx
351 4807 psotfx
?>
352 4807 psotfx
353 4807 psotfx
<h1><?php echo $user->lang['USER_ADMIN']; ?></h1>
354 4807 psotfx
355 4807 psotfx
<p><?php echo $user->lang['USER_ADMIN_EXPLAIN']; ?></p>
356 4807 psotfx
357 4807 psotfx
<form method="post" action="<?php echo "admin_users.$phpEx$SID&amp;action=$action&amp;quicktools=moveposts&amp;u=$user_id"; ?>"><table class="bg" cellspacing="1" cellpadding="4" border="0" align="center">
358 4807 psotfx
        <tr>
359 4807 psotfx
                <th align="center"><?php echo $user->lang['USER_ADMIN_MOVE_POSTS']; ?></th>
360 4807 psotfx
        </tr>
361 4807 psotfx
        <tr>
362 4807 psotfx
                <td class="row2" align="center" valign="middle"><?php echo $user->lang['MOVE_POSTS_EXPLAIN']; ?><br /><br /><select name="new_f"><?php
363 4807 psotfx
364 4841 psotfx
                                                        echo make_forum_select(false, false, false, true);
365 4807 psotfx
366 4807 psotfx
?></select>&nbsp;</td>
367 4807 psotfx
        </tr>
368 4807 psotfx
        <tr>
369 4807 psotfx
                <td class="cat" align="center"><input type="submit" name="update" value="<?php echo $user->lang['SUBMIT']; ?>" class="btnmain" /></td>
370 4807 psotfx
        </tr>
371 4807 psotfx
</table>
372 4807 psotfx
<?php
373 4807 psotfx
374 4841 psotfx
                                                                adm_page_footer();
375 4841 psotfx
                                                        }
376 4841 psotfx
                                                        else
377 4841 psotfx
                                                        {
378 4841 psotfx
                                                                // Two stage?
379 4841 psotfx
                                                                // Move topics comprising only posts from this user
380 4841 psotfx
                                                                $topic_id_ary = array();
381 4841 psotfx
                                                                $forum_id_ary = array($new_forum_id);
382 4807 psotfx
383 4841 psotfx
                                                                $sql = 'SELECT topic_id, COUNT(post_id) AS total_posts
384 4841 psotfx
                                                                        FROM ' . POSTS_TABLE . "
385 4841 psotfx
                                                                        WHERE poster_id = $user_id
386 4841 psotfx
                                                                                AND forum_id <> $new_forum_id
387 4841 psotfx
                                                                        GROUP BY topic_id";
388 4841 psotfx
                                                                $result = $db->sql_query($sql);
389 4807 psotfx
390 4841 psotfx
                                                                while ($row = $db->sql_fetchrow($result))
391 4841 psotfx
                                                                {
392 4841 psotfx
                                                                        $topic_id_ary[$row['topic_id']] = $row['total_posts'];
393 4841 psotfx
                                                                }
394 4841 psotfx
                                                                $db->sql_freeresult($result);
395 4807 psotfx
396 4841 psotfx
                                                                $sql = 'SELECT topic_id, forum_id, topic_title, topic_replies, topic_replies_real
397 4841 psotfx
                                                                        FROM ' . TOPICS_TABLE . '
398 4841 psotfx
                                                                        WHERE topic_id IN (' . implode(', ', array_keys($topic_id_ary)) . ')';
399 4841 psotfx
                                                                $result = $db->sql_query($sql);
400 4807 psotfx
401 4841 psotfx
                                                                $move_topic_ary = $move_post_ary = array();
402 4841 psotfx
                                                                while ($row = $db->sql_fetchrow($result))
403 4807 psotfx
                                                                {
404 4841 psotfx
                                                                        if (max($row['topic_replies'], $row['topic_replies_real']) + 1 == $topic_id_ary[$row['topic_id']])
405 4841 psotfx
                                                                        {
406 4841 psotfx
                                                                                $move_topic_ary[] = $row['topic_id'];
407 4841 psotfx
                                                                        }
408 4841 psotfx
                                                                        else
409 4841 psotfx
                                                                        {
410 4841 psotfx
                                                                                $move_post_ary[$row['topic_id']]['title'] = $row['topic_title'];
411 4841 psotfx
                                                                                $move_post_ary[$row['topic_id']]['attach'] = ($row['attach']) ? 1 : 0;
412 4841 psotfx
                                                                        }
413 4841 psotfx
414 4841 psotfx
                                                                        $forum_id_ary[] = $row['forum_id'];
415 4807 psotfx
                                                                }
416 4841 psotfx
                                                                $db->sql_freeresult($result);
417 4841 psotfx
418 4841 psotfx
                                                                // Entire topic comprises posts by this user, move these topics
419 4841 psotfx
                                                                if (sizeof($move_topic_ary))
420 4807 psotfx
                                                                {
421 4841 psotfx
                                                                        move_topics($move_topic_ary, $new_forum_id, false);
422 4807 psotfx
                                                                }
423 4807 psotfx
424 4841 psotfx
                                                                if (sizeof($move_post_ary))
425 4807 psotfx
                                                                {
426 4807 psotfx
                                                                        // Create new topic
427 4841 psotfx
                                                                        // Update post_ids, report_ids, attachment_ids
428 4841 psotfx
                                                                        foreach ($move_post_ary as $topic_id => $post_ary)
429 4841 psotfx
                                                                        {
430 4841 psotfx
                                                                                // Create new topic
431 4841 psotfx
                                                                                $sql = 'INSERT INTO ' . TOPICS_TABLE . ' ' . $db->sql_build_array('INSERT', array(
432 4841 psotfx
                                                                                        'topic_poster'                                => $user_id,
433 4841 psotfx
                                                                                        'topic_time'                                => time(),
434 4841 psotfx
                                                                                        'forum_id'                                         => $new_forum_id,
435 4841 psotfx
                                                                                        'icon_id'                                        => 0,
436 4841 psotfx
                                                                                        'topic_approved'                        => 1,
437 4841 psotfx
                                                                                        'topic_title'                                 => $post_ary['title'],
438 4841 psotfx
                                                                                        'topic_first_poster_name'        => $username,
439 4841 psotfx
                                                                                        'topic_type'                                => POST_NORMAL,
440 4841 psotfx
                                                                                        'topic_time_limit'                        => 0,
441 4841 psotfx
                                                                                        'topic_attachment'                        => $post_ary['attach'],)
442 4841 psotfx
                                                                                );
443 4841 psotfx
                                                                                $db->sql_query($sql);
444 4807 psotfx
445 4841 psotfx
                                                                                $new_topic_id = $db->sql_nextid();
446 4807 psotfx
447 4841 psotfx
                                                                                // Move posts
448 4841 psotfx
                                                                                $sql = 'UPDATE ' . POSTS_TABLE . "
449 4841 psotfx
                                                                                        SET forum_id = $new_forum_id, topic_id = $new_topic_id
450 4807 psotfx
                                                                                        WHERE topic_id = $topic_id
451 4807 psotfx
                                                                                                AND poster_id = $user_id";
452 4807 psotfx
                                                                                $db->sql_query($sql);
453 4841 psotfx
454 4841 psotfx
                                                                                if ($post_ary['attach'])
455 4841 psotfx
                                                                                {
456 4841 psotfx
                                                                                        $sql = 'UPDATE ' . ATTACHMENTS_TABLE . "
457 4841 psotfx
                                                                                                SET topic_id = $new_topic_id
458 4841 psotfx
                                                                                                WHERE topic_id = $topic_id
459 4841 psotfx
                                                                                                        AND poster_id = $user_id";
460 4841 psotfx
                                                                                        $db->sql_query($sql);
461 4841 psotfx
                                                                                }
462 4841 psotfx
463 4841 psotfx
                                                                                $new_topic_id_ary[] = $new_topic_id;
464 4807 psotfx
                                                                        }
465 4807 psotfx
                                                                }
466 4807 psotfx
467 4841 psotfx
                                                                $forum_id_ary = array_unique($forum_id_ary);
468 4841 psotfx
                                                                $topic_id_ary = array_unique(array_merge($topic_id_ary, $new_topic_id_ary));
469 4807 psotfx
470 4841 psotfx
                                                                sync('reported', 'topic_id', $topic_id_ary);
471 4841 psotfx
                                                                sync('topic', 'topic_id', $topic_id_ary);
472 4841 psotfx
                                                                sync('forum', 'forum_id', $forum_id_ary);
473 4841 psotfx
                                                        }
474 4807 psotfx
475 4841 psotfx
                                                        break;
476 4841 psotfx
                                        }
477 4807 psotfx
478 4841 psotfx
                                        $sql = 'SELECT forum_name
479 4841 psotfx
                                                FROM ' . TOPICS_TABLE . "
480 4841 psotfx
                                                WHERE topic_id = $new_forum_id";
481 4841 psotfx
                                        $result = $db->sql_query($sql);
482 4830 psotfx
483 4841 psotfx
                                        extract($db->sql_fetchrow($result));
484 4841 psotfx
                                        $db->sql_freeresult($result);
485 4830 psotfx
486 4841 psotfx
                                        add_log('admin', 'LOG_USER_MOVE_POSTS', $forum_name, $username);
487 4841 psotfx
                                        add_log('user', $user_id, 'LOG_USER_MOVE_POSTS_USER', $forum_name);
488 4830 psotfx
489 4841 psotfx
                                        trigger_error($user->lang['USER_ADMIN_MOVE']);
490 4841 psotfx
                                }
491 4807 psotfx
492 4841 psotfx
                                // Handle registration info updates
493 4841 psotfx
                                $var_ary = array(
494 4841 psotfx
                                        'username'                        => (string) $username,
495 4841 psotfx
                                        'user_founder'                => (int) $user_founder,
496 4841 psotfx
                                        'user_type'                        => (int) $user_type,
497 4841 psotfx
                                        'user_email'                => (string) $user_email,
498 4841 psotfx
                                        'email_confirm'                => (string) '',
499 4841 psotfx
                                        'user_password'                => (string) '',
500 4841 psotfx
                                        'password_confirm'        => (string) '',
501 4841 psotfx
                                        'user_warnings'                => (int) $user_warnings,
502 4807 psotfx
                                );
503 4807 psotfx
504 4841 psotfx
                                foreach ($var_ary as $var => $default)
505 4841 psotfx
                                {
506 4841 psotfx
                                        $data[$var] = request_var($var, $default);
507 4841 psotfx
                                }
508 4807 psotfx
509 4841 psotfx
                                $var_ary = array(
510 4841 psotfx
                                        'password_confirm'        => array('string', true, $config['min_pass_chars'], $config['max_pass_chars']),
511 4841 psotfx
                                        'user_password'                => array('string', true, $config['min_pass_chars'], $config['max_pass_chars']),
512 4841 psotfx
                                        'user_email'                => array(
513 4841 psotfx
                                                array('string', false, 6, 60),
514 4841 psotfx
                                                array('email', $email)),
515 4841 psotfx
                                        'email_confirm'                => array('string', true, 6, 60),
516 4841 psotfx
                                        'user_warnings'                => array('num', 0, $config['max_warnings']),
517 4807 psotfx
                                );
518 4807 psotfx
519 4841 psotfx
                                // Check username if altered
520 4841 psotfx
                                if ($username != $data['username'])
521 4807 psotfx
                                {
522 4841 psotfx
                                        $var_ary += array(
523 4841 psotfx
                                                'username'                        => array(
524 4841 psotfx
                                                        array('string', false, $config['min_name_chars'], $config['max_name_chars']),
525 4841 psotfx
                                                        array('username', $username)),
526 4807 psotfx
                                        );
527 4807 psotfx
                                }
528 4807 psotfx
529 4841 psotfx
                                $error = validate_data($data, $var_ary);
530 4807 psotfx
531 4841 psotfx
                                if ($data['user_password'] && $data['password_confirm'] != $data['user_password'])
532 4807 psotfx
                                {
533 4841 psotfx
                                        $error[] = 'NEW_PASSWORD_ERROR';
534 4807 psotfx
                                }
535 4807 psotfx
536 4841 psotfx
                                if ($user_email != $data['user_email'] && $data['email_confirm'] != $data['user_email'])
537 4807 psotfx
                                {
538 4841 psotfx
                                        $error[] = 'NEW_EMAIL_ERROR';
539 4807 psotfx
                                }
540 4807 psotfx
541 4841 psotfx
                                // Which updates do we need to do?
542 4841 psotfx
                                $update_warning = ($user_warnings != $data['user_warnings']) ? true : false;
543 4841 psotfx
                                $update_username = ($username != $data['username']) ? $username : false;
544 4841 psotfx
                                $update_password = ($user_password != $data['user_password']) ? true : false;
545 4642 psotfx
546 4841 psotfx
                                extract($data);
547 4841 psotfx
                                unset($data);
548 4642 psotfx
549 4841 psotfx
                                if (!sizeof($error))
550 4830 psotfx
                                {
551 4841 psotfx
                                        $sql_ary = array(
552 4841 psotfx
                                                'username'                        => $username,
553 4841 psotfx
                                                'user_founder'                => $user_founder,
554 4841 psotfx
                                                'user_email'                => $user_email,
555 4841 psotfx
                                                'user_email_hash'        => crc32(strtolower($user_email)) . strlen($user_email),
556 4841 psotfx
                                                'user_warnings'                => $user_warnings,
557 4841 psotfx
                                        );
558 4830 psotfx
559 4841 psotfx
                                        if ($update_password)
560 4823 psotfx
                                        {
561 4841 psotfx
                                                $sql_ary += array(
562 4841 psotfx
                                                        'user_password' => md5($user_password),
563 4841 psotfx
                                                        'user_passchg'        => time(),
564 4841 psotfx
                                                );
565 4823 psotfx
                                        }
566 4823 psotfx
567 4830 psotfx
                                        $sql = 'UPDATE ' . USERS_TABLE . '
568 4841 psotfx
                                                SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
569 4841 psotfx
                                                WHERE user_id = ' . $user->data['user_id'];
570 4827 psotfx
                                        $db->sql_query($sql);
571 4827 psotfx
572 4841 psotfx
                                        // TODO
573 4841 psotfx
                                        if ($update_warning)
574 4827 psotfx
                                        {
575 4827 psotfx
                                        }
576 4827 psotfx
577 4841 psotfx
                                        if ($update_username)
578 4833 acydburn
                                        {
579 4841 psotfx
                                                user_update_name($update_username, $username);
580 4833 acydburn
                                        }
581 4833 acydburn
582 4841 psotfx
                                        trigger_error($user->lang['USER_OVERVIEW_UPDATED']);
583 4841 psotfx
                                }
584 4833 acydburn
585 4841 psotfx
                                // Replace "error" strings with their real, localised form
586 4841 psotfx
                                $error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
587 4833 acydburn
                        }
588 3646 psotfx
589 4841 psotfx
                        $colspan = 2;
590 4642 psotfx
591 4807 psotfx
                        $user_char_ary = array('.*' => 'USERNAME_CHARS_ANY', '[\w]+' => 'USERNAME_ALPHA_ONLY', '[\w_\+\. \-\[\]]+' => 'USERNAME_ALPHA_SPACERS');
592 4841 psotfx
                        $quick_tool_ary = array('banuser' => 'BAN_USER', 'banemail' => 'BAN_EMAIL', 'banip' => 'BAN_IP', 'active' => (($user_type == USER_INACTIVE) ? 'ACTIVATE' : 'DEACTIVATE'), 'delsig' => 'DEL_SIG', 'delavatar' => 'DEL_AVATAR', 'moveposts' => 'MOVE_POSTS', 'delposts' => 'DEL_POSTS', 'delattach' => 'DEL_ATTACH');
593 4807 psotfx
                        if ($config['email_enable'])
594 4642 psotfx
                        {
595 4807 psotfx
                                $quick_tool_ary['reactivate'] = 'FORCE';
596 4807 psotfx
                        }
597 4807 psotfx
598 4807 psotfx
                        $options = '<option class="sep" value="">' . $user->lang['SELECT_OPTION'] . '</option>';
599 4807 psotfx
                        foreach ($quick_tool_ary as $value => $lang)
600 4807 psotfx
                        {
601 4642 psotfx
                                $options .= '<option value="' . $value . '">' . $user->lang['USER_ADMIN_' . $lang]  . '</option>';
602 4642 psotfx
                        }
603 4642 psotfx
604 4642 psotfx
                        $user_founder_yes = ($user_type == USER_FOUNDER) ? ' checked="checked"' : '';
605 4642 psotfx
                        $user_founder_no = ($user_type != USER_FOUNDER) ? ' checked="checked"' : (($user->data['user_type'] != USER_FOUNDER) ? ' disabled="disabled"' : '');
606 4642 psotfx
607 3646 psotfx
?>
608 3646 psotfx
                        <tr>
609 4841 psotfx
                                <th colspan="2"><?php echo $user->lang['USER_ADMIN_OVERVIEW']; ?></th>
610 4841 psotfx
                        </tr>
611 4841 psotfx
                        <tr>
612 4807 psotfx
                                <td class="row1" width="40%"><?php echo $user->lang['USERNAME']; ?>: <br /><span class="gensmall"><?php echo sprintf($user->lang[$user_char_ary[str_replace('\\\\', '\\', $config['allow_name_chars'])] . '_EXPLAIN'], $config['min_name_chars'], $config['max_name_chars']); ?></span></td>
613 4642 psotfx
                                <td class="row2"><input class="post" type="text" name="username" value="<?php echo $username; ?>" maxlength="60" /></td>
614 3646 psotfx
                        </tr>
615 3646 psotfx
                        <tr>
616 4807 psotfx
                                <td class="row1"><?php echo $user->lang['REGISTERED']; ?>: </td>
617 4807 psotfx
                                <td class="row2"><strong><?php echo $user->format_date($user_regdate); ?></strong></td>
618 3646 psotfx
                        </tr>
619 4807 psotfx
<?php
620 4807 psotfx
621 4807 psotfx
                        if ($user_ip)
622 4807 psotfx
                        {
623 4807 psotfx
624 4807 psotfx
?>
625 3646 psotfx
                        <tr>
626 4807 psotfx
                                <td class="row1"><?php echo $user->lang['REGISTERED_IP']; ?>: </td>
627 4807 psotfx
                                <td class="row2"><strong><?php echo "<a href=\"admin_users.$phpEx$SID&amp;action=$action&amp;u=$user_id&amp;ip=" . ((!$ip || $ip == 'ip') ? 'hostname' : 'ip') . '">' . (($ip == 'hostname') ? gethostbyaddr($user_ip) : $user_ip) . "</a> [ <a href=\"admin_users.$phpEx$SID&amp;action=whois&amp;ip=$user_ip\" onclick=\"window.open('admin_users.$phpEx$SID&amp;action=whois&amp;ip=$user_ip', '', 'HEIGHT=500,resizable=yes,scrollbars=yes,WIDTH=600');return false;\">" . $user->lang['WHOIS'] . '</a> ]'; ?></strong></td>
628 4807 psotfx
                        </tr>
629 4807 psotfx
<?php
630 4807 psotfx
631 4807 psotfx
                        }
632 4807 psotfx
633 4807 psotfx
?>
634 4807 psotfx
                        <tr>
635 4807 psotfx
                                <td class="row1" width="40%"><?php echo $user->lang['LAST_ACTIVE']; ?>: </td>
636 4807 psotfx
                                <td class="row2"><strong><?php echo $user->format_date($user_lastvisit); ?></strong></td>
637 4807 psotfx
                        </tr>
638 4807 psotfx
                        <tr>
639 4807 psotfx
                                <td class="row1"><?php echo $user->lang['FOUNDER']; ?>: <br /><span class="gensmall"><?php echo $user->lang['FOUNDER_EXPLAIN']; ?></span></td>
640 4807 psotfx
                                <td class="row2"><input type="radio" name="user_founder" value="1"<?php echo $user_founder_yes; ?> /><?php echo $user->lang['YES']; ?>&nbsp;<input type="radio" name="user_founder" value="0"<?php echo $user_founder_no; ?> /><?php echo $user->lang['NO']; ?></td>
641 4807 psotfx
                        </tr>
642 4807 psotfx
                        <tr>
643 4807 psotfx
                                <td class="row1"><?php echo $user->lang['EMAIL']; ?>: </td>
644 4642 psotfx
                                <td class="row2"><input class="post" type="text" name="user_email" value="<?php echo $user_email; ?>" maxlength="60" /></td>
645 3646 psotfx
                        </tr>
646 4642 psotfx
                        <tr>
647 4807 psotfx
                                <td class="row1"><?php echo $user->lang['CONFIRM_EMAIL']; ?>: <br /><span class="gensmall"><?php echo $user->lang['CONFIRM_EMAIL_EXPLAIN']; ?></span></td>
648 4807 psotfx
                                <td class="row2"><input class="post" type="text" name="email_confirm" value="<?php echo $email_confirm; ?>" maxlength="60" /></td>
649 4642 psotfx
                        </tr>
650 4642 psotfx
                        <tr>
651 4807 psotfx
                                <td class="row1"><?php echo $user->lang['NEW_PASSWORD']; ?>: <br /><span class="gensmall"><?php echo sprintf($user->lang['CHANGE_PASSWORD_EXPLAIN'], $config['min_pass_chars'], $config['max_pass_chars']) ?></span></td>
652 4642 psotfx
                                <td class="row2"><input class="post" type="password" name="user_password" value="<?php echo ($submit) ? $user_password : ''; ?>" maxlength="60" /></td>
653 4642 psotfx
                        </tr>
654 4642 psotfx
                        <tr>
655 4807 psotfx
                                <td class="row1"><?php echo $user->lang['CONFIRM_PASSWORD']; ?>: <br /><span class="gensmall"><?php echo $user->lang['CONFIRM_PASSWORD_EXPLAIN']; ?></span></td>
656 4807 psotfx
                                <td class="row2"><input class="post" type="password" name="password_confirm" value="<?php echo ($submit) ? $user_password_confirm : ''; ?>" maxlength="60" /></td>
657 4642 psotfx
                        </tr>
658 3646 psotfx
<?php
659 3646 psotfx
660 4642 psotfx
                        if ($user_type != USER_FOUNDER)
661 3646 psotfx
                        {
662 4642 psotfx
663 3646 psotfx
?>
664 3646 psotfx
                        <tr>
665 4807 psotfx
                                <th colspan="2"><?php echo $user->lang['USER_TOOLS']; ?></td>
666 3646 psotfx
                        </tr>
667 3646 psotfx
                        <tr>
668 4807 psotfx
                                <td class="row1"><?php echo $user->lang['WARNINGS']; ?>: <br /><span class="gensmall"><?php echo $user->lang['WARNINGS_EXPLAIN']; ?></span></td>
669 4807 psotfx
                                <td class="row2"><input class="post" type="text" name="warnings" size="2" maxlength="2" value="<?php echo $user->data['user_warnings']; ?>" /></td>
670 3646 psotfx
                        </tr>
671 3646 psotfx
                        <tr>
672 4807 psotfx
                                <td class="row1"><?php echo $user->lang['QUICK_TOOLS']; ?>: </td>
673 4807 psotfx
                                <td class="row2"><select name="quicktools"><?php echo $options; ?></select></td>
674 3646 psotfx
                        </tr>
675 3646 psotfx
                        <tr>
676 4807 psotfx
                                <td class="row1"><?php echo $user->lang['DELETE_USER']; ?>: <br /><span class="gensmall"><?php echo $user->lang['DELETE_USER_EXPLAIN']; ?></span></td>
677 4807 psotfx
                                <td class="row2"><select name="deletetype"><option value="retain"><?php echo $user->lang['RETAIN_POSTS']; ?></option><option value="remove"><?php echo $user->lang['DELETE_POSTS']; ?></option></select> <input type="checkbox" name="delete" value="1" /> </td>
678 4807 psotfx
                        </tr>
679 4807 psotfx
<?php
680 4642 psotfx
681 4807 psotfx
                        }
682 4642 psotfx
683 4841 psotfx
?>
684 4841 psotfx
                        <tr>
685 4841 psotfx
                                <td class="cat" colspan="2" align="center"><input class="btnmain" type="submit" name="update" value="<?php echo $user->lang['SUBMIT']; ?>" />&nbsp;&nbsp;<input class="btnlite" type="reset" value="<?php echo $user->lang['RESET']; ?>" /></td>
686 4841 psotfx
                        </tr>
687 4841 psotfx
<?php
688 4841 psotfx
689 4807 psotfx
                        break;
690 4642 psotfx
691 4642 psotfx
                case 'feedback':
692 3646 psotfx
693 4841 psotfx
                        if ($submit)
694 4841 psotfx
                        {
695 4841 psotfx
                                if (($deletemark || $deleteall) && $auth->acl_get('a_clearlogs'))
696 4841 psotfx
                                {
697 4841 psotfx
                                        $where_sql = '';
698 4841 psotfx
                                        if ($deletemark && $marked)
699 4841 psotfx
                                        {
700 4841 psotfx
                                                $sql_in = array();
701 4841 psotfx
                                                foreach ($marked as $mark)
702 4841 psotfx
                                                {
703 4841 psotfx
                                                        $sql_in[] =  $mark;
704 4841 psotfx
                                                }
705 4841 psotfx
                                                $where_sql = ' AND log_id IN (' . implode(', ', $sql_in) . ')';
706 4841 psotfx
                                                unset($sql_in);
707 4841 psotfx
                                        }
708 4642 psotfx
709 4841 psotfx
                                        $sql = 'DELETE FROM ' . LOG_TABLE . '
710 4841 psotfx
                                                WHERE log_type = ' . LOG_USERS . "
711 4841 psotfx
                                                        $where_sql";
712 4841 psotfx
                                        $db->sql_query($sql);
713 4841 psotfx
714 4841 psotfx
                                        add_log('admin', 'LOG_USERS_CLEAR');
715 4841 psotfx
                                        trigger_error("");
716 4841 psotfx
                                }
717 4841 psotfx
718 4841 psotfx
                                if ($message = request_var('message', ''))
719 4841 psotfx
                                {
720 4841 psotfx
                                        add_log('admin', 'LOG_USER_FEEDBACK', $username);
721 4841 psotfx
                                        add_log('user', $user_id, 'LOG_USER_GENERAL', $message);
722 4841 psotfx
723 4841 psotfx
                                        trigger_error($user->lang['USER_FEEDBACK_ADDED']);
724 4841 psotfx
                                }
725 4841 psotfx
                        }
726 4841 psotfx
727 4841 psotfx
                        $colspan = 2;
728 4841 psotfx
729 4827 psotfx
                        $limit_days = array(0 => $user->lang['ALL_ENTRIES'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 364 => $user->lang['1_YEAR']);
730 4841 psotfx
                        $sort_by_text = array('a' => $user->lang['SORT_USERNAME'], 'b' => $user->lang['SORT_DATE'], 'c' => $user->lang['SORT_IP'], 'd' => $user->lang['SORT_ACTION']);
731 4841 psotfx
                        $sort_by_sql = array('a' => 'l.user_id', 'b' => 'l.log_time', 'c' => 'l.log_ip', 'd' => 'l.log_operation');
732 3646 psotfx
733 4827 psotfx
                        $s_limit_days = $s_sort_key = $s_sort_dir = '';
734 4827 psotfx
                        gen_sort_selects($limit_days, $sort_by_text, $st, $sk, $sd, $s_limit_days, $s_sort_key, $s_sort_dir);
735 4642 psotfx
736 4827 psotfx
                        // Define where and sort sql for use in displaying logs
737 4827 psotfx
                        $sql_where = ($st) ? (time() - ($st * 86400)) : 0;
738 4827 psotfx
                        $sql_sort = $sort_by_sql[$sk] . ' ' . (($sd == 'd') ? 'DESC' : 'ASC');
739 4642 psotfx
740 4830 psotfx
?>
741 4830 psotfx
                        <tr>
742 4841 psotfx
                                <th colspan="2"><?php echo $user->lang['USER_ADMIN_FEEDBACK']; ?></th>
743 4841 psotfx
                        </tr>
744 4841 psotfx
                        <tr>
745 4830 psotfx
                                <td class="cat" colspan="2" align="center"><?php echo $user->lang['DISPLAY_LOG']; ?>: &nbsp;<?php echo $s_limit_days; ?>&nbsp;<?php echo $user->lang['SORT_BY']; ?>: <?php echo $s_sort_key; ?> <?php echo $s_sort_dir; ?>&nbsp;<input class="btnlite" type="submit" value="<?php echo $user->lang['GO']; ?>" name="sort" /></td>
746 4830 psotfx
                        </tr>
747 4830 psotfx
<?php
748 4830 psotfx
749 4827 psotfx
                        $log_data = array();
750 4827 psotfx
                        $log_count = 0;
751 4827 psotfx
                        view_log('user', $log_data, $log_count, $config['posts_per_page'], $start, 0, 0, $user_id, $sql_where, $sql_sort);
752 4642 psotfx
753 4827 psotfx
                        if ($log_count)
754 3646 psotfx
                        {
755 4827 psotfx
                                for($i = 0; $i < sizeof($log_data); $i++)
756 3646 psotfx
                                {
757 4642 psotfx
                                        $row_class = ($row_class == 'row1') ? 'row2' : 'row1';
758 4642 psotfx
759 4642 psotfx
?>
760 4642 psotfx
                                <tr>
761 4827 psotfx
                                        <td class="<?php echo $row_class; ?>"><span class="gensmall">Report by: <b><?php echo $log_data[$i]['username']; ?></b> on <?php echo $user->format_date($log_data[$i]['time']); ?></span><hr /><?php echo $log_data[$i]['action']; ?></td>
762 4827 psotfx
                                        <td class="<?php echo $row_class; ?>" width="5%" align="center"><input type="checkbox" name="mark[]" value="<?php echo $log_data[$i]['id']; ?>" /></td>
763 4642 psotfx
                                </tr>
764 4642 psotfx
<?php
765 4642 psotfx
766 3646 psotfx
                                }
767 3646 psotfx
                        }
768 4642 psotfx
                        else
769 4642 psotfx
                        {
770 3646 psotfx
771 3646 psotfx
?>
772 4642 psotfx
                                <tr>
773 4827 psotfx
                                        <td class="row1" colspan="2" align="center">No reports exist for this user</td>
774 4642 psotfx
                                </tr>
775 4642 psotfx
<?php
776 3646 psotfx
777 4642 psotfx
                        }
778 4827 psotfx
779 4827 psotfx
780 4827 psotfx
?>
781 4827 psotfx
                        <tr>
782 4830 psotfx
                                <td class="cat" colspan="2" align="right"><?php
783 4830 psotfx
784 4830 psotfx
                        if ($auth->acl_get('a_clearlogs'))
785 4830 psotfx
                        {
786 4830 psotfx
787 4830 psotfx
?><input class="btnlite" type="submit" name="delmarked" value="<?php echo $user->lang['DELETE_MARKED']; ?>" />&nbsp; <input class="btnlite" type="submit" name="delall" value="<?php echo $user->lang['DELETE_ALL']; ?>" /><?php
788 4830 psotfx
789 4830 psotfx
                        }
790 4830 psotfx
791 4830 psotfx
?>&nbsp;</td>
792 4827 psotfx
                        </tr>
793 4827 psotfx
                </table></td>
794 4827 psotfx
        </tr>
795 4827 psotfx
        <tr>
796 4830 psotfx
                <td class="nav"><div style="float:left;"><?php echo on_page($log_count, $config['topics_per_page'], $start); ?></div><div  style="float:right;"><b><a href="javascript:marklist('admin', true);"><?php echo $user->lang['MARK_ALL']; ?></a> :: <a href="javascript:marklist('admin', false);"><?php echo $user->lang['UNMARK_ALL']; ?></a></b>&nbsp;<br /><br /><?php
797 4830 psotfx
798 4830 psotfx
                        echo generate_pagination("admin_users.$phpEx$SID&amp;action=$action&amp;u=$user_id&amp;st=$st&amp;sk=$sk&amp;sd=$sd", $log_count, $config['posts_per_page'], $start);
799 4830 psotfx
800 4830 psotfx
?></div></td>
801 4827 psotfx
        </tr>
802 4827 psotfx
</table>
803 4827 psotfx
804 4830 psotfx
<script language="Javascript" type="text/javascript">
805 4830 psotfx
<!--
806 4830 psotfx
function marklist(match, status)
807 4830 psotfx
{
808 4830 psotfx
        len = eval('document.' + match + '.length');
809 4830 psotfx
        for (i = 0; i < len; i++)
810 4830 psotfx
        {
811 4830 psotfx
                eval('document.' + match + '.elements[i].checked = ' + status);
812 4830 psotfx
        }
813 4830 psotfx
}
814 4830 psotfx
//-->
815 4830 psotfx
</script>
816 4830 psotfx
817 4827 psotfx
<h1><?php echo $user->lang['ADD_FEEDBACK']; ?></h1>
818 4827 psotfx
819 4827 psotfx
<p><?php echo $user->lang['ADD_FEEDBACK_EXPLAIN']; ?></p>
820 4827 psotfx
821 4827 psotfx
<table width="100%" cellspacing="2" cellpadding="0" border="0" align="center">
822 4827 psotfx
        <tr>
823 4827 psotfx
                <td><table class="bg" width="100%" cellspacing="1" cellpadding="4" border="0">
824 4827 psotfx
                        <tr>
825 4827 psotfx
                                <th colspan="2"><?php echo $user->lang['USER_ADMIN_' . strtoupper($action)]; ?></th>
826 4827 psotfx
                        </tr>
827 4827 psotfx
                        <tr>
828 4827 psotfx
                                <td class="row1" colspan="2" align="center"><textarea name="message" rows="10" cols="76"></textarea></td>
829 4827 psotfx
                        </tr>
830 4841 psotfx
                        <tr>
831 4841 psotfx
                                <td class="cat" colspan="2" align="center"><input class="btnmain" type="submit" name="update" value="<?php echo $user->lang['SUBMIT']; ?>" />&nbsp;&nbsp;<input class="btnlite" type="reset" value="<?php echo $user->lang['RESET']; ?>" /></td>
832 4841 psotfx
                        </tr>
833 4827 psotfx
<?php
834 4827 psotfx
835 4827 psotfx
836 4642 psotfx
                        break;
837 3646 psotfx
838 3646 psotfx
839 4642 psotfx
                case 'profile':
840 3646 psotfx
841 4841 psotfx
                        if ($submit)
842 4841 psotfx
                        {
843 4841 psotfx
                                $var_ary = array(
844 4841 psotfx
                                        'icq'                        => (string) '',
845 4841 psotfx
                                        'aim'                        => (string) '',
846 4841 psotfx
                                        'msn'                        => (string) '',
847 4841 psotfx
                                        'yim'                        => (string) '',
848 4841 psotfx
                                        'jabber'                => (string) '',
849 4841 psotfx
                                        'website'                => (string) '',
850 4841 psotfx
                                        'location'                => (string) '',
851 4841 psotfx
                                        'occupation'        => (string) '',
852 4841 psotfx
                                        'interests'                => (string) '',
853 4841 psotfx
                                        'bday_day'                => 0,
854 4841 psotfx
                                        'bday_month'        => 0,
855 4841 psotfx
                                        'bday_year'                => 0,
856 4841 psotfx
                                );
857 4841 psotfx
858 4841 psotfx
                                foreach ($var_ary as $var => $default)
859 4841 psotfx
                                {
860 4841 psotfx
                                        $data[$var] = request_var($var, $default);
861 4841 psotfx
                                }
862 4841 psotfx
863 4841 psotfx
                                $var_ary = array(
864 4841 psotfx
                                        'icq'                        => array(
865 4841 psotfx
                                                array('string', true, 3, 15),
866 4841 psotfx
                                                array('match', true, '#^[0-9]+$#i')),
867 4841 psotfx
                                        'aim'                        => array('string', true, 5, 255),
868 4841 psotfx
                                        'msn'                        => array('string', true, 5, 255),
869 4841 psotfx
                                        'jabber'                => array(
870 4841 psotfx
                                                array('string', true, 5, 255),
871 4841 psotfx
                                                array('match', true, '#^[a-z0-9\.\-_\+]+?@(.*?\.)*?[a-z0-9\-_]+?\.[a-z]{2,4}(/.*)?$#i')),
872 4841 psotfx
                                        'yim'                        => array('string', true, 5, 255),
873 4841 psotfx
                                        'website'                => array(
874 4841 psotfx
                                                array('string', true, 12, 255),
875 4841 psotfx
                                                array('match', true, '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i')),
876 4841 psotfx
                                        'location'                => array('string', true, 2, 255),
877 4841 psotfx
                                        'occupation'        => array('string', true, 2, 500),
878 4841 psotfx
                                        'interests'                => array('string', true, 2, 500),
879 4841 psotfx
                                        'bday_day'                => array('num', true, 1, 31),
880 4841 psotfx
                                        'bday_month'        => array('num', true, 1, 12),
881 4841 psotfx
                                        'bday_year'                => array('num', true, 1901, gmdate('Y', time())),
882 4841 psotfx
                                );
883 4841 psotfx
884 4841 psotfx
                                $error = validate_data($data, $var_ary);
885 4841 psotfx
                                extract($data);
886 4841 psotfx
                                unset($data);
887 4841 psotfx
888 4841 psotfx
                                // validate custom profile fields
889 4841 psotfx
        //                        $cp->submit_cp_field('profile', $cp_data, $cp_error);
890 4841 psotfx
891 4841 psotfx
                                if (!sizeof($error) && !sizeof($cp_error))
892 4841 psotfx
                                {
893 4841 psotfx
                                        $sql_ary = array(
894 4841 psotfx
                                                'user_icq'                => $icq,
895 4841 psotfx
                                                'user_aim'                => $aim,
896 4841 psotfx
                                                'user_msnm'                => $msn,
897 4841 psotfx
                                                'user_yim'                => $yim,
898 4841 psotfx
                                                'user_jabber'        => $jabber,
899 4841 psotfx
                                                'user_website'        => $website,
900 4841 psotfx
                                                'user_from'                => $location,
901 4841 psotfx
                                                'user_occ'                => $occupation,
902 4841 psotfx
                                                'user_interests'=> $interests,
903 4841 psotfx
                                                'user_birthday'        => sprintf('%2d-%2d-%4d', $bday_day, $bday_month, $bday_year),
904 4841 psotfx
                                        );
905 4841 psotfx
906 4841 psotfx
                                        $sql = 'UPDATE ' . USERS_TABLE . '
907 4841 psotfx
                                                SET ' . $db->sql_build_array('UPDATE', $sql_ary) . "
908 4841 psotfx
                                                WHERE user_id = $user_id";
909 4841 psotfx
                                        $db->sql_query($sql);
910 4841 psotfx
911 4841 psotfx
        /*
912 4841 psotfx
                                        // Update Custom Fields
913 4841 psotfx
                                        if (sizeof($cp_data))
914 4841 psotfx
                                        {
915 4904 acydburn
                                                $sql = 'UPDATE ' . PROFILE_DATA_TABLE . '
916 4841 psotfx
                                                        SET ' . $db->sql_build_array('UPDATE', $cp_data) . "
917 4841 psotfx
                                                        WHERE user_id = $user_id";
918 4841 psotfx
                                                $db->sql_query($sql);
919 4841 psotfx
920 4841 psotfx
                                                if (!$db->sql_affectedrows())
921 4841 psotfx
                                                {
922 4841 psotfx
                                                        $cp_data['user_id'] = $user_id;
923 4841 psotfx
924 4841 psotfx
                                                        $db->return_on_error = true;
925 4841 psotfx
926 4904 acydburn
                                                        $sql = 'INSERT INTO ' . PROFILE_DATA_TABLE . ' ' . $db->sql_build_array('INSERT', $cp_data);
927 4841 psotfx
                                                        $db->sql_query();
928 4841 psotfx
929 4841 psotfx
                                                        $db->return_on_error = false;
930 4841 psotfx
                                                }
931 4841 psotfx
                                        }
932 4841 psotfx
        */
933 4841 psotfx
                                        trigger_error($user->lang['USER_PROFILE_UPDATED']);
934 4841 psotfx
                                }
935 4841 psotfx
                        }
936 4841 psotfx
937 4841 psotfx
                        $colspan = 2;
938 4841 psotfx
939 4812 psotfx
                        $cp = new custom_profile();
940 4812 psotfx
941 4812 psotfx
                        $cp_data = $cp_error = array();
942 4812 psotfx
943 4642 psotfx
                        if (!isset($bday_day))
944 3646 psotfx
                        {
945 4642 psotfx
                                list($bday_day, $bday_month, $bday_year) = explode('-', $user_birthday);
946 4642 psotfx
                        }
947 3646 psotfx
948 4642 psotfx
                        $s_birthday_day_options = '<option value="0"' . ((!$bday_day) ? ' selected="selected"' : '') . '>--</option>';
949 4642 psotfx
                        for ($i = 1; $i < 32; $i++)
950 4642 psotfx
                        {
951 4642 psotfx
                                $selected = ($i == $bday_day) ? ' selected="selected"' : '';
952 4642 psotfx
                                $s_birthday_day_options .= "<option value=\"$i\"$selected>$i</option>";
953 4642 psotfx
                        }
954 3646 psotfx
955 4642 psotfx
                        $s_birthday_month_options = '<option value="0"' . ((!$bday_month) ? ' selected="selected"' : '') . '>--</option>';
956 4642 psotfx
                        for ($i = 1; $i < 13; $i++)
957 4642 psotfx
                        {
958 4642 psotfx
                                $selected = ($i == $bday_month) ? ' selected="selected"' : '';
959 4642 psotfx
                                $s_birthday_month_options .= "<option value=\"$i\"$selected>$i</option>";
960 4642 psotfx
                        }
961 4642 psotfx
                        $s_birthday_year_options = '';
962 4642 psotfx
963 4642 psotfx
                        $now = getdate();
964 4642 psotfx
                        $s_birthday_year_options = '<option value="0"' . ((!$bday_year) ? ' selected="selected"' : '') . '>--</option>';
965 4642 psotfx
                        for ($i = $now['year'] - 100; $i < $now['year']; $i++)
966 4642 psotfx
                        {
967 4642 psotfx
                                $selected = ($i == $bday_year) ? ' selected="selected"' : '';
968 4642 psotfx
                                $s_birthday_year_options .= "<option value=\"$i\"$selected>$i</option>";
969 4642 psotfx
                        }
970 4642 psotfx
                        unset($now);
971 4642 psotfx
972 4812 psotfx
                        // Get additional profile fields and assign them to the template block var 'profile_fields'
973 4812 psotfx
//                        $user->get_profile_fields($user->data['user_id']);
974 4812 psotfx
//                        $cp->generate_profile_fields('profile', $user->get_iso_lang_id(), $cp_error);
975 4812 psotfx
976 4812 psotfx
977 3646 psotfx
?>
978 4841 psotfx
                        <tr>
979 4841 psotfx
                                <th colspan="2"><?php echo $user->lang['USER_ADMIN_SIG']; ?></th>
980 4841 psotfx
                        </tr>
981 4642 psotfx
                        <tr>
982 4642 psotfx
                                <td class="row1" width="40%"><b><?php echo $user->lang['UCP_ICQ']; ?>: </b></td>
983 4642 psotfx
                                <td class="row2"><input class="post" type="text" name="icq" size="30" maxlength="15" value="<?php echo $user_icq; ?>" /></td>
984 4642 psotfx
                        </tr>
985 4642 psotfx
                        <tr>
986 4642 psotfx
                                <td class="row1"><b><?php echo $user->lang['UCP_AIM']; ?>: </b></td>
987 4642 psotfx
                                <td class="row2"><input class="post" type="text" name="aim" size="30" maxlength="255" value="<?php echo $user_aim; ?>" /></td>
988 4642 psotfx
                        </tr>
989 4642 psotfx
                        <tr>
990 4642 psotfx
                                <td class="row1"><b><?php echo $user->lang['UCP_MSNM']; ?>: </b></td>
991 4642 psotfx
                                <td class="row2"><input class="post" type="text" name="msn" size="30" maxlength="255" value="<?php echo $user_msnm; ?>" /></td>
992 4642 psotfx
                        </tr>
993 4642 psotfx
                        <tr>
994 4642 psotfx
                                <td class="row1"><b><?php echo $user->lang['UCP_YIM']; ?>: </b></td>
995 4642 psotfx
                                <td class="row2"><input class="post" type="text" name="yim" size="30" maxlength="255" value="<?php echo $user_yim; ?>" /></td>
996 4642 psotfx
                        </tr>
997 4642 psotfx
                        <tr>
998 4642 psotfx
                                <td class="row1"><b><?php echo $user->lang['UCP_JABBER']; ?>: </b></td>
999 4642 psotfx
                                <td class="row2"><input class="post" type="text" name="jabber" size="30" maxlength="255" value="<?php echo $user_jabber; ?>" /></td>
1000 4642 psotfx
                        </tr>
1001 4642 psotfx
                        <tr>
1002 4642 psotfx
                                <td class="row1"><b><?php echo $user->lang['WEBSITE']; ?>: </b></td>
1003 4642 psotfx
                                <td class="row2"><input class="post" type="text" name="website" size="30" maxlength="255" value="<?php echo $user_website; ?>" /></td>
1004 4642 psotfx
                        </tr>
1005 4642 psotfx
                        <tr>
1006 4642 psotfx
                                <td class="row1"><b><?php echo $user->lang['LOCATION']; ?>: </b></td>
1007 4642 psotfx
                                <td class="row2"><input class="post" type="text" name="location" size="30" maxlength="100" value="<?php echo $user_location; ?>" /></td>
1008 4642 psotfx
                        </tr>
1009 4642 psotfx
                        <tr>
1010 4642 psotfx
                                <td class="row1"><b><?php echo $user->lang['OCCUPATION']; ?>: </b></td>
1011 4642 psotfx
                                <td class="row2"><textarea class="post" name="occ" rows="3" cols="30"><?php echo $user_occ; ?></textarea></td>
1012 4642 psotfx
                        </tr>
1013 4642 psotfx
                        <tr>
1014 4642 psotfx
                                <td class="row1"><b><?php echo $user->lang['INTERESTS']; ?>: </b></td>
1015 4642 psotfx
                                <td class="row2"><textarea class="post" name="interests" rows="3" cols="30"><?php echo $user_interests; ?></textarea></td>
1016 4642 psotfx
                        </tr>
1017 4642 psotfx
                        <tr>
1018 4642 psotfx
                                <td class="row1"><b><?php echo $user->lang['BIRTHDAY']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['BIRTHDAY_EXPLAIN']; ?></span></td>
1019 4642 psotfx
                                <td class="row2"><span class="genmed"><?php echo $user->lang['DAY']; ?>:</span> <select name="bday_day"><?php echo $s_birthday_day_options; ?></select> <span class="genmed"><?php echo $user->lang['MONTH']; ?>:</span> <select name="bday_month"><?php echo $s_birthday_month_options; ?></select> <span class="genmed"><?php echo $user->lang['YEAR']; ?>:</span> <select name="bday_year"><?php echo $s_birthday_year_options; ?></select></td>
1020 4642 psotfx
                        </tr>
1021 4841 psotfx
                        <tr>
1022 4841 psotfx
                                <td class="cat" colspan="2" align="center"><input class="btnmain" type="submit" name="update" value="<?php echo $user->lang['SUBMIT']; ?>" />&nbsp;&nbsp;<input class="btnlite" type="reset" value="<?php echo $user->lang['RESET']; ?>" /></td>
1023 4841 psotfx
                        </tr>
1024 3646 psotfx
<?php
1025 4642 psotfx
1026 4642 psotfx
                        break;
1027 4642 psotfx
1028 4642 psotfx
1029 4642 psotfx
                case 'prefs':
1030 4642 psotfx
1031 4841 psotfx
                        if ($submit)
1032 4841 psotfx
                        {
1033 4841 psotfx
                                $var_ary = array(
1034 4841 psotfx
                                        'user_dateformat'                => (string) $config['default_dateformat'],
1035 4841 psotfx
                                        'user_lang'                                => (string) $config['default_lang'],
1036 4841 psotfx
                                        'user_tz'                                => (float) $config['board_timezone'],
1037 4841 psotfx
                                        'user_style'                        => (int) $config['default_style'],
1038 4841 psotfx
                                        'user_dst'                                => (bool) $config['board_dst'],
1039 4841 psotfx
                                        'user_allow_viewemail'        => false,
1040 4841 psotfx
                                        'user_allow_massemail'        => true,
1041 4841 psotfx
                                        'user_allow_viewonline'        => true,
1042 4841 psotfx
                                        'user_notify_type'                => 0,
1043 4841 psotfx
                                        'user_notify_pm'                => true,
1044 4841 psotfx
                                        'user_allow_pm'                        => true,
1045 4841 psotfx
                                        'user_notify'                        => false,
1046 4841 psotfx
1047 4841 psotfx
                                        'sk'                => (string) 't',
1048 4841 psotfx
                                        'sd'                => (string) 'd',
1049 4841 psotfx
                                        'st'                => 0,
1050 4841 psotfx
1051 4841 psotfx
                                        'popuppm'                => false,
1052 4841 psotfx
                                        'viewimg'                => true,
1053 4841 psotfx
                                        'viewflash'                => false,
1054 4841 psotfx
                                        'viewsmilies'        => true,
1055 4841 psotfx
                                        'viewsigs'                => true,
1056 4841 psotfx
                                        'viewavatars'        => true,
1057 4841 psotfx
                                        'viewcensors'        => false,
1058 4841 psotfx
                                        'bbcode'                => true,
1059 4841 psotfx
                                        'html'                        => false,
1060 5108 acydburn
                                        'smilies'                => true,
1061 4841 psotfx
                                        'attachsig'                => true,
1062 4841 psotfx
                                );
1063 4841 psotfx
1064 4841 psotfx
                                foreach ($var_ary as $var => $default)
1065 4841 psotfx
                                {
1066 4841 psotfx
                                        $data[$var] = request_var($var, $default);
1067 4841 psotfx
                                }
1068 4841 psotfx
1069 4841 psotfx
                                $var_ary = array(
1070 4841 psotfx
                                        'user_dateformat'        => array('string', false, 3, 15),
1071 4841 psotfx
                                        'user_lang'                        => array('match', false, '#^[a-z_]{2,}$#i'),
1072 4841 psotfx
                                        'user_tz'                        => array('num', false, -13, 13),
1073 4841 psotfx
1074 4841 psotfx
                                        'sk'        => array('string', false, 1, 1),
1075 4841 psotfx
                                        'sd'        => array('string', false, 1, 1),
1076 4841 psotfx
                                );
1077 4841 psotfx
1078 4841 psotfx
                                $error = validate_data($data, $var_ary);
1079 4841 psotfx
                                extract($data);
1080 4841 psotfx
                                unset($data);
1081 4841 psotfx
1082 4841 psotfx
                                // Set the popuppm option
1083 5108 acydburn
                                $option_ary = array('popuppm', 'viewimg', 'viewflash', 'viewsmilies', 'viewsigs', 'viewavatars', 'viewcensors', 'bbcode', 'html', 'smilies', 'attachsig');
1084 4841 psotfx
1085 4841 psotfx
                                foreach ($option_ary as $option)
1086 4841 psotfx
                                {
1087 4841 psotfx
                                        $user_options = $user->optionset($option, $$option, $user_options);
1088 4841 psotfx
                                }
1089 4841 psotfx
1090 4841 psotfx
                                if (!sizeof($error))
1091 4841 psotfx
                                {
1092 4841 psotfx
                                        $sql_ary = array(
1093 4841 psotfx
                                                'user_allow_pm'                        => $user_allow_pm,
1094 4841 psotfx
                                                'user_allow_viewemail'        => $user_allow_viewemail,
1095 4841 psotfx
                                                'user_allow_massemail'        => $user_allow_massemail,
1096 4841 psotfx
                                                'user_allow_viewonline'        => $user_allow_viewonline,
1097 4841 psotfx
                                                'user_notify_type'                => $user_notify_type,
1098 4841 psotfx
                                                'user_notify_pm'                => $user_notify_pm,
1099 4841 psotfx
                                                'user_options'                        => $user_options,
1100 4841 psotfx
                                                'user_notify'                        => $user_notify,
1101 4841 psotfx
                                                'user_dst'                                => $user_dst,
1102 4841 psotfx
                                                'user_dateformat'                => $user_dateformat,
1103 4841 psotfx
                                                'user_lang'                                => $user_lang,
1104 4841 psotfx
                                                'user_timezone'                        => $user_tz,
1105 4841 psotfx
                                                'user_style'                        => $user_style,
1106 4841 psotfx
                                                'user_sortby_type'                => $sk,
1107 4841 psotfx
                                                'user_sortby_dir'                => $sd,
1108 4841 psotfx
                                                'user_show_days'                => $st,
1109 4841 psotfx
                                        );
1110 4841 psotfx
1111 4841 psotfx
                                        $sql = 'UPDATE ' . USERS_TABLE . '
1112 4841 psotfx
                                                SET ' . $db->sql_build_array('UPDATE', $sql_ary) . "
1113 4841 psotfx
                                                WHERE user_id = $user_id";
1114 4841 psotfx
                                        $db->sql_query($sql);
1115 4841 psotfx
1116 4841 psotfx
                                        trigger_error($user->lang['USER_PREFS_UPDATED']);
1117 4841 psotfx
                                }
1118 4841 psotfx
1119 4841 psotfx
                                $user_sortby_type = $sk;
1120 4841 psotfx
                                $user_sortby_dir = $sd;
1121 4841 psotfx
                                $user_show_days = $st;
1122 4841 psotfx
                        }
1123 4841 psotfx
1124 4841 psotfx
                        $colspan = 2;
1125 4841 psotfx
1126 4978 acydburn
                        $option_ary = array('user_allow_viewemail', 'user_allow_massemail', 'user_allow_pm', 'user_allow_viewonline', 'user_notify_pm', 'user_dst', 'user_notify');
1127 4823 psotfx
1128 4823 psotfx
                        foreach ($option_ary as $option)
1129 4823 psotfx
                        {
1130 4823 psotfx
                                ${$option . '_yes'} = ($$option) ? ' checked="checked"' : '';
1131 4823 psotfx
                                ${$option . '_no'} = (!$$option) ? ' checked="checked"' : '';
1132 4823 psotfx
                        }
1133 4823 psotfx
                        unset($option_ary);
1134 4823 psotfx
1135 5108 acydburn
                        $option_ary = array('popuppm', 'viewimg', 'viewflash', 'viewsmilies', 'viewsigs', 'viewavatars', 'viewcensors', 'bbcode', 'html', 'smilies', 'attachsig');
1136 4823 psotfx
1137 4823 psotfx
                        foreach ($option_ary as $option)
1138 4823 psotfx
                        {
1139 4823 psotfx
                                ${$option . '_yes'} = ($user->optionget($option, $user_options)) ? ' checked="checked"' : '';
1140 4823 psotfx
                                ${$option . '_no'} = (!$user->optionget($option, $user_options)) ? ' checked="checked"' : '';
1141 4823 psotfx
                        }
1142 4823 psotfx
1143 4823 psotfx
                        $notify_email        = ($user_notify_type == NOTIFY_EMAIL) ? ' checked="checked"' : '';
1144 4823 psotfx
                        $notify_im                = ($user_notify_type == NOTIFY_IM) ? ' checked="checked"' : '';
1145 4823 psotfx
                        $notify_both        = ($user_notify_type == NOTIFY_BOTH) ? ' checked="checked"' : '';
1146 4823 psotfx
1147 4823 psotfx
                        // Topic ordering display
1148 4823 psotfx
                        $limit_days = array(0 => $user->lang['ALL_TOPICS'], 0 => $user->lang['ALL_TOPICS'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 364 => $user->lang['1_YEAR']);
1149 4823 psotfx
1150 4823 psotfx
                        $sort_by_text = array('a' => $user->lang['AUTHOR'], 't' => $user->lang['POST_TIME'], 'r' => $user->lang['REPLIES'], 's' => $user->lang['SUBJECT'], 'v' => $user->lang['VIEWS']);
1151 4823 psotfx
                        $sort_by_sql = array('a' => 't.topic_first_poster_name', 't' => 't.topic_last_post_time', 'r' => 't.topic_replies', 's' => 't.topic_title', 'v' => 't.topic_views');
1152 4823 psotfx
1153 4823 psotfx
                        $s_limit_days = $s_sort_key = $s_sort_dir = '';
1154 4823 psotfx
                        gen_sort_selects($limit_days, $sort_by_text, $user_show_days, $user_sortby_type, $user_sortby_dir, $s_limit_days, $s_sort_key, $s_sort_dir);
1155 4823 psotfx
1156 4642 psotfx
?>
1157 4841 psotfx
                        <tr>
1158 4841 psotfx
                                <th colspan="2"><?php echo $user->lang['USER_ADMIN_PREFS']; ?></th>
1159 4841 psotfx
                        </tr>
1160 4642 psotfx
                        <tr>
1161 4823 psotfx
                                <td class="row1" width="40%"><b><?php echo $user->lang['VIEW_IMAGES']; ?>:</b></td>
1162 4823 psotfx
                                <td class="row2"><input type="radio" name="viewimg" value="1"<?php echo $viewimg_yes; ?> /><span class="gen"><?php echo $user->lang['YES']; ?></span>&nbsp;&nbsp;<input type="radio" name="viewimg" value="0"<?php echo $viewimg_no; ?> /><span class="gen"><?php echo $user->lang['NO']; ?></span></td>
1163 4642 psotfx
                        </tr>
1164 4642 psotfx
                        <tr>
1165 4823 psotfx
                                <td class="row1"><b><?php echo $user->lang['VIEW_FLASH']; ?>:</b></td>
1166 4823 psotfx
                                <td class="row2"><input type="radio" name="viewflash" value="1"<?php echo $viewflash_yes; ?> /><span class="gen"><?php echo $user->lang['YES']; ?></span>&nbsp;&nbsp;<input type="radio" name="viewflash" value="0"<?php echo $viewflash_no; ?> /><span class="gen"><?php echo $user->lang['NO']; ?></span></td>
1167 4642 psotfx
                        </tr>
1168 4642 psotfx
                        <tr>
1169 4823 psotfx
                                <td class="row1"><b><?php echo $user->lang['VIEW_SMILIES']; ?>:</b></td>
1170 4823 psotfx
                                <td class="row2"><input type="radio" name="viewsmilies" value="1"<?php echo $viewsmilies_yes; ?> /><span class="gen"><?php echo $user->lang['YES']; ?></span>&nbsp;&nbsp;<input type="radio" name="viewsmilies" value="0"<?php echo $viewsmilies_no; ?> /><span class="gen"><?php echo $user->lang['NO']; ?></span></td>
1171 4642 psotfx
                        </tr>
1172 4642 psotfx
                        <tr>
1173 4823 psotfx
                                <td class="row1"><b><?php echo $user->lang['VIEW_SIGS']; ?>:</b></td>
1174 4823 psotfx
                                <td class="row2"><input type="radio" name="viewsigs" value="1"<?php echo $viewsigs_yes; ?> /><span class="gen"><?php echo $user->lang['YES']; ?></span>&nbsp;&nbsp;<input type="radio" name="viewsigs" value="0"<?php echo $viewsigs_no; ?> /><span class="gen"><?php echo $user->lang['NO']; ?></span></td>
1175 4642 psotfx
                        </tr>
1176 4642 psotfx
                        <tr>
1177 4823 psotfx
                                <td class="row1"><b><?php echo $user->lang['VIEW_AVATARS']; ?>:</b></td>
1178 4823 psotfx
                                <td class="row2"><input type="radio" name="viewavatars" value="1"<?php echo $viewavatars_yes; ?> /><span class="gen"><?php echo $user->lang['YES']; ?></span>&nbsp;&nbsp;<input type="radio" name="viewavatars" value="0"<?php echo $viewavatars_no; ?> /><span class="gen"><?php echo $user->lang['NO']; ?></span></td>
1179 4642 psotfx
                        </tr>
1180 4642 psotfx
                        <tr>
1181 4823 psotfx
                                <td class="row1"><b><?php echo $user->lang['DISABLE_CENSORS']; ?>:</b></td>
1182 4823 psotfx
                                <td class="row2"><input type="radio" name="viewcensors" value="1"<?php echo $viewcensors_yes; ?> /><span class="gen"><?php echo $user->lang['YES']; ?></span>&nbsp;&nbsp;<input type="radio" name="viewcensors" value="0"<?php echo $viewcensors_no; ?> /><span class="gen"><?php echo $user->lang['NO']; ?></span></td>
1183 4642 psotfx
                        </tr>
1184 4823 psotfx
                        <!-- tr>
1185 4823 psotfx
                                <td class="row1"><b><?php echo $user->lang['MINIMUM_KARMA']; ?>:</b><br /><span class="gensmall"><?php echo $user->lang['MINIMUM_KARMA_EXPLAIN']; ?></span></td>
1186 4823 psotfx
                                <td class="row2"><select name="user_min_karma">{S_MIN_KARMA_OPTIONS}</select></td>
1187 4823 psotfx
                        </tr-->
1188 4642 psotfx
                        <tr>
1189 4823 psotfx
                                <td class="row1"><b><?php echo $user->lang['VIEW_TOPICS_DAYS']; ?>:</b></td>
1190 4823 psotfx
                                <td class="row2"><?php echo $s_limit_days; ?></td>
1191 4642 psotfx
                        </tr>
1192 4642 psotfx
                        <tr>
1193 4823 psotfx
                                <td class="row1"><b><?php echo $user->lang['VIEW_TOPICS_KEY']; ?>:</b></td>
1194 4823 psotfx
                                <td class="row2"><?php echo $s_sort_key; ?></td>
1195 4642 psotfx
                        </tr>
1196 4642 psotfx
                        <tr>
1197 4823 psotfx
                                <td class="row1"><b><?php echo $user->lang['VIEW_TOPICS_DIR']; ?>:</b></td>
1198 4823 psotfx
                                <td class="row2"><?php echo $s_sort_dir; ?></td>
1199 4642 psotfx
                        </tr>
1200 4642 psotfx
                        <tr>
1201 4823 psotfx
                                <th colspan="2"><?php echo $user->lang['USER_POSTING_PREFS']; ?></th>
1202 4642 psotfx
                        </tr>
1203 4642 psotfx
                        <tr>
1204 4823 psotfx
                                <td class="row1"><b><?php echo $user->lang['DEFAULT_BBCODE']; ?>:</b></td>
1205 4823 psotfx
                                <td class="row2"><input type="radio" name="bbcode" value="1"<?php echo $bbcode_yes; ?> /><span class="gen"><?php echo $user->lang['YES']; ?></span>&nbsp;&nbsp;<input type="radio" name="bbcode" value="0"<?php echo $bbcode_no; ?> /><span class="gen"><?php echo $user->lang['NO']; ?></span></td>
1206 4642 psotfx
                        </tr>
1207 4642 psotfx
                        <tr>
1208 4823 psotfx
                                <td class="row1"><b><?php echo $user->lang['DEFAULT_HTML']; ?>:</b></td>
1209 4823 psotfx
                                <td class="row2"><input type="radio" name="html" value="1"<?php echo $html_yes; ?> /><span class="gen"><?php echo $user->lang['YES']; ?></span>&nbsp;&nbsp;<input type="radio" name="html" value="0"<?php echo $html_no; ?> /><span class="gen"><?php echo $user->lang['NO']; ?></span></td>
1210 4642 psotfx
                        </tr>
1211 4642 psotfx
                        <tr>
1212 5108 acydburn
                                <td class="row1"><b><?php echo $user->lang['DEFAULT_SMILIES']; ?>:</b></td>
1213 5108 acydburn
                                <td class="row2"><input type="radio" name="smilies" value="1"<?php echo $smilies_yes; ?> /><span class="gen"><?php echo $user->lang['YES']; ?></span>&nbsp;&nbsp;<input type="radio" name="smilies" value="0"<?php echo $smilies_no; ?> /><span class="gen"><?php echo $user->lang['NO']; ?></span></td>
1214 4642 psotfx
                        </tr>
1215 4642 psotfx
                        <tr>
1216 4823 psotfx
                                <td class="row1"><b><?php echo $user->lang['DEFAULT_ADD_SIG']; ?>:</b></td>
1217 4823 psotfx
                                <td class="row2"><input type="radio" name="attachsig" value="1"<?php echo $attachsig_yes; ?> /><span class="gen"><?php echo $user->lang['YES']; ?></span>&nbsp;&nbsp;<input type="radio" name="attachsig" value="0"<?php echo $attachsig_no; ?> /><span class="gen"><?php echo $user->lang['NO']; ?></span></td>
1218 4642 psotfx
                        </tr>
1219 4642 psotfx
                        <tr>
1220 4823 psotfx
                                <td class="row1"><b><?php echo $user->lang['DEFAULT_NOTIFY']; ?>:</b></td>
1221 4823 psotfx
                                <td class="row2"><input type="radio" name="user_notify" value="1"<?php echo $user_notify_yes; ?> /><span class="gen"><?php echo $user->lang['YES']; ?></span>&nbsp;&nbsp;<input type="radio" name="user_notify" value="0"<?php echo $user_notify_no; ?> /><span class="gen"><?php echo $user->lang['NO']; ?></span></td>
1222 4642 psotfx
                        </tr>
1223 4642 psotfx
                        <tr>
1224 4642 psotfx
                                <th colspan="2"></th>
1225 4642 psotfx
                        </tr>
1226 4642 psotfx
                        <tr>
1227 4823 psotfx
                                <td class="row1"><b><?php echo $user->lang['SHOW_EMAIL']; ?>:</b></td>
1228 4823 psotfx
                                <td class="row2"><input type="radio" name="user_allow_viewemail" value="1"<?php echo $user_allow_viewemail_yes; ?> /><span class="genmed"><?php echo $user->lang['YES']; ?></span>&nbsp;&nbsp;<input type="radio" name="user_allow_viewemail" value="0"<?php echo $user_allow_viewemail_no; ?> /><span class="genmed"><?php echo $user->lang['NO']; ?></span></td>
1229 4642 psotfx
                        </tr>
1230 4642 psotfx
                        <tr>
1231 4823 psotfx
                                <td class="row1"><b><?php echo $user->lang['ADMIN_EMAIL']; ?>:</b></td>
1232 4823 psotfx
                                <td class="row2"><input type="radio" name="user_allow_massemail" value="1"<?php echo $user_allow_massemail_yes; ?> /><span class="genmed"><?php echo $user->lang['YES']; ?></span>&nbsp;&nbsp;<input type="radio" name="user_allow_massemail" value="0"<?php echo $user_allow_massemail_no; ?> /><span class="genmed"><?php echo $user->lang['NO']; ?></span></td>
1233 4642 psotfx
                        </tr>
1234 4642 psotfx
                        <tr>
1235 4823 psotfx
                                <td class="row1"><b><?php echo $user->lang['ALLOW_PM']; ?>:</b><br /><span class="gensmall"><?php echo $user->lang['ALLOW_PM_EXPLAIN']; ?></span></td>
1236 4823 psotfx
                                <td class="row2"><input type="radio" name="user_allow_pm" value="1"<?php echo $user_allow_pm_yes; ?> /><span class="genmed"><?php echo $user->lang['YES']; ?></span>&nbsp;&nbsp;<input type="radio" name="user_allow_pm" value="0"<?php echo $user_allow_pm_no; ?> /><span class="genmed"><?php echo $user->lang['NO']; ?></span></td>
1237 4642 psotfx
                        </tr>
1238 4642 psotfx
                        <tr>
1239 4823 psotfx
                                <td class="row1"><b><?php echo $user->lang['HIDE_ONLINE']; ?>:</b></td>
1240 4823 psotfx
                                <td class="row2"><input type="radio" name="user_allow_viewonline" value="0"<?php echo $user_allow_viewonline_no; ?> /><span class="genmed"><?php echo $user->lang['YES']; ?></span>&nbsp;&nbsp;<input type="radio" name="user_allow_viewonline" value="1"<?php echo $user_allow_viewonline_yes; ?> /><span class="genmed"><?php echo $user->lang['NO']; ?></span></td>
1241 4642 psotfx
                        </tr>
1242 4642 psotfx
                        <tr>
1243 4823 psotfx
                                <td class="row1"><b><?php echo $user->lang['NOTIFY_METHOD']; ?>:</b><br /><span class="gensmall"><?php echo $user->lang['NOTIFY_METHOD_EXPLAIN']; ?></span></td>
1244 4823 psotfx
                                <td class="row2"><input type="radio" name="user_notify_type" value="0"<?php echo $notify_email; ?> /><span class="genmed"><?php echo $user->lang['NOTIFY_METHOD_EMAIL']; ?></span>&nbsp;&nbsp;<input type="radio" name="user_notify_type" value="1"<?php echo $notify_im; ?> /><span class="genmed"><?php echo $user->lang['NOTIFY_METHOD_IM']; ?></span>&nbsp;&nbsp;<input type="radio" name="user_notify_type" value="2"<?php echo $notify_both; ?> /><span class="genmed"><?php echo $user->lang['NOTIFY_METHOD_BOTH']; ?></span></td>
1245 4642 psotfx
                        </tr>
1246 4642 psotfx
                        <tr>
1247 4823 psotfx
                                <td class="row1"><b><?php echo $user->lang['NOTIFY_ON_PM']; ?>:</b></td>
1248 4823 psotfx
                                <td class="row2"><input type="radio" name="user_notify_pm" value="1"<?php echo $user_notify_pm_yes; ?> /><span class="genmed"><?php echo $user->lang['YES']; ?></span>&nbsp;&nbsp;<input type="radio" name="user_notify_pm" value="0"<?php echo $user_notify_pm_no; ?> /><span class="genmed"><?php echo $user->lang['NO']; ?></span></td>
1249 4642 psotfx
                        </tr>
1250 4642 psotfx
                        <tr>
1251 4823 psotfx
                                <td class="row1"><b><?php echo $user->lang['POPUP_ON_PM']; ?>:</b></td>
1252 4823 psotfx
                                <td class="row2"><input type="radio" name="popuppm" value="1"<?php echo $popuppm_yes; ?> /><span class="genmed"><?php echo $user->lang['YES']; ?></span>&nbsp;&nbsp;<input type="radio" name="popuppm" value="0"<?php echo $popuppm_no; ?> /><span class="genmed"><?php echo $user->lang['NO']; ?></span></td>
1253 4642 psotfx
                        </tr>
1254 4642 psotfx
                        <tr>
1255 4823 psotfx
                                <td class="row1"><b><?php echo $user->lang['BOARD_LANGUAGE']; ?>:</b></td>
1256 4823 psotfx
                                <td class="row2"><select name="user_lang"><?php echo language_select($user_lang); ?></select></td>
1257 4642 psotfx
                        </tr>
1258 4642 psotfx
                        <tr>
1259 4823 psotfx
                                <td class="row1"><b><?php echo $user->lang['BOARD_STYLE']; ?>:</b></td>
1260 4823 psotfx
                                <td class="row2"><select name="user_style"><?php echo style_select($user_style); ?></select></td>
1261 4642 psotfx
                        </tr>
1262 4642 psotfx
                        <tr>
1263 4823 psotfx
                                <td class="row1"><b><?php echo $user->lang['BOARD_TIMEZONE']; ?>:</b></td>
1264 4823 psotfx
                                <td class="row2"><select name="user_tz"><?php echo tz_select($user_timezone); ?></select></td>
1265 4642 psotfx
                        </tr>
1266 4642 psotfx
                        <tr>
1267 4823 psotfx
                                <td class="row1"><b><?php echo $user->lang['BOARD_DST']; ?>:</b></td>
1268 4823 psotfx
                                <td class="row2"><input type="radio" name="user_dst" value="1"<?php echo $user_dst_yes; ?> /><span class="genmed"><?php echo $user->lang['YES']; ?></span>&nbsp;&nbsp;<input type="radio" name="user_dst" value="0"<?php echo $user_dst_no; ?> /><span class="genmed"><?php echo $user->lang['NO']; ?></span></td>
1269 4642 psotfx
                        </tr>
1270 4642 psotfx
                        <tr>
1271 4823 psotfx
                                <td class="row1"><b><?php echo $user->lang['BOARD_DATE_FORMAT']; ?>:</b><br /><span class="gensmall"><?php echo $user->lang['BOARD_DATE_FORMAT_EXPLAIN']; ?></span></td>
1272 4823 psotfx
                                <td class="row2"><input type="text" name="user_dateformat" value="<?php echo $user_dateformat; ?>" maxlength="14" class="post" /></td>
1273 4642 psotfx
                        </tr>
1274 4841 psotfx
                        <tr>
1275 4841 psotfx
                                <td class="cat" colspan="2" align="center"><input class="btnmain" type="submit" name="update" value="<?php echo $user->lang['SUBMIT']; ?>" />&nbsp;&nbsp;<input class="btnlite" type="reset" value="<?php echo $user->lang['RESET']; ?>" /></td>
1276 4841 psotfx
                        </tr>
1277 4642 psotfx
<?php
1278 4642 psotfx
1279 4642 psotfx
                        break;
1280 4642 psotfx
1281 4642 psotfx
                case 'avatar':
1282 4642 psotfx
1283 4841 psotfx
                        $can_upload = (file_exists($phpbb_root_path . $config['avatar_path']) && is_writeable($phpbb_root_path . $config['avatar_path']) && $file_uploads) ? true : false;
1284 4841 psotfx
1285 4841 psotfx
                        if ($submit)
1286 4841 psotfx
                        {
1287 4841 psotfx
                                $var_ary = array(
1288 4841 psotfx
                                        'uploadurl'                => (string) '',
1289 4841 psotfx
                                        'remotelink'        => (string) '',
1290 4841 psotfx
                                        'width'                        => (string) '',
1291 4841 psotfx
                                        'height'                => (string) '',
1292 4841 psotfx
                                );
1293 4841 psotfx
1294 4841 psotfx
                                foreach ($var_ary as $var => $default)
1295 4841 psotfx
                                {
1296 4841 psotfx
                                        $data[$var] = request_var($var, $default);
1297 4841 psotfx
                                }
1298 4841 psotfx
1299 4841 psotfx
                                $var_ary = array(
1300 4841 psotfx
                                        'uploadurl'                => array('string', true, 5, 255),
1301 4841 psotfx
                                        'remotelink'        => array('string', true, 5, 255),
1302 4841 psotfx
                                        'width'                        => array('string', true, 1, 3),
1303 4841 psotfx
                                        'height'                => array('string', true, 1, 3),
1304 4841 psotfx
                                );
1305 4841 psotfx
1306 4841 psotfx
                                $error = validate_data($data, $var_ary);
1307 4841 psotfx
1308 4841 psotfx
                                if (!sizeof($error))
1309 4841 psotfx
                                {
1310 4841 psotfx
                                        $data['user_id'] = $user_id;
1311 4841 psotfx
1312 4841 psotfx
                                        if ((!empty($_FILES['uploadfile']['tmp_name']) || $data['uploadurl']) && $can_upload)
1313 4841 psotfx
                                        {
1314 4841 psotfx
                                                list($type, $filename, $width, $height) = avatar_upload($data, $error);
1315 4841 psotfx
                                        }
1316 4841 psotfx
                                        else if ($data['remotelink'])
1317 4841 psotfx
                                        {
1318 4841 psotfx
                                                list($type, $filename, $width, $height) = avatar_remote($data, $error);
1319 4841 psotfx
                                        }
1320 4841 psotfx
                                        else if ($delete)
1321 4841 psotfx
                                        {
1322 4841 psotfx
                                                $type = $filename = $width = $height = '';
1323 4841 psotfx
                                        }
1324 4841 psotfx
                                }
1325 4841 psotfx
1326 4841 psotfx
                                if (!sizeof($error))
1327 4841 psotfx
                                {
1328 4841 psotfx
                                        // Do we actually have any data to update?
1329 4841 psotfx
                                        if (sizeof($data))
1330 4841 psotfx
                                        {
1331 4841 psotfx
                                                $sql_ary = array(
1332 4841 psotfx
                                                        'user_avatar'                        => $filename,
1333 4841 psotfx
                                                        'user_avatar_type'                => $type,
1334 4841 psotfx
                                                        'user_avatar_width'                => $width,
1335 4841 psotfx
                                                        'user_avatar_height'        => $height,
1336 4841 psotfx
                                                );
1337 4841 psotfx
1338 4841 psotfx
                                                $sql = 'UPDATE ' . USERS_TABLE . '
1339 4841 psotfx
                                                        SET ' . $db->sql_build_array('UPDATE', $sql_ary) . "
1340 4841 psotfx
                                                        WHERE user_id = $user_id";
1341 4841 psotfx
                                                $db->sql_query($sql);
1342 4841 psotfx
1343 4841 psotfx
                                                // Delete old avatar if present
1344 4841 psotfx
                                                if ($user_avatar && $filename != $user_avatar)
1345 4841 psotfx
                                                {
1346 4841 psotfx
                                                        avatar_delete($user_avatar);
1347 4841 psotfx
                                                }
1348 4841 psotfx
                                        }
1349 4841 psotfx
1350 4841 psotfx
                                        trigger_error($message);
1351 4841 psotfx
                                }
1352 4841 psotfx
1353 4841 psotfx
                                extract($data);
1354 4841 psotfx
                                unset($data);
1355 4841 psotfx
                        }
1356 4841 psotfx
1357 4841 psotfx
                        $colspan = 2;
1358 4841 psotfx
1359 4827 psotfx
                        $display_gallery = (isset($_POST['displaygallery'])) ? true : false;
1360 4827 psotfx
                        $avatar_category = request_var('category', '');
1361 4827 psotfx
1362 4827 psotfx
                        // Generate users avatar
1363 4827 psotfx
                        $avatar_img = '';
1364 4642 psotfx
                        if ($user_avatar)
1365 4642 psotfx
                        {
1366 4642 psotfx
                                switch ($user_avatar_type)
1367 4642 psotfx
                                {
1368 4642 psotfx
                                        case AVATAR_UPLOAD:
1369 4642 psotfx
                                                $avatar_img = $phpbb_root_path . $config['avatar_path'] . '/';
1370 4642 psotfx
                                                break;
1371 4642 psotfx
                                        case AVATAR_GALLERY:
1372 4642 psotfx
                                                $avatar_img = $phpbb_root_path . $config['avatar_gallery_path'] . '/';
1373 4642 psotfx
                                                break;
1374 3646 psotfx
                                }
1375 4642 psotfx
                                $avatar_img .= $user_avatar;
1376 4642 psotfx
1377 4642 psotfx
                                $avatar_img = '<img src="' . $avatar_img . '" width="' . $user_avatar_width . '" height="' . $user_avatar_height . '" border="0" alt="" />';
1378 3646 psotfx
                        }
1379 4642 psotfx
                        else
1380 4642 psotfx
                        {
1381 4642 psotfx
                                $avatar_img = '<img src="images/no_avatar.gif" alt="" />';
1382 4642 psotfx
                        }
1383 3646 psotfx
1384 3646 psotfx
?>
1385 4841 psotfx
                        <tr>
1386 4841 psotfx
                                <th colspan="<?php echo $colspan; ?>"><?php echo $user->lang['USER_ADMIN_AVATAR']; ?></th>
1387 4841 psotfx
                        </tr>
1388 4642 psotfx
                        <tr>
1389 4642 psotfx
                                <td class="row2" width="35%"><b><?php echo $user->lang['CURRENT_IMAGE']; ?>: </b><br /><span class="gensmall"><?php echo sprintf($user->lang['AVATAR_EXPLAIN'], $config['avatar_max_width'], $config['avatar_max_height'], round($config['avatar_filesize'] / 1024)); ?></span></td>
1390 4642 psotfx
                                <td class="row1" align="center"><br /><?php echo $avatar_img; ?><br /><br /><input type="checkbox" name="delete" />&nbsp;<span class="gensmall"><?php echo $user->lang['DELETE_AVATAR']; ?></span></td>
1391 3646 psotfx
                        </tr>
1392 3646 psotfx
<?php
1393 3646 psotfx
1394 4642 psotfx
                        // Can we upload?
1395 4642 psotfx
                        if ($can_upload)
1396 3646 psotfx
                        {
1397 3646 psotfx
1398 3646 psotfx
?>
1399 4642 psotfx
        <tr>
1400 4642 psotfx
                <td class="row2" width="35%"><b><?php echo $user->lang['UPLOAD_AVATAR_FILE']; ?>: </b></td>
1401 4642 psotfx
                <td class="row1"><input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $config['avatar_max_filesize']; ?>" /><input class="post" type="file" name="uploadfile" /></td>
1402 4642 psotfx
        </tr>
1403 4642 psotfx
        <tr>
1404 4642 psotfx
                <td class="row2" width="35%"><b><?php echo $user->lang['UPLOAD_AVATAR_URL']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['UPLOAD_AVATAR_URL_EXPLAIN']; ?></span></td>
1405 4642 psotfx
                <td class="row1"><input class="post" type="text" name="uploadurl" size="40" value="<?php echo $avatar_url; ?>" /></td>
1406 4642 psotfx
        </tr>
1407 3646 psotfx
<?php
1408 3646 psotfx
1409 4642 psotfx
                        }
1410 3646 psotfx
1411 3646 psotfx
?>
1412 4642 psotfx
        <tr>
1413 4642 psotfx
                <td class="row2" width="35%"><b><?php echo $user->lang['LINK_REMOTE_AVATAR']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['LINK_REMOTE_AVATAR_EXPLAIN']; ?></span></td>
1414 4642 psotfx
                <td class="row1"><input class="post" type="text" name="remotelink" size="40" value="<?php echo $avatar_url; ?>" /></td>
1415 4642 psotfx
        </tr>
1416 4642 psotfx
        <tr>
1417 4642 psotfx
                <td class="row2" width="35%"><b><?php echo $user->lang['LINK_REMOTE_SIZE']; ?>: </b><br /><span class="gensmall"><?php echo $user->lang['LINK_REMOTE_SIZE_EXPLAIN']; ?></span></td>
1418 4642 psotfx
                <td class="row1"><input class="post" type="text" name="width" size="3" value="<?php echo $user_avatar_width; ?>" /> <span class="gen">px X </span> <input class="post" type="text" name="height" size="3" value="<?php echo $user_avatar_height; ?>" /> <span class="gen">px</span></td>
1419 4642 psotfx
        </tr>
1420 4642 psotfx
<?php
1421 4642 psotfx
1422 4642 psotfx
                        // Do we have a gallery?
1423 4642 psotfx
                        if ($config['null'] && !$display_gallery)
1424 4642 psotfx
                        {
1425 4642 psotfx
1426 4642 psotfx
?>
1427 4642 psotfx
        <tr>
1428 4642 psotfx
                <td class="row2" width="35%"><b><?php echo $user->lang['AVATAR_GALLERY']; ?>: </b></td>
1429 4642 psotfx
                <td class="row1"><input class="btnlite" type="submit" name="displaygallery" value="<?php echo $user->lang['DISPLAY_GALLERY']; ?>" /></td>
1430 4642 psotfx
        </tr>
1431 4642 psotfx
<?php
1432 4642 psotfx
                        }
1433 4642 psotfx
1434 4642 psotfx
                        // Do we want to display it?
1435 4642 psotfx
                        if ($config['null'] && $display_gallery)
1436 4642 psotfx
                        {
1437 4642 psotfx
1438 4642 psotfx
?>
1439 4642 psotfx
        <tr>
1440 4642 psotfx
                <th colspan="2"><?php echo $user->lang['AVATAR_GALLERY']; ?></th>
1441 4642 psotfx
        </tr>
1442 4642 psotfx
        <tr>
1443 4642 psotfx
                <td class="cat" colspan="2" align="center" valign="middle"><span class="genmed"><?php echo $user->lang['AVATAR_CATEGORY']; ?>: </span><select name="avatarcat">{S_CAT_OPTIONS}</select>&nbsp; <span class="genmed"><?php echo $user->lang['AVATAR_PAGE']; ?>: </span><select name="avatarpage">{S_PAGE_OPTIONS}</select>&nbsp;<input class="btnlite" type="submit" value="<?php echo $user->lang['GO']; ?>" name="avatargallery" /></td>
1444 4642 psotfx
        </tr>
1445 4642 psotfx
        <tr>
1446 4642 psotfx
                <td class="row1" colspan="2" align="center"><table cellspacing="1" cellpadding="4" border="0">
1447 4642 psotfx
1448 4642 psotfx
                        <!-- BEGIN avatar_row -->
1449 4642 psotfx
                        <tr>
1450 4642 psotfx
                                <!-- BEGIN avatar_column -->
1451 4642 psotfx
                                <td class="row1" align="center"><img src="{avatar_row.avatar_column.AVATAR_IMAGE}" alt="{avatar_row.avatar_column.AVATAR_NAME}" title="{avatar_row.avatar_column.AVATAR_NAME}" /></td>
1452 4642 psotfx
                                <!-- END avatar_column -->
1453 3646 psotfx
                        </tr>
1454 4642 psotfx
                        <tr>
1455 4642 psotfx
                                <!-- BEGIN avatar_option_column -->
1456 4642 psotfx
                                <td class="row2" align="center"><input type="radio" name="avatarselect" value="{avatar_row.avatar_option_column.S_OPTIONS_AVATAR}" /></td>
1457 4642 psotfx
                                <!-- END avatar_option_column -->
1458 4642 psotfx
                        </tr>
1459 4642 psotfx
                        <!-- END avatar_row -->
1460 4642 psotfx
1461 4642 psotfx
                </table></td>
1462 4642 psotfx
        </tr>
1463 3646 psotfx
<?php
1464 3646 psotfx
1465 3646 psotfx
                        }
1466 3646 psotfx
1467 4841 psotfx
?>
1468 4841 psotfx
                        <tr>
1469 4841 psotfx
                                <td class="cat" colspan="2" align="center"><input class="btnmain" type="submit" name="update" value="<?php echo $user->lang['SUBMIT']; ?>" />&nbsp;&nbsp;<input class="btnlite" type="reset" value="<?php echo $user->lang['RESET']; ?>" /></td>
1470 4841 psotfx
                        </tr>
1471 4841 psotfx
<?php
1472 4841 psotfx
1473 3646 psotfx
                        break;
1474 3646 psotfx
1475 4642 psotfx
1476 4642 psotfx
                case 'sig':
1477 4841 psotfx
1478 4841 psotfx
                        if ($submit || $preview)
1479 4841 psotfx
                        {
1480 4841 psotfx
                                $var_ary = array(
1481 4841 psotfx
                                        'enable_html'                => (bool) $config['allow_html'],
1482 4841 psotfx
                                        'enable_bbcode'                => (bool) $config['allow_bbcode'],
1483 4841 psotfx
                                        'enable_smilies'        => (bool) $config['allow_smilies'],
1484 4841 psotfx
                                        'enable_urls'                => true,
1485 4841 psotfx
                                        'signature'                        => (string) $user_sig,
1486 4841 psotfx
1487 4841 psotfx
                                );
1488 4841 psotfx
1489 4841 psotfx
                                foreach ($var_ary as $var => $default)
1490 4841 psotfx
                                {
1491 4841 psotfx
                                        $$var = request_var($var, $default);
1492 4841 psotfx
                                }
1493 4841 psotfx
1494 4978 acydburn
                                // NOTE: allow_img and allow_flash do not exist in config table
1495 4978 acydburn
                                $img_status = ($config['allow_img']) ? true : false;
1496 4978 acydburn
                                $flash_status = ($config['allow_flash']) ? true : false;
1497 4841 psotfx
1498 4978 acydburn
                                include($phpbb_root_path . 'includes/message_parser.'.$phpEx);
1499 4978 acydburn
                                $message_parser = new parse_message($signature);
1500 4841 psotfx
1501 4978 acydburn
                                // Allowing Quote BBCode
1502 4978 acydburn
                                $message_parser->parse($enable_html, $enable_bbcode, $enable_urls, $enable_smilies, $img_status, $flash_status, true);
1503 4978 acydburn
1504 4978 acydburn
                                if ($submit)
1505 4978 acydburn
                                {
1506 4841 psotfx
                                        $sql_ary = array(
1507 4841 psotfx
                                                'user_sig'                                        => (string) $message_parser->message,
1508 4841 psotfx
                                                'user_sig_bbcode_uid'                => (string) $message_parser->bbcode_uid,
1509 4841 psotfx
                                                'user_sig_bbcode_bitfield'        => (int) $message_parser->bbcode_bitfield
1510 4841 psotfx
                                        );
1511 4841 psotfx
1512 4841 psotfx
                                        $sql = 'UPDATE ' . USERS_TABLE . '
1513 4841 psotfx
                                                SET ' . $db->sql_build_array('UPDATE', $sql_ary) . "
1514 4841 psotfx
                                                WHERE user_id = $user_id";
1515 4841 psotfx
                                        $db->sql_query($sql);
1516 4841 psotfx
1517 4978 acydburn
                                        unset($message_parser);
1518 4841 psotfx
                                        trigger_error($user->lang['PROFILE_UPDATED']);
1519 4841 psotfx
                                }
1520 4841 psotfx
                        }
1521 4841 psotfx
1522 4841 psotfx
                        $colspan = 2;
1523 4841 psotfx
1524 4642 psotfx
                        include($phpbb_root_path . 'includes/functions_posting.'.$phpEx);
1525 4642 psotfx
1526 4827 psotfx
                        $signature_preview = '';
1527 4827 psotfx
                        if ($preview)
1528 4827 psotfx
                        {
1529 4978 acydburn
                                // Now parse it for displaying
1530 4978 acydburn
                                $signature_preview = $message_parser->format_display($enable_html, $enable_bbcode, $enable_urls, $enable_smilies, false);
1531 4978 acydburn
                                unset($message_parser);
1532 4827 psotfx
                        }
1533 4827 psotfx
1534 4978 acydburn
                        decode_message($user_sig, $user_sig_bbcode_uid);
1535 4642 psotfx
1536 4642 psotfx
?>
1537 4841 psotfx
                        <tr>
1538 4841 psotfx
                                <th colspan="<?php echo $colspan; ?>"><?php echo $user->lang['USER_ADMIN_SIG']; ?></th>
1539 4642 psotfx
                        </tr>
1540 4841 psotfx
                        <tr>
1541 4841 psotfx
                                <td class="row1" width="40%"><b class="genmed"><?php echo $user->lang['SIGNATURE']; ?>: </b></td>
1542 4841 psotfx
                                <td class="row2"><table cellspacing="0" cellpadding="2" border="0">
1543 4841 psotfx
                                        <tr align="center" valign="middle">
1544 4841 psotfx
                                                <td><input class="btnlite" type="button" accesskey="b" name="addbbcode0" value=" B " style="font-weight:bold; width: 30px" onclick="bbstyle(0)" onmouseover="helpline('b')" /></td>
1545 4841 psotfx
                                                <td><input class="btnlite" type="button" accesskey="i" name="addbbcode2" value=" i " style="font-style:italic; width: 30px" onclick="bbstyle(2)" onmouseover="helpline('i')" /></td>
1546 4841 psotfx
                                                <td><input class="btnlite" type="button" accesskey="u" name="addbbcode4" value=" u " style="text-decoration: underline; width: 30px" onclick="bbstyle(4)" onmouseover="helpline('u')" /></td>
1547 4841 psotfx
                                                <td><input class="btnlite" type="button" accesskey="q" name="addbbcode6" value="Quote" style="width: 50px" onclick="bbstyle(6)" onmouseover="helpline('q')" /></td>
1548 4841 psotfx
                                                <td><input class="btnlite" type="button" accesskey="c" name="addbbcode8" value="Code" style="width: 40px" onclick="bbstyle(8)" onmouseover="helpline('c')" /></td>
1549 4841 psotfx
                                                <td><input class="btnlite" type="button" accesskey="l" name="addbbcode10" value="List" style="width: 40px" onclick="bbstyle(10)" onmouseover="helpline('l')" /></td>
1550 4841 psotfx
                                                <td><input class="btnlite" type="button" accesskey="o" name="addbbcode12" value="List=" style="width: 40px" onclick="bbstyle(12)" onmouseover="helpline('o')" /></td>
1551 4841 psotfx
                                                <td><input class="btnlite" type="button" accesskey="p" name="addbbcode14" value="Img" style="width: 40px"  onclick="bbstyle(14)" onmouseover="helpline('p')" /></td>
1552 4841 psotfx
                                                <td><input class="btnlite" type="button" accesskey="w" name="addbbcode18" value="URL" style="text-decoration: underline; width: 40px" onclick="bbstyle(18)" onmouseover="helpline('w')" /></td>
1553 4841 psotfx
                                        </tr>
1554 4642 psotfx
                                        <tr>
1555 4841 psotfx
                                                <td colspan="9"><table width="100%" cellspacing="0" cellpadding="0" border="0">
1556 4841 psotfx
                                                        <tr>
1557 4841 psotfx
                                                                <td><span class="genmed"> &nbsp;<?php echo $user->lang['FONT_SIZE']; ?>:</span> <select name="addbbcode20" onchange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]');this.form.addbbcode20.selectedIndex = 2;" onmouseover="helpline('f')">
1558 4841 psotfx
                                                                        <option value="7"><?php echo $user->lang['FONT_TINY']; ?></option>
1559 4841 psotfx
                                                                        <option value="9"><?php echo $user->lang['FONT_SMALL']; ?></option>
1560 4841 psotfx
                                                                        <option value="12" selected="selected"><?php echo $user->lang['FONT_NORMAL']; ?></option>
1561 4841 psotfx
                                                                        <option value="18"><?php echo $user->lang['FONT_LARGE']; ?></option>
1562 4841 psotfx
                                                                        <option  value="24"><?php echo $user->lang['FONT_HUGE']; ?></option>
1563 4841 psotfx
                                                                </select></td>
1564 4841 psotfx
                                                                <td class="gensmall" nowrap="nowrap" align="right"><a href="javascript:bbstyle(-1)" onmouseover="helpline('a')"><?php echo $user->lang['CLOSE_TAGS']; ?></a></td>
1565 4841 psotfx
                                                        </tr>
1566 4841 psotfx
                                                </table></td>
1567 4642 psotfx
                                        </tr>
1568 4827 psotfx
                                        <tr>
1569 4841 psotfx
                                                <td colspan="9"><input class="helpline" type="text" name="helpbox" size="45" maxlength="100" value="<?php echo $user->lang['STYLES_TIP']; ?>" /></td>
1570 4841 psotfx
                                        </tr>
1571 4841 psotfx
                                        <tr>
1572 4841 psotfx
                                                <td colspan="9"><textarea name="signature" rows="6" cols="60" tabindex="3" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);"><?php echo $user_sig; ?></textarea></td>
1573 4841 psotfx
                                        </tr>
1574 4841 psotfx
                                        <tr>
1575 4841 psotfx
                                                <td colspan="9"><table cellspacing="0" cellpadding="0" border="0">
1576 4841 psotfx
                                                        <tr>
1577 4841 psotfx
                                                                <td bgcolor="black"><script language="javascript" type="text/javascript"><!--
1578 4827 psotfx
1579 4841 psotfx
                                                                colorPalette('h', 14, 5)
1580 4827 psotfx
1581 4841 psotfx
                                                                //--></script></td>
1582 4841 psotfx
                                                        </tr>
1583 4841 psotfx
                                                </table></td>
1584 4827 psotfx
                                        </tr>
1585 4827 psotfx
                                </table></td>
1586 4827 psotfx
                        </tr>
1587 4827 psotfx
                        <tr>
1588 4841 psotfx
                                <td class="row1" valign="top"><b class="genmed"><?php echo $user->lang['OPTIONS']; ?></b><br /><table cellspacing="2" cellpadding="0" border="0">
1589 4841 psotfx
                                        <tr>
1590 4841 psotfx
                                                <td class="gensmall"><?php echo ($config['allow_html']) ? $user->lang['HTML_IS_ON'] : $user->lang['HTML_IS_OFF']; ?></td>
1591 4841 psotfx
                                        </tr>
1592 4841 psotfx
                                        <tr>
1593 4841 psotfx
                                                <td class="gensmall"><?php echo ($config['allow_bbcode']) ? sprintf($user->lang['BBCODE_IS_ON'], "<a href=\"../faq.$phpEx$SID&amp;mode=bbcode\" target=\"_blank\">", '</a>') : sprintf($user->lang['BBCODE_IS_OFF'], "<a href=\"../faq.$phpEx$SID&amp;mode=bbcode\" target=\"_blank\">", '</a>'); ?></td>
1594 4841 psotfx
                                        </tr>
1595 4841 psotfx
                                        <tr>
1596 4841 psotfx
                                                <td class="gensmall"><?php echo ($config['allow_img']) ? $user->lang['IMAGES_ARE_ON'] : $user->lang['IMAGES_ARE_OFF']; ?></td>
1597 4841 psotfx
                                        </tr>
1598 4841 psotfx
                                        <tr>
1599 4841 psotfx
                                                <td class="gensmall"><?php echo ($config['allow_flash']) ? $user->lang['FLASH_IS_ON'] : $user->lang['FLASH_IS_OFF']; ?></td>
1600 4841 psotfx
                                        </tr>
1601 4841 psotfx
                                        <tr>
1602 4841 psotfx
                                                <td class="gensmall"><?php echo ($config['allow_smilies']) ? $user->lang['SMILIES_ARE_ON'] : $user->lang['SMILIES_ARE_OFF']; ?></td>
1603 4841 psotfx
                                        </tr>
1604 4841 psotfx
                                </table></td>
1605 4841 psotfx
                                <td class="row2" valign="top"><table cellspacing="0" cellpadding="1" border="0">
1606 4642 psotfx
<?php
1607 4642 psotfx
1608 4827 psotfx
                        if ($config['allow_html'])
1609 4827 psotfx
                        {
1610 4827 psotfx
1611 4827 psotfx
?>
1612 4841 psotfx
                                        <tr>
1613 4841 psotfx
                                                <td><input type="checkbox" name="disable_html" /></td>
1614 4841 psotfx
                                                <td class="gen"><?php echo $user->lang['DISABLE_HTML']; ?></td>
1615 4841 psotfx
                                        </tr>
1616 4827 psotfx
<?php
1617 4827 psotfx
1618 4827 psotfx
                        }
1619 4827 psotfx
1620 4827 psotfx
                        if ($config['allow_bbcode'])
1621 4827 psotfx
                        {
1622 4827 psotfx
1623 4827 psotfx
?>
1624 4841 psotfx
                                        <tr>
1625 4841 psotfx
                                                <td><input type="checkbox" name="disable_bbcode" /></td>
1626 4841 psotfx
                                                <td class="gen"><?php echo $user->lang['DISABLE_BBCODE']; ?></td>
1627 4841 psotfx
                                        </tr>
1628 4827 psotfx
<?php
1629 4827 psotfx
1630 4827 psotfx
                        }
1631 4827 psotfx
1632 4827 psotfx
                        if ($config['allow_smilies'])
1633 4827 psotfx
                        {
1634 4827 psotfx
1635 4827 psotfx
?>
1636 4841 psotfx
                                        <tr>
1637 4841 psotfx
                                                <td><input type="checkbox" name="disable_smilies" /></td>
1638 4841 psotfx
                                                <td class="gen"><?php echo $user->lang['DISABLE_SMILIES']; ?></td>
1639 4841 psotfx
                                        </tr>
1640 4827 psotfx
<?php
1641 4827 psotfx
1642 4827 psotfx
                        }
1643 4827 psotfx
1644 4827 psotfx
?>
1645 4841 psotfx
                                        <tr>
1646 4841 psotfx
                                                <td><input type="checkbox" name="disable_magic_url" /></td>
1647 4841 psotfx
                                                <td class="gen"><?php echo $user->lang['DISABLE_MAGIC_URL']; ?></td>
1648 4841 psotfx
                                        </tr>
1649 4841 psotfx
                                </table></td>
1650 4841 psotfx
                        </tr>
1651 4827 psotfx
                        <tr>
1652 4841 psotfx
                                <td class="cat" colspan="2" align="center"><input class="btnlite" type="submit" name="preview" value="<?php echo $user->lang['PREVIEW']; ?>" />&nbsp;&nbsp;<input class="btnmain" type="submit" name="update" value="<?php echo $user->lang['SUBMIT']; ?>" />&nbsp;&nbsp;<input class="btnlite" type="reset" value="<?php echo $user->lang['RESET']; ?>" /></td>
1653 4827 psotfx
                        </tr>
1654 4827 psotfx
<?php
1655 4827 psotfx
1656 4827 psotfx
                        if ($signature_preview)
1657 4827 psotfx
                        {
1658 4827 psotfx
1659 4827 psotfx
?>
1660 4841 psotfx
                        <tr>
1661 4841 psotfx
                                <th colspan="2" valign="middle"><?php echo $user->lang['ADMIN_SIGNATURE_PREVIEW']; ?></th>
1662 4841 psotfx
                        </tr>
1663 4841 psotfx
                        <tr>
1664 4841 psotfx
                                <td class="row1" colspan="2"><div class="postdetails" style="padding: 6px;"><?php echo $signature_preview; ?></div></td>
1665 4841 psotfx
                        </tr>
1666 4827 psotfx
<?php
1667 4827 psotfx
1668 4827 psotfx
                        }
1669 4827 psotfx
1670 4827 psotfx
?>
1671 4827 psotfx
<?php
1672 4827 psotfx
1673 4642 psotfx
                        break;
1674 4642 psotfx
1675 4841 psotfx
                case 'groups':
1676 4642 psotfx
1677 4841 psotfx
                        switch ($action)
1678 4841 psotfx
                        {
1679 4841 psotfx
                                case 'demote':
1680 4841 psotfx
                                case 'promote':
1681 4841 psotfx
                                case 'default':
1682 4841 psotfx
                                        group_user_attributes($action, $gid, $user_id);
1683 4841 psotfx
1684 4841 psotfx
                                        if ($action == 'default')
1685 4841 psotfx
                                        {
1686 4841 psotfx
                                                $group_id = $gid;
1687 4841 psotfx
                                        }
1688 4841 psotfx
                                        break;
1689 4841 psotfx
1690 4841 psotfx
                                case 'delete':
1691 4841 psotfx
                                        if (!$cancel && !$confirm)
1692 4841 psotfx
                                        {
1693 4841 psotfx
                                                adm_page_confirm($user->lang['CONFIRM'], $user->lang['CONFIRM_OPERATION']);
1694 4841 psotfx
                                        }
1695 4841 psotfx
                                        else if (!$cancel)
1696 4841 psotfx
                                        {
1697 4841 psotfx
                                                if (!$gid)
1698 4841 psotfx
                                                {
1699 4841 psotfx
                                                        trigger_error($user->lang['NO_GROUP']);
1700 4841 psotfx
                                                }
1701 4841 psotfx
1702 4841 psotfx
                                                if ($error = group_user_del($gid, $user_id))
1703 4841 psotfx
                                                {
1704 4841 psotfx
                                                        trigger_error($user->lang[$error]);
1705 4841 psotfx
                                                }
1706 4841 psotfx
                                        }
1707 4841 psotfx
                                break;
1708 4841 psotfx
                        }
1709 4841 psotfx
1710 4841 psotfx
                        // Add user to group?
1711 4841 psotfx
                        if ($submit)
1712 4841 psotfx
                        {
1713 4841 psotfx
                                if (!$gid)
1714 4841 psotfx
                                {
1715 4841 psotfx
                                        trigger_error($user->lang['NO_GROUP']);
1716 4841 psotfx
                                }
1717 4841 psotfx
1718 4841 psotfx
                                // Add user/s to group
1719 4841 psotfx
                                if ($error = group_user_add($gid, $user_id))
1720 4841 psotfx
                                {
1721 4841 psotfx
                                        trigger_error($user->lang[$error]);
1722 4841 psotfx
                                }
1723 4841 psotfx
                        }
1724 4841 psotfx
1725 4841 psotfx
                        $colspan = 4;
1726 4841 psotfx
1727 4841 psotfx
?>
1728 4841 psotfx
                        <tr>
1729 4841 psotfx
                                <th colspan="4"><?php echo $user->lang['USER_ADMIN_GROUPS']; ?></th>
1730 4841 psotfx
                        </tr>
1731 4841 psotfx
<?php
1732 4841 psotfx
1733 4841 psotfx
                        $sql = 'SELECT ug.group_leader, g.*
1734 4841 psotfx
                                FROM ' . GROUPS_TABLE . ' g, ' . USER_GROUP_TABLE . " ug
1735 4841 psotfx
                                WHERE ug.user_id = $user_id
1736 4841 psotfx
                                        AND g.group_id = ug.group_id
1737 4841 psotfx
                                ORDER BY g.group_type DESC, ug.user_pending ASC, g.group_name";
1738 4841 psotfx
                        $result = $db->sql_query($sql);
1739 4841 psotfx
1740 4841 psotfx
                        $i = 0;
1741 4841 psotfx
                        $group_data = $id_ary = array();
1742 4841 psotfx
                        while ($row = $db->sql_fetchrow($result))
1743 4841 psotfx
                        {
1744 4841 psotfx
                                $type = ($row['group_type'] == GROUP_SPECIAL) ? 'special' : (($row['user_pending']) ? 'pending' : 'normal');
1745 4841 psotfx
1746 4841 psotfx
                                $group_data[$type][$i]['group_id']                = $row['group_id'];
1747 4841 psotfx
                                $group_data[$type][$i]['group_name']        = $row['group_name'];
1748 4841 psotfx
                                $group_data[$type][$i]['group_leader']        = ($row['group_leader']) ? 1 : 0;
1749 4841 psotfx
1750 4841 psotfx
                                $id_ary[] = $row['group_id'];
1751 4841 psotfx
1752 4841 psotfx
                                $i++;
1753 4841 psotfx
                        }
1754 4841 psotfx
                        $db->sql_freeresult($result);
1755 4841 psotfx
1756 4841 psotfx
                        // Select box for other groups
1757 4841 psotfx
                        $sql = 'SELECT group_id, group_name, group_type
1758 4841 psotfx
                                FROM ' . GROUPS_TABLE . '
1759 4841 psotfx
                                WHERE group_id NOT IN (' . implode(', ', $id_ary) . ')
1760 4841 psotfx
                                ORDER BY group_type DESC, group_name ASC';
1761 4841 psotfx
                        $result = $db->sql_query($sql);
1762 4841 psotfx
1763 4841 psotfx
                        $group_options = '';
1764 4841 psotfx
                        while ($row = $db->sql_fetchrow($result))
1765 4841 psotfx
                        {
1766 4841 psotfx
                                $group_options .= '<option' . (($row['group_type'] == GROUP_SPECIAL) ? ' class="blue"' : '') . ' value="' . $row['group_id'] . '">' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</option>';
1767 4841 psotfx
                        }
1768 4841 psotfx
                        $db->sql_freeresult($result);
1769 4841 psotfx
1770 4841 psotfx
                        $current_type = '';
1771 4841 psotfx
                        foreach ($group_data as $group_type => $data_ary)
1772 4841 psotfx
                        {
1773 4841 psotfx
                                if ($current_type != $group_type)
1774 4841 psotfx
                                {
1775 4841 psotfx
1776 4841 psotfx
?>
1777 4841 psotfx
                        <tr>
1778 4841 psotfx
                                <td class="row3" colspan="4"><strong><?php echo $user->lang['USER_GROUP_' . strtoupper($group_type)]; ?></strong></td>
1779 4841 psotfx
                        </tr>
1780 4841 psotfx
<?php
1781 4841 psotfx
1782 4841 psotfx
                                }
1783 4841 psotfx
1784 4841 psotfx
                                foreach ($data_ary as $data)
1785 4841 psotfx
                                {
1786 4841 psotfx
                                        $row_class = ($row_class == 'row1') ? 'row2' : 'row1';
1787 4841 psotfx
1788 4841 psotfx
?>
1789 4841 psotfx
                        <tr>
1790 4841 psotfx
                                <td class="<?php echo $row_class; ?>"><a href="<?php echo "admin_groups.$phpEx$SID&amp;mode=manage&amp;action=edit&amp;g=" . $data['group_id']; ?>"><?php echo ($group_type == 'special') ? $user->lang['G_' . $data['group_name']] : $data['group_name']; ?></a></td>
1791 4841 psotfx
                                <td class="<?php echo $row_class; ?>" width="10%" nowrap="nowrap">&nbsp;<?php
1792 4841 psotfx
1793 4841 psotfx
                                        if ($group_id != $data['group_id'])
1794 4841 psotfx
                                        {
1795 4841 psotfx
1796 4841 psotfx
?><a href="<?php echo "admin_users.$phpEx$SID&amp;mode=$mode&amp;action=default&amp;u=$user_id&amp;g=" . $data['group_id']; ?>"><?php echo $user->lang['GROUP_DEFAULT']; ?></a><?php
1797 4841 psotfx
1798 4841 psotfx
                                        }
1799 4841 psotfx
                                        else
1800 4841 psotfx
                                        {
1801 4841 psotfx
                                                echo $user->lang['GROUP_DEFAULT'];
1802 4841 psotfx
                                        }
1803 4841 psotfx
1804 4841 psotfx
?>&nbsp;</td>
1805 4841 psotfx
                                <td class="<?php echo $row_class; ?>" width="10%" nowrap="nowrap">&nbsp;<?php
1806 4841 psotfx
1807 4841 psotfx
                                        if ($group_type != 'special')
1808 4841 psotfx
                                        {
1809 4841 psotfx
1810 4841 psotfx
?><a href="<?php echo "admin_users.$phpEx$SID&amp;mode=$mode&amp;action=" . (($data['group_leader']) ? 'demote' : 'promote') . "&amp;u=$user_id&amp;g=" . $data['group_id']; ?>"><?php echo ($data['group_leader']) ? $user->lang['GROUP_DEMOTE'] : $user->lang['GROUP_PROMOTE']; ?></a>&nbsp;<?php
1811 4841 psotfx
1812 4841 psotfx
                                        }
1813 4841 psotfx
1814 4841 psotfx
?></td>
1815 4841 psotfx
                                <td class="<?php echo $row_class; ?>" width="10%" nowrap="nowrap">&nbsp;<a href="<?php echo "admin_users.$phpEx$SID&amp;mode=$mode&amp;action=delete&amp;u=$user_id&amp;g=" . $data['group_id']; ?>"><?php echo $user->lang['GROUP_DELETE']; ?></a>&nbsp;</td>
1816 4841 psotfx
                        </tr>
1817 4841 psotfx
<?php
1818 4841 psotfx
1819 4841 psotfx
                                }
1820 4841 psotfx
                        }
1821 4841 psotfx
1822 4841 psotfx
?>
1823 4841 psotfx
                        <tr>
1824 4841 psotfx
                                <td class="cat" colspan="4" align="right"><?php echo $user->lang['USER_GROUP_ADD']; ?>: <select name="g"><?php echo $group_options; ?></select> <input class="btnmain" type="submit" name="update" value="<?php echo $user->lang['SUBMIT']; ?>" />&nbsp;</td>
1825 4841 psotfx
                        </tr>
1826 4841 psotfx
<?php
1827 4841 psotfx
1828 4642 psotfx
                        break;
1829 4642 psotfx
1830 4642 psotfx
1831 4642 psotfx
                case 'perm':
1832 4642 psotfx
                        break;
1833 4642 psotfx
1834 4833 acydburn
1835 4833 acydburn
                case 'attach':
1836 4841 psotfx
1837 4841 psotfx
                        if ($deletemark && $marked)
1838 4841 psotfx
                        {
1839 4841 psotfx
                                if (!$cancel && !$confirm)
1840 4841 psotfx
                                {
1841 4841 psotfx
                                        adm_page_confirm($user->lang['CONFIRM'], $user->lang['CONFIRM_OPERATION']);
1842 4841 psotfx
                                }
1843 4841 psotfx
                                else if (!$cancel)
1844 4841 psotfx
                                {
1845 4841 psotfx
                                        $sql = 'SELECT real_filename
1846 4841 psotfx
                                                FROM ' . ATTACHMENTS_TABLE . '
1847 4841 psotfx
                                                WHERE attach_id IN (' . implode(', ', $marked) . ')';
1848 4841 psotfx
                                        $result = $db->sql_query($sql);
1849 4841 psotfx
1850 4841 psotfx
                                        $log_attachments = array();
1851 4841 psotfx
                                        while ($row = $db->sql_fetchrow($result))
1852 4841 psotfx
                                        {
1853 4841 psotfx
                                                $log_attachments[] = $row['real_filename'];
1854 4841 psotfx
                                        }
1855 4841 psotfx
                                        $db->sql_freeresult($result);
1856 4841 psotfx
1857 4841 psotfx
                                        delete_attachments('attach', $marked);
1858 4841 psotfx
1859 4841 psotfx
                                        $log = (sizeof($delete_ids) == 1) ? 'ATTACHMENT_DELETED' : 'ATTACHMENTS_DELETED';
1860 4841 psotfx
                                        $meesage = (sizeof($delete_ids) == 1) ? $user->lang['ATTACHMENT_DELETED'] : $user->lang['ATTACHMENTS_DELETED'];
1861 4841 psotfx
1862 4841 psotfx
                                        add_log('admin', $log, implode(', ', $log_attachments));
1863 4841 psotfx
                                        trigger_error($message);
1864 4841 psotfx
                                }
1865 4841 psotfx
                        }
1866 4841 psotfx
1867 4841 psotfx
                        $colspan = 6;
1868 4833 acydburn
1869 4833 acydburn
                        $uri = "admin_users.$phpEx$SID&amp;mode=$mode&amp;action=$action&amp;u=$user_id";
1870 4833 acydburn
1871 4841 psotfx
                        $sk_text = array('a' => $user->lang['SORT_FILENAME'], 'b' => $user->lang['SORT_COMMENT'], 'c' => $user->lang['SORT_EXTENSION'], 'd' => $user->lang['SORT_SIZE'], 'e' => $user->lang['SORT_DOWNLOADS'], 'f' => $user->lang['SORT_POST_TIME'], 'g' => $user->lang['SORT_TOPIC_TITLE']);
1872 4841 psotfx
                        $sk_sql = array('a' => 'a.real_filename', 'b' => 'a.comment', 'c' => 'a.extension', 'd' => 'a.filesize', 'e' => 'a.download_count', 'f' => 'a.filetime', 'g' => 't.topic_title');
1873 4833 acydburn
1874 4841 psotfx
                        $sd_text = array('a' => $user->lang['ASCENDING'], 'd' => $user->lang['DESCENDING']);
1875 4833 acydburn
1876 4833 acydburn
                        $s_sort_key = '';
1877 4841 psotfx
                        foreach ($sk_text as $key => $value)
1878 4833 acydburn
                        {
1879 4841 psotfx
                                $selected = ($sk == $key) ? ' selected="selected"' : '';
1880 4833 acydburn
                                $s_sort_key .= '<option value="' . $key . '"' . $selected . '>' . $value . '</option>';
1881 4833 acydburn
                        }
1882 4833 acydburn
1883 4833 acydburn
                        $s_sort_dir = '';
1884 4841 psotfx
                        foreach ($sd_text as $key => $value)
1885 4833 acydburn
                        {
1886 4841 psotfx
                                $selected = ($sd == $key) ? ' selected="selected"' : '';
1887 4833 acydburn
                                $s_sort_dir .= '<option value="' . $key . '"' . $selected . '>' . $value . '</option>';
1888 4833 acydburn
                        }
1889 4833 acydburn
1890 4841 psotfx
                        $order_by = $sk_sql[$sk] . '  ' . (($sd == 'a') ? 'ASC' : 'DESC');
1891 4833 acydburn
1892 4833 acydburn
                        $sql = 'SELECT COUNT(*) as num_attachments
1893 4833 acydburn
                                FROM ' . ATTACHMENTS_TABLE . "
1894 4833 acydburn
                                WHERE poster_id = $user_id";
1895 4833 acydburn
                        $result = $db->sql_query_limit($sql, 1);
1896 4841 psotfx
1897 4833 acydburn
                        $num_attachments = $db->sql_fetchfield('num_attachments', 0, $result);
1898 4833 acydburn
                        $db->sql_freeresult($result);
1899 4833 acydburn
1900 4833 acydburn
                        $sql = 'SELECT a.*, t.topic_title
1901 4833 acydburn
                                FROM ' . ATTACHMENTS_TABLE . ' a, ' . TOPICS_TABLE . " t
1902 4833 acydburn
                                WHERE a.topic_id = t.topic_id
1903 4833 acydburn
                                        AND a.poster_id = $user_id
1904 4833 acydburn
                                ORDER BY $order_by";
1905 4833 acydburn
                        $result = $db->sql_query_limit($sql, $config['posts_per_page'], $start);
1906 4833 acydburn
1907 4833 acydburn
                        $row_count = 0;
1908 4833 acydburn
                        if ($row = $db->sql_fetchrow($result))
1909 4833 acydburn
                        {
1910 4833 acydburn
                                $class = 'row2';
1911 4841 psotfx
1912 4833 acydburn
?>
1913 4833 acydburn
                                <tr>
1914 4833 acydburn
                                        <th nowrap="nowrap">#</th>
1915 4841 psotfx
                                        <th nowrap="nowrap" width="15%"><a class="th" href="<?php echo "$uri&amp;sk=a&amp;sd=" . (($sk == 'a' && $sd == 'a') ? 'd' : 'a'); ?>"><?php echo $user->lang['FILENAME']; ?></a></th>
1916 4841 psotfx
                                        <th nowrap="nowrap" width="5%"><a class="th" href="<?php echo "$uri&amp;sk=f&amp;sd=" . (($sk == 'f' && $sd == 'a') ? 'd' : 'a'); ?>"><?php echo $user->lang['POST_TIME']; ?></a></th>
1917 4841 psotfx
                                        <th nowrap="nowrap" width="5%"><a class="th" href="<?php echo "$uri&amp;sk=d&amp;sd=" . (($sk == 'd' && $sd == 'a') ? 'd' : 'a'); ?>"><?php echo $user->lang['FILESIZE']; ?></a></th>
1918 4841 psotfx
                                        <th nowrap="nowrap" width="5%"><a class="th" href="<?php echo "$uri&amp;sk=e&amp;sd=" . (($sk == 'e' && $sd == 'a') ? 'd' : 'a'); ?>"><?php echo $user->lang['DOWNLOADS']; ?></a></th>
1919 4833 acydburn
                                        <th width="2%" nowrap="nowrap"><?php echo $user->lang['DELETE']; ?></th>
1920 4833 acydburn
                                </tr>
1921 4833 acydburn
<?php
1922 4841 psotfx
1923 4833 acydburn
                                do
1924 4833 acydburn
                                {
1925 4833 acydburn
                                        $view_topic = "{$phpbb_root_path}viewtopic.$phpEx$SID&amp;t=" . $row['topic_id'] . '&amp;p=' . $row['post_id'] . '#' . $row['post_id'];
1926 4841 psotfx
1927 4841 psotfx
                                        $row_class = ($row_class == 'row1') ? 'row2' : 'row1';
1928 4841 psotfx
1929 4833 acydburn
?>
1930 4841 psotfx
                                        <tr>
1931 4841 psotfx
                                                <td class="<?php echo $row_class; ?>" style="padding: 4px;" width="2%" align="center"><span class="gen">&nbsp;<?php echo $row_count + ($start + 1); ?>&nbsp;</span></td>
1932 4841 psotfx
                                                <td class="<?php echo $row_class; ?>" style="padding: 4px;"><a class="gen" href="<?php echo "{$phpbb_root_path}download.$phpEx$SID&amp;id=" . $row['attach_id']; ?>" target="_blank"><?php echo $row['real_filename']; ?></a><br /><span class="gensmall"><?php echo $user->lang['TOPIC']; ?>: <a href="<?php echo $view_topic; ?>" target="_blank"><?php echo $row['topic_title']; ?></a></span></td>
1933 4841 psotfx
                                                <td class="<?php echo $row_class; ?>" class="gensmall" style="padding: 4px;" align="center" nowrap="nowrap">&nbsp;<?php echo $user->format_date($row['filetime'], $user->lang['DATE_FORMAT']); ?>&nbsp;</td>
1934 4841 psotfx
                                                <td class="<?php echo $row_class; ?>" style="padding: 4px;" align="center" nowrap="nowrap"><span class="gen"><?php echo ($row['filesize'] >= 1048576) ? (round($row['filesize'] / 1048576 * 100) / 100) . ' ' . $user->lang['MB'] : (($row['filesize'] >= 1024) ? (round($row['filesize'] / 1024 * 100) / 100) . ' ' . $user->lang['KB'] : $row['filesize'] . ' ' . $user->lang['BYTES']); ?></span></td>
1935 4841 psotfx
                                                <td class="<?php echo $row_class; ?>" style="padding: 4px;" align="center"><span class="gen"><?php echo $row['download_count']; ?></span></td>
1936 4842 psotfx
                                                <td class="<?php echo $row_class; ?>" style="padding: 4px;" align="center"><input type="checkbox" name="mark[]" value="<?php echo $row['attach_id']; ?>" /></td>
1937 4833 acydburn
                                        </tr>
1938 4833 acydburn
<?php
1939 4841 psotfx
1940 4841 psotfx
                                        $row_count++;
1941 4833 acydburn
                                }
1942 4833 acydburn
                                while ($row = $db->sql_fetchrow($result));
1943 4833 acydburn
                        }
1944 4833 acydburn
                        $db->sql_freeresult($result);
1945 4833 acydburn
1946 4841 psotfx
                        $pagination = generate_pagination("$uri&amp;sk=$sk&amp;sd=$sd", $num_attachments, $config['topics_per_page'], $start);
1947 4841 psotfx
1948 4833 acydburn
?>
1949 4833 acydburn
                                        <tr>
1950 4841 psotfx
                                                <td class="cat" colspan="<?php echo $colspan; ?>"><table width="100%" cellspacing="0" cellpadding="0" border="0">
1951 4841 psotfx
                                                        <tr>
1952 4841 psotfx
                                                                <td width="100%" align="center"><span class="gensmall"><?php echo $user->lang['SORT_BY']; ?>: </span><select name="sk"><?php echo $s_sort_key; ?></select> <select name="sd"><?php echo $s_sort_dir; ?></select>&nbsp;<input class="btnlite" type="submit" name="sort" value="<?php echo $user->lang['SORT']; ?>" /></td>
1953 4841 psotfx
                                                                <td align="right"><input class="btnlite" type="submit" name="delmarked" value="<?php echo $user->lang['DELETE_MARKED']; ?>" />&nbsp;</td>
1954 4841 psotfx
                                                        </tr>
1955 4841 psotfx
                                                </table></td>
1956 4833 acydburn
                                        </tr>
1957 4833 acydburn
                                </table></td>
1958 4833 acydburn
                        </tr>
1959 4833 acydburn
<?php
1960 4833 acydburn
1961 4833 acydburn
                        break;
1962 3646 psotfx
        }
1963 3646 psotfx
1964 4833 acydburn
1965 4642 psotfx
?>
1966 4642 psotfx
                </table></td>
1967 4642 psotfx
        </tr>
1968 4833 acydburn
1969 4642 psotfx
<?php
1970 4642 psotfx
1971 4833 acydburn
1972 4642 psotfx
        if ($pagination)
1973 4642 psotfx
        {
1974 4642 psotfx
1975 4642 psotfx
?>
1976 4642 psotfx
        <tr>
1977 4642 psotfx
                <td align="right"><?php echo $pagination; ?></td>
1978 4642 psotfx
        </tr>
1979 4642 psotfx
<?php
1980 4642 psotfx
1981 4642 psotfx
        }
1982 4642 psotfx
1983 4642 psotfx
?>
1984 4642 psotfx
</table></form>
1985 4642 psotfx
1986 4642 psotfx
<?php
1987 4642 psotfx
1988 3969 psotfx
        adm_page_footer();
1989 3646 psotfx
1990 3646 psotfx
}
1991 3646 psotfx
1992 3646 psotfx
// Do we have permission?
1993 3646 psotfx
if (!$auth->acl_get('a_user'))
1994 3646 psotfx
{
1995 3646 psotfx
        trigger_error($user->lang['No_admin']);
1996 3646 psotfx
}
1997 3646 psotfx
1998 3646 psotfx
?>
1999 3646 psotfx
2000 4642 psotfx
<h1><?php echo $user->lang['USER_ADMIN']; ?></h1>
2001 3646 psotfx
2002 4642 psotfx
<p><?php echo $user->lang['USER_ADMIN_EXPLAIN']; ?></p>
2003 3646 psotfx
2004 4642 psotfx
<form method="post" name="post" action="<?php echo "admin_users.$phpEx$SID"; ?>"><table class="bg" width="75%" cellspacing="1" cellpadding="4" border="0" align="center">
2005 3646 psotfx
        <tr>
2006 4642 psotfx
                <th colspan="2"align="center"><?php echo $user->lang['SELECT_USER']; ?></th>
2007 3646 psotfx
        </tr>
2008 4642 psotfx
        <tr>
2009 4841 psotfx
                <td class="row1" width="40%"><b><?php echo $user->lang['FIND_USERNAME']; ?>: </b><br /><span class="gensmall">[ <a href="<?php echo "../memberlist.$phpEx$SID&amp;mode=searchuser&amp;field=username"; ?>" onclick="window.open('<?php echo "../memberlist.$phpEx$SID&amp;mode=searchuser&amp;field=username"?>', '_phpbbsearch', 'HEIGHT=500,resizable=yes,scrollbars=yes,WIDTH=740');return false;"><?php echo $user->lang['FIND_USERNAME']; ?></a> ]</span></td>
2010 4642 psotfx
                <td class="row2"><input type="text" class="post" name="username" maxlength="50" size="20" /></td>
2011 4642 psotfx
        </tr>
2012 3646 psotfx
        <tr>
2013 4642 psotfx
                <td class="cat" colspan="2" align="center"><input type="submit" name="submituser" value="<?php echo $user->lang['SUBMIT']; ?>" class="btnmain" /></td>
2014 3646 psotfx
        </tr>
2015 3646 psotfx
</table></form>
2016 3646 psotfx
2017 3646 psotfx
<?php
2018 3646 psotfx
2019 3969 psotfx
adm_page_footer();
2020 3646 psotfx
2021 4841 psotfx
2022 5114 acydburn
/* Module class
2023 4841 psotfx
class acp_admin_users extends module
2024 4841 psotfx
{
2025 4841 psotfx
2026 4841 psotfx
2027 4841 psotfx
2028 4841 psotfx
2029 4841 psotfx
}
2030 5114 acydburn
*/
2031 4841 psotfx
2032 3646 psotfx
?>