5
* @version $Id: ucp_profile.php,v 1.127 2007/10/05 14:36:34 acydburn Exp $
6
* @copyright (c) 2005 phpBB Group
7
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
14
if (!defined('IN_PHPBB'))
21
* Changing profile settings
23
* @todo what about pertaining user_sig_options?
30
function main($id, $mode)
32
global $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx;
34
$user->add_lang('posting');
36
$preview = (!empty($_POST['preview'])) ? true : false;
37
$submit = (!empty($_POST['submit'])) ? true : false;
38
$delete = (!empty($_POST['delete'])) ? true : false;
39
$error = $data = array();
40
$s_hidden_fields = '';
47
'username' => utf8_normalize_nfc(request_var('username', $user->data['username'], true)),
48
'email' => strtolower(request_var('email', $user->data['user_email'])),
49
'email_confirm' => strtolower(request_var('email_confirm', '')),
50
'new_password' => request_var('new_password', '', true),
51
'cur_password' => request_var('cur_password', '', true),
52
'password_confirm' => request_var('password_confirm', '', true),
55
add_form_key('ucp_reg_details');
59
// Do not check cur_password, it is the old one.
61
'new_password' => array(
62
array('string', true, $config['min_pass_chars'], $config['max_pass_chars']),
64
'password_confirm' => array('string', true, $config['min_pass_chars'], $config['max_pass_chars']),
66
array('string', false, 6, 60),
68
'email_confirm' => array('string', true, 6, 60),
71
if ($auth->acl_get('u_chgname') && $config['allow_namechange'])
73
$check_ary['username'] = array(
74
array('string', false, $config['min_name_chars'], $config['max_name_chars']),
79
$error = validate_data($data, $check_ary);
81
if ($auth->acl_get('u_chgpasswd') && $data['new_password'] && $data['password_confirm'] != $data['new_password'])
83
$error[] = 'NEW_PASSWORD_ERROR';
86
if (($data['new_password'] || ($auth->acl_get('u_chgemail') && $data['email'] != $user->data['user_email']) || ($data['username'] != $user->data['username'] && $auth->acl_get('u_chgname') && $config['allow_namechange'])) && !phpbb_check_hash($data['cur_password'], $user->data['user_password']))
88
$error[] = 'CUR_PASSWORD_ERROR';
91
// Only check the new password against the previous password if there have been no errors
92
if (!sizeof($error) && $auth->acl_get('u_chgpasswd') && $data['new_password'] && phpbb_check_hash($data['new_password'], $user->data['user_password']))
94
$error[] = 'SAME_PASSWORD_ERROR';
97
if ($auth->acl_get('u_chgemail') && $data['email'] != $user->data['user_email'] && $data['email_confirm'] != $data['email'])
99
$error[] = 'NEW_EMAIL_ERROR';
102
if (!check_form_key('ucp_reg_details'))
104
$error[] = 'FORM_INVALID';
110
'username' => ($auth->acl_get('u_chgname') && $config['allow_namechange']) ? $data['username'] : $user->data['username'],
111
'username_clean' => ($auth->acl_get('u_chgname') && $config['allow_namechange']) ? utf8_clean_string($data['username']) : $user->data['username_clean'],
112
'user_email' => ($auth->acl_get('u_chgemail')) ? $data['email'] : $user->data['user_email'],
113
'user_email_hash' => ($auth->acl_get('u_chgemail')) ? crc32($data['email']) . strlen($data['email']) : $user->data['user_email_hash'],
114
'user_password' => ($auth->acl_get('u_chgpasswd') && $data['new_password']) ? phpbb_hash($data['new_password']) : $user->data['user_password'],
115
'user_passchg' => ($auth->acl_get('u_chgpasswd') && $data['new_password']) ? time() : 0,
118
if ($auth->acl_get('u_chgname') && $config['allow_namechange'] && $data['username'] != $user->data['username'])
120
add_log('user', $user->data['user_id'], 'LOG_USER_UPDATE_NAME', $user->data['username'], $data['username']);
123
if ($auth->acl_get('u_chgpasswd') && $data['new_password'] && !phpbb_check_hash($data['new_password'], $user->data['user_password']))
125
$user->reset_login_keys();
126
add_log('user', $user->data['user_id'], 'LOG_USER_NEW_PASSWORD', $data['username']);
129
if ($auth->acl_get('u_chgemail') && $data['email'] != $user->data['user_email'])
131
add_log('user', $user->data['user_id'], 'LOG_USER_UPDATE_EMAIL', $data['username'], $user->data['user_email'], $data['email']);
134
$message = 'PROFILE_UPDATED';
136
if ($config['email_enable'] && $data['email'] != $user->data['user_email'] && $user->data['user_type'] != USER_FOUNDER && ($config['require_activation'] == USER_ACTIVATION_SELF || $config['require_activation'] == USER_ACTIVATION_ADMIN))
138
$message = ($config['require_activation'] == USER_ACTIVATION_SELF) ? 'ACCOUNT_EMAIL_CHANGED' : 'ACCOUNT_EMAIL_CHANGED_ADMIN';
140
include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
142
$server_url = generate_board_url();
144
$user_actkey = gen_rand_string(10);
145
$key_len = 54 - (strlen($server_url));
146
$key_len = ($key_len > 6) ? $key_len : 6;
147
$user_actkey = substr($user_actkey, 0, $key_len);
149
$messenger = new messenger(false);
151
$template_file = ($config['require_activation'] == USER_ACTIVATION_ADMIN) ? 'user_activate_inactive' : 'user_activate';
152
$messenger->template($template_file, $user->data['user_lang']);
154
$messenger->to($data['email'], $data['username']);
156
$messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);
157
$messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']);
158
$messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']);
159
$messenger->headers('X-AntiAbuse: User IP - ' . $user->ip);
161
$messenger->assign_vars(array(
162
'USERNAME' => htmlspecialchars_decode($data['username']),
163
'U_ACTIVATE' => "$server_url/ucp.$phpEx?mode=activate&u={$user->data['user_id']}&k=$user_actkey")
166
$messenger->send(NOTIFY_EMAIL);
168
if ($config['require_activation'] == USER_ACTIVATION_ADMIN)
170
// Grab an array of user_id's with a_user permissions ... these users can activate a user
171
$admin_ary = $auth->acl_get_list(false, 'a_user', false);
172
$admin_ary = (!empty($admin_ary[0]['a_user'])) ? $admin_ary[0]['a_user'] : array();
174
// Also include founders
175
$where_sql = ' WHERE user_type = ' . USER_FOUNDER;
177
if (sizeof($admin_ary))
179
$where_sql .= ' OR ' . $db->sql_in_set('user_id', $admin_ary);
182
$sql = 'SELECT user_id, username, user_email, user_lang, user_jabber, user_notify_type
183
FROM ' . USERS_TABLE . ' ' .
185
$result = $db->sql_query($sql);
187
while ($row = $db->sql_fetchrow($result))
189
$messenger->template('admin_activate', $row['user_lang']);
190
$messenger->to($row['user_email'], $row['username']);
191
$messenger->im($row['user_jabber'], $row['username']);
193
$messenger->assign_vars(array(
194
'USERNAME' => htmlspecialchars_decode($data['username']),
195
'U_USER_DETAILS' => "$server_url/memberlist.$phpEx?mode=viewprofile&u={$user->data['user_id']}",
196
'U_ACTIVATE' => "$server_url/ucp.$phpEx?mode=activate&u={$user->data['user_id']}&k=$user_actkey")
199
$messenger->send($row['user_notify_type']);
201
$db->sql_freeresult($result);
204
user_active_flip('deactivate', $user->data['user_id'], INACTIVE_PROFILE);
206
// Because we want the profile to be reactivated we set user_newpasswd to empty (else the reactivation will fail)
207
$sql_ary['user_actkey'] = $user_actkey;
208
$sql_ary['user_newpasswd'] = '';
211
if (sizeof($sql_ary))
213
$sql = 'UPDATE ' . USERS_TABLE . '
214
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
215
WHERE user_id = ' . $user->data['user_id'];
216
$db->sql_query($sql);
219
// Need to update config, forum, topic, posting, messages, etc.
220
if ($data['username'] != $user->data['username'] && $auth->acl_get('u_chgname') && $config['allow_namechange'])
222
user_update_name($user->data['username'], $data['username']);
225
// Now, we can remove the user completely (kill the session) - NOT BEFORE!!!
226
if (!empty($sql_ary['user_actkey']))
228
meta_refresh(5, append_sid($phpbb_root_path . 'index.' . $phpEx));
229
$message = $user->lang[$message] . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid($phpbb_root_path . 'index.' . $phpEx) . '">', '</a>');
231
// Because the user gets deactivated we log him out too, killing his session
232
$user->session_kill();
236
meta_refresh(3, $this->u_action);
237
$message = $user->lang[$message] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>');
240
trigger_error($message);
243
// Replace "error" strings with their real, localised form
244
$error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
247
$template->assign_vars(array(
248
'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '',
250
'USERNAME' => $data['username'],
251
'EMAIL' => $data['email'],
252
'PASSWORD_CONFIRM' => $data['password_confirm'],
253
'NEW_PASSWORD' => $data['new_password'],
254
'CUR_PASSWORD' => '',
256
'L_USERNAME_EXPLAIN' => sprintf($user->lang[$config['allow_name_chars'] . '_EXPLAIN'], $config['min_name_chars'], $config['max_name_chars']),
257
'L_CHANGE_PASSWORD_EXPLAIN' => sprintf($user->lang[$config['pass_complex'] . '_EXPLAIN'], $config['min_pass_chars'], $config['max_pass_chars']),
259
'S_FORCE_PASSWORD' => ($auth->acl_get('u_chgpasswd') && $config['chg_passforce'] && $user->data['user_passchg'] < time() - ($config['chg_passforce'] * 86400)) ? true : false,
260
'S_CHANGE_USERNAME' => ($config['allow_namechange'] && $auth->acl_get('u_chgname')) ? true : false,
261
'S_CHANGE_EMAIL' => ($auth->acl_get('u_chgemail')) ? true : false,
262
'S_CHANGE_PASSWORD' => ($auth->acl_get('u_chgpasswd')) ? true : false)
268
include($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx);
270
$cp = new custom_profile();
272
$cp_data = $cp_error = array();
275
'icq' => request_var('icq', $user->data['user_icq']),
276
'aim' => request_var('aim', $user->data['user_aim']),
277
'msn' => request_var('msn', $user->data['user_msnm']),
278
'yim' => request_var('yim', $user->data['user_yim']),
279
'jabber' => utf8_normalize_nfc(request_var('jabber', $user->data['user_jabber'], true)),
280
'website' => request_var('website', $user->data['user_website']),
281
'location' => utf8_normalize_nfc(request_var('location', $user->data['user_from'], true)),
282
'occupation' => utf8_normalize_nfc(request_var('occupation', $user->data['user_occ'], true)),
283
'interests' => utf8_normalize_nfc(request_var('interests', $user->data['user_interests'], true)),
286
if ($config['allow_birthdays'])
288
$data['bday_day'] = $data['bday_month'] = $data['bday_year'] = 0;
290
if ($user->data['user_birthday'])
292
list($data['bday_day'], $data['bday_month'], $data['bday_year']) = explode('-', $user->data['user_birthday']);
295
$data['bday_day'] = request_var('bday_day', $data['bday_day']);
296
$data['bday_month'] = request_var('bday_month', $data['bday_month']);
297
$data['bday_year'] = request_var('bday_year', $data['bday_year']);
300
add_form_key('ucp_profile_info');
304
$validate_array = array(
306
array('string', true, 3, 15),
307
array('match', true, '#^[0-9]+$#i')),
308
'aim' => array('string', true, 3, 255),
309
'msn' => array('string', true, 5, 255),
311
array('string', true, 5, 255),
313
'yim' => array('string', true, 5, 255),
315
array('string', true, 12, 255),
316
array('match', true, '#^http[s]?://(.*?\.)*?[a-z0-9\-]+\.[a-z]{2,4}#i')),
317
'location' => array('string', true, 2, 255),
318
'occupation' => array('string', true, 2, 500),
319
'interests' => array('string', true, 2, 500),
322
if ($config['allow_birthdays'])
324
$validate_array = array_merge($validate_array, array(
325
'bday_day' => array('num', true, 1, 31),
326
'bday_month' => array('num', true, 1, 12),
327
'bday_year' => array('num', true, 1901, gmdate('Y', time()) + 50),
331
$error = validate_data($data, $validate_array);
333
// validate custom profile fields
334
$cp->submit_cp_field('profile', $user->get_iso_lang_id(), $cp_data, $cp_error);
336
if (sizeof($cp_error))
338
$error = array_merge($error, $cp_error);
341
if (!check_form_key('ucp_profile_info'))
343
$error[] = 'FORM_INVALID';
349
'user_icq' => $data['icq'],
350
'user_aim' => $data['aim'],
351
'user_msnm' => $data['msn'],
352
'user_yim' => $data['yim'],
353
'user_jabber' => $data['jabber'],
354
'user_website' => $data['website'],
355
'user_from' => $data['location'],
356
'user_occ' => $data['occupation'],
357
'user_interests'=> $data['interests'],
360
if ($config['allow_birthdays'])
362
$sql_ary['user_birthday'] = sprintf('%2d-%2d-%4d', $data['bday_day'], $data['bday_month'], $data['bday_year']);
365
$sql = 'UPDATE ' . USERS_TABLE . '
366
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
367
WHERE user_id = ' . $user->data['user_id'];
368
$db->sql_query($sql);
370
// Update Custom Fields
371
if (sizeof($cp_data))
373
$sql = 'UPDATE ' . PROFILE_FIELDS_DATA_TABLE . '
374
SET ' . $db->sql_build_array('UPDATE', $cp_data) . '
375
WHERE user_id = ' . $user->data['user_id'];
376
$db->sql_query($sql);
378
if (!$db->sql_affectedrows())
380
$cp_data['user_id'] = (int) $user->data['user_id'];
382
$db->sql_return_on_error(true);
384
$sql = 'INSERT INTO ' . PROFILE_FIELDS_DATA_TABLE . ' ' . $db->sql_build_array('INSERT', $cp_data);
385
$db->sql_query($sql);
387
$db->sql_return_on_error(false);
391
meta_refresh(3, $this->u_action);
392
$message = $user->lang['PROFILE_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>');
393
trigger_error($message);
396
// Replace "error" strings with their real, localised form
397
$error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
400
if ($config['allow_birthdays'])
402
$s_birthday_day_options = '<option value="0"' . ((!$data['bday_day']) ? ' selected="selected"' : '') . '>--</option>';
403
for ($i = 1; $i < 32; $i++)
405
$selected = ($i == $data['bday_day']) ? ' selected="selected"' : '';
406
$s_birthday_day_options .= "<option value=\"$i\"$selected>$i</option>";
409
$s_birthday_month_options = '<option value="0"' . ((!$data['bday_month']) ? ' selected="selected"' : '') . '>--</option>';
410
for ($i = 1; $i < 13; $i++)
412
$selected = ($i == $data['bday_month']) ? ' selected="selected"' : '';
413
$s_birthday_month_options .= "<option value=\"$i\"$selected>$i</option>";
415
$s_birthday_year_options = '';
418
$s_birthday_year_options = '<option value="0"' . ((!$data['bday_year']) ? ' selected="selected"' : '') . '>--</option>';
419
for ($i = $now['year'] - 100; $i < $now['year']; $i++)
421
$selected = ($i == $data['bday_year']) ? ' selected="selected"' : '';
422
$s_birthday_year_options .= "<option value=\"$i\"$selected>$i</option>";
426
$template->assign_vars(array(
427
'S_BIRTHDAY_DAY_OPTIONS' => $s_birthday_day_options,
428
'S_BIRTHDAY_MONTH_OPTIONS' => $s_birthday_month_options,
429
'S_BIRTHDAY_YEAR_OPTIONS' => $s_birthday_year_options,
430
'S_BIRTHDAYS_ENABLED' => true,
434
$template->assign_vars(array(
435
'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '',
437
'ICQ' => $data['icq'],
438
'YIM' => $data['yim'],
439
'AIM' => $data['aim'],
440
'MSN' => $data['msn'],
441
'JABBER' => $data['jabber'],
442
'WEBSITE' => $data['website'],
443
'LOCATION' => $data['location'],
444
'OCCUPATION'=> $data['occupation'],
445
'INTERESTS' => $data['interests'],
448
// Get additional profile fields and assign them to the template block var 'profile_fields'
449
$user->get_profile_fields($user->data['user_id']);
451
$cp->generate_profile_fields('profile', $user->get_iso_lang_id());
457
if (!$auth->acl_get('u_sig'))
459
trigger_error('NO_AUTH_SIGNATURE');
462
include($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
463
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
465
$enable_bbcode = ($config['allow_sig_bbcode']) ? ((request_var('disable_bbcode', !$user->optionget('bbcode'))) ? false : true) : false;
466
$enable_smilies = ($config['allow_sig_smilies']) ? ((request_var('disable_smilies', !$user->optionget('smilies'))) ? false : true) : false;
467
$enable_urls = ($config['allow_sig_links']) ? ((request_var('disable_magic_url', false)) ? false : true) : false;
469
$signature = utf8_normalize_nfc(request_var('signature', (string) $user->data['user_sig'], true));
471
add_form_key('ucp_sig');
473
if ($submit || $preview)
475
include($phpbb_root_path . 'includes/message_parser.' . $phpEx);
479
$message_parser = new parse_message($signature);
481
// Allowing Quote BBCode
482
$message_parser->parse($enable_bbcode, $enable_urls, $enable_smilies, $config['allow_sig_img'], $config['allow_sig_flash'], true, $config['allow_sig_links'], true, 'sig');
484
if (sizeof($message_parser->warn_msg))
486
$error[] = implode('<br />', $message_parser->warn_msg);
489
if (!check_form_key('ucp_sig'))
491
$error[] = 'FORM_INVALID';
494
if (!sizeof($error) && $submit)
497
'user_sig' => (string) $message_parser->message,
498
'user_sig_bbcode_uid' => (string) $message_parser->bbcode_uid,
499
'user_sig_bbcode_bitfield' => $message_parser->bbcode_bitfield
502
$sql = 'UPDATE ' . USERS_TABLE . '
503
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
504
WHERE user_id = ' . $user->data['user_id'];
505
$db->sql_query($sql);
507
$message = $user->lang['PROFILE_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>');
508
trigger_error($message);
512
// Replace "error" strings with their real, localised form
513
$error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
516
$signature_preview = '';
519
// Now parse it for displaying
520
$signature_preview = $message_parser->format_display($enable_bbcode, $enable_urls, $enable_smilies, false);
521
unset($message_parser);
524
decode_message($signature, $user->data['user_sig_bbcode_uid']);
526
$template->assign_vars(array(
527
'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '',
528
'SIGNATURE' => $signature,
529
'SIGNATURE_PREVIEW' => $signature_preview,
531
'S_BBCODE_CHECKED' => (!$enable_bbcode) ? ' checked="checked"' : '',
532
'S_SMILIES_CHECKED' => (!$enable_smilies) ? ' checked="checked"' : '',
533
'S_MAGIC_URL_CHECKED' => (!$enable_urls) ? ' checked="checked"' : '',
535
'BBCODE_STATUS' => ($config['allow_sig_bbcode']) ? sprintf($user->lang['BBCODE_IS_ON'], '<a href="' . append_sid("{$phpbb_root_path}faq.$phpEx", 'mode=bbcode') . '">', '</a>') : sprintf($user->lang['BBCODE_IS_OFF'], '<a href="' . append_sid("{$phpbb_root_path}faq.$phpEx", 'mode=bbcode') . '">', '</a>'),
536
'SMILIES_STATUS' => ($config['allow_sig_smilies']) ? $user->lang['SMILIES_ARE_ON'] : $user->lang['SMILIES_ARE_OFF'],
537
'IMG_STATUS' => ($config['allow_sig_img']) ? $user->lang['IMAGES_ARE_ON'] : $user->lang['IMAGES_ARE_OFF'],
538
'FLASH_STATUS' => ($config['allow_sig_flash']) ? $user->lang['FLASH_IS_ON'] : $user->lang['FLASH_IS_OFF'],
539
'URL_STATUS' => ($config['allow_sig_links']) ? $user->lang['URL_IS_ON'] : $user->lang['URL_IS_OFF'],
541
'L_SIGNATURE_EXPLAIN' => sprintf($user->lang['SIGNATURE_EXPLAIN'], $config['max_sig_chars']),
543
'S_BBCODE_ALLOWED' => $config['allow_sig_bbcode'],
544
'S_SMILIES_ALLOWED' => $config['allow_sig_smilies'],
545
'S_BBCODE_IMG' => ($config['allow_sig_img']) ? true : false,
546
'S_BBCODE_FLASH' => ($config['allow_sig_flash']) ? true : false,
547
'S_LINKS_ALLOWED' => ($config['allow_sig_links']) ? true : false)
550
// Build custom bbcodes array
551
display_custom_bbcodes();
557
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
559
$display_gallery = request_var('display_gallery', '0');
560
$avatar_select = basename(request_var('avatar_select', ''));
561
$category = basename(request_var('category', ''));
563
$can_upload = ($config['allow_avatar_upload'] && file_exists($phpbb_root_path . $config['avatar_path']) && @is_writable($phpbb_root_path . $config['avatar_path']) && $auth->acl_get('u_chgavatar') && (@ini_get('file_uploads') || strtolower(@ini_get('file_uploads')) == 'on')) ? true : false;
565
add_form_key('ucp_avatar');
569
if (check_form_key('ucp_avatar'))
571
if (avatar_process_user($error))
573
meta_refresh(3, $this->u_action);
574
$message = $user->lang['PROFILE_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>');
575
trigger_error($message);
580
$error[] = 'FORM_INVALID';
582
// Replace "error" strings with their real, localised form
583
$error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error);
586
$template->assign_vars(array(
587
'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '',
588
'AVATAR' => get_user_avatar($user->data['user_avatar'], $user->data['user_avatar_type'], $user->data['user_avatar_width'], $user->data['user_avatar_height']),
589
'AVATAR_SIZE' => $config['avatar_filesize'],
591
'U_GALLERY' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=profile&mode=avatar&display_gallery=1'),
593
'S_FORM_ENCTYPE' => ($can_upload) ? ' enctype="multipart/form-data"' : '',
595
'L_AVATAR_EXPLAIN' => sprintf($user->lang['AVATAR_EXPLAIN'], $config['avatar_max_width'], $config['avatar_max_height'], round($config['avatar_filesize'] / 1024)),)
598
if ($display_gallery && $auth->acl_get('u_chgavatar') && $config['allow_avatar_local'])
600
avatar_gallery($category, $avatar_select, 4);
604
$avatars_enabled = ($can_upload || ($auth->acl_get('u_chgavatar') && ($config['allow_avatar_local'] || $config['allow_avatar_remote']))) ? true : false;
606
$template->assign_vars(array(
607
'AVATAR_WIDTH' => request_var('width', $user->data['user_avatar_width']),
608
'AVATAR_HEIGHT' => request_var('height', $user->data['user_avatar_height']),
610
'S_AVATARS_ENABLED' => $avatars_enabled,
611
'S_UPLOAD_AVATAR_FILE' => $can_upload,
612
'S_UPLOAD_AVATAR_URL' => $can_upload,
613
'S_LINK_AVATAR' => ($auth->acl_get('u_chgavatar') && $config['allow_avatar_remote']) ? true : false,
614
'S_DISPLAY_GALLERY' => ($auth->acl_get('u_chgavatar') && $config['allow_avatar_local']) ? true : false)
621
$template->assign_vars(array(
622
'L_TITLE' => $user->lang['UCP_PROFILE_' . strtoupper($mode)],
624
'S_HIDDEN_FIELDS' => $s_hidden_fields,
625
'S_UCP_ACTION' => $this->u_action)
628
// Set desired template
629
$this->tpl_name = 'ucp_profile_' . $mode;
630
$this->page_title = 'UCP_PROFILE_' . strtoupper($mode);
b'\\ No newline at end of file'