Changeset 702 for trunk/forum/includes/ucp/ucp_profile.php
- Timestamp:
- Mar 31, 2010, 6:32:40 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/forum/includes/ucp/ucp_profile.php
r400 r702 3 3 * 4 4 * @package ucp 5 * @version $Id : ucp_profile.php 8990 2008-10-09 15:41:19Z acydburn$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 111 111 'username_clean' => ($auth->acl_get('u_chgname') && $config['allow_namechange']) ? utf8_clean_string($data['username']) : $user->data['username_clean'], 112 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'],113 'user_email_hash' => ($auth->acl_get('u_chgemail')) ? phpbb_email_hash($data['email']) : $user->data['user_email_hash'], 114 114 'user_password' => ($auth->acl_get('u_chgpasswd') && $data['new_password']) ? phpbb_hash($data['new_password']) : $user->data['user_password'], 115 115 'user_passchg' => ($auth->acl_get('u_chgpasswd') && $data['new_password']) ? time() : 0, … … 134 134 $message = 'PROFILE_UPDATED'; 135 135 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))136 if ($auth->acl_get('u_chgemail') && $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)) 137 137 { 138 138 $message = ($config['require_activation'] == USER_ACTIVATION_SELF) ? 'ACCOUNT_EMAIL_CHANGED' : 'ACCOUNT_EMAIL_CHANGED_ADMIN'; … … 350 350 $data['notify'] = $user->data['user_notify_type']; 351 351 352 if ( !$config['jab_enable'] || !$data['jabber'] || !@extension_loaded('xml'))352 if ($data['notify'] == NOTIFY_IM && (!$config['jab_enable'] || !$data['jabber'] || !@extension_loaded('xml'))) 353 353 { 354 354 // User has not filled in a jabber address (Or one of the modules is disabled or jabber is disabled) 355 355 // Disable notify by Jabber now for this user. 356 $data['notify'] = NOTIFY_ BOTH;356 $data['notify'] = NOTIFY_EMAIL; 357 357 } 358 358 … … 381 381 382 382 // Update Custom Fields 383 if (sizeof($cp_data)) 384 { 385 $sql = 'UPDATE ' . PROFILE_FIELDS_DATA_TABLE . ' 386 SET ' . $db->sql_build_array('UPDATE', $cp_data) . ' 387 WHERE user_id = ' . $user->data['user_id']; 388 $db->sql_query($sql); 389 390 if (!$db->sql_affectedrows()) 391 { 392 $cp_data['user_id'] = (int) $user->data['user_id']; 393 394 $db->sql_return_on_error(true); 395 396 $sql = 'INSERT INTO ' . PROFILE_FIELDS_DATA_TABLE . ' ' . $db->sql_build_array('INSERT', $cp_data); 397 $db->sql_query($sql); 398 399 $db->sql_return_on_error(false); 400 } 401 } 383 $cp->update_profile_field_data($user->data['user_id'], $cp_data); 402 384 403 385 meta_refresh(3, $this->u_action); … … 475 457 include($phpbb_root_path . 'includes/functions_display.' . $phpEx); 476 458 477 $enable_bbcode = ($config['allow_sig_bbcode']) ? ( (request_var('disable_bbcode', !$user->optionget('bbcode'))) ? false : true) : false;478 $enable_smilies = ($config['allow_sig_smilies']) ? ( (request_var('disable_smilies', !$user->optionget('smilies'))) ? false : true) : false;479 $enable_urls = ($config['allow_sig_links']) ? ( (request_var('disable_magic_url', false)) ? false : true) : false;459 $enable_bbcode = ($config['allow_sig_bbcode']) ? (bool) $user->optionget('sig_bbcode') : false; 460 $enable_smilies = ($config['allow_sig_smilies']) ? (bool) $user->optionget('sig_smilies') : false; 461 $enable_urls = ($config['allow_sig_links']) ? (bool) $user->optionget('sig_links') : false; 480 462 481 463 $signature = utf8_normalize_nfc(request_var('signature', (string) $user->data['user_sig'], true)); … … 486 468 { 487 469 include($phpbb_root_path . 'includes/message_parser.' . $phpEx); 470 471 $enable_bbcode = ($config['allow_sig_bbcode']) ? ((request_var('disable_bbcode', false)) ? false : true) : false; 472 $enable_smilies = ($config['allow_sig_smilies']) ? ((request_var('disable_smilies', false)) ? false : true) : false; 473 $enable_urls = ($config['allow_sig_links']) ? ((request_var('disable_magic_url', false)) ? false : true) : false; 488 474 489 475 if (!sizeof($error)) … … 506 492 if (!sizeof($error) && $submit) 507 493 { 494 $user->optionset('sig_bbcode', $enable_bbcode); 495 $user->optionset('sig_smilies', $enable_smilies); 496 $user->optionset('sig_links', $enable_urls); 497 508 498 $sql_ary = array( 509 499 'user_sig' => (string) $message_parser->message, 500 'user_options' => $user->data['user_options'], 510 501 'user_sig_bbcode_uid' => (string) $message_parser->bbcode_uid, 511 502 'user_sig_bbcode_bitfield' => $message_parser->bbcode_bitfield … … 550 541 'FLASH_STATUS' => ($config['allow_sig_flash']) ? $user->lang['FLASH_IS_ON'] : $user->lang['FLASH_IS_OFF'], 551 542 'URL_STATUS' => ($config['allow_sig_links']) ? $user->lang['URL_IS_ON'] : $user->lang['URL_IS_OFF'], 543 'MAX_FONT_SIZE' => (int) $config['max_sig_font_size'], 552 544 553 545 'L_SIGNATURE_EXPLAIN' => sprintf($user->lang['SIGNATURE_EXPLAIN'], $config['max_sig_chars']), … … 573 565 $category = basename(request_var('category', '')); 574 566 575 $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;567 $can_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; 576 568 577 569 add_form_key('ucp_avatar'); … … 596 588 } 597 589 590 if (!$config['allow_avatar'] && $user->data['user_avatar_type']) 591 { 592 $error[] = $user->lang['AVATAR_NOT_ALLOWED']; 593 } 594 else if ((($user->data['user_avatar_type'] == AVATAR_UPLOAD) && !$config['allow_avatar_upload']) || 595 (($user->data['user_avatar_type'] == AVATAR_REMOTE) && !$config['allow_avatar_remote']) || 596 (($user->data['user_avatar_type'] == AVATAR_GALLERY) && !$config['allow_avatar_local'])) 597 { 598 $error[] = $user->lang['AVATAR_TYPE_NOT_ALLOWED']; 599 } 600 598 601 $template->assign_vars(array( 599 602 'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '', 600 'AVATAR' => get_user_avatar($user->data['user_avatar'], $user->data['user_avatar_type'], $user->data['user_avatar_width'], $user->data['user_avatar_height'] ),603 'AVATAR' => get_user_avatar($user->data['user_avatar'], $user->data['user_avatar_type'], $user->data['user_avatar_width'], $user->data['user_avatar_height'], 'USER_AVATAR', true), 601 604 'AVATAR_SIZE' => $config['avatar_filesize'], 602 605 603 606 'U_GALLERY' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=profile&mode=avatar&display_gallery=1'), 604 607 605 'S_FORM_ENCTYPE' => ($can_upload ) ? ' enctype="multipart/form-data"' : '',608 'S_FORM_ENCTYPE' => ($can_upload && ($config['allow_avatar_upload'] || $config['allow_avatar_remote_upload'])) ? ' enctype="multipart/form-data"' : '', 606 609 607 610 'L_AVATAR_EXPLAIN' => sprintf($user->lang['AVATAR_EXPLAIN'], $config['avatar_max_width'], $config['avatar_max_height'], $config['avatar_filesize'] / 1024), 608 611 )); 609 612 610 if ($ display_gallery && $auth->acl_get('u_chgavatar') && $config['allow_avatar_local'])613 if ($config['allow_avatar'] && $display_gallery && $auth->acl_get('u_chgavatar') && $config['allow_avatar_local']) 611 614 { 612 615 avatar_gallery($category, $avatar_select, 4); 613 616 } 614 else 615 { 616 $avatars_enabled = ( $can_upload|| ($auth->acl_get('u_chgavatar') && ($config['allow_avatar_local'] || $config['allow_avatar_remote']))) ? true : false;617 else if ($config['allow_avatar']) 618 { 619 $avatars_enabled = (($can_upload && ($config['allow_avatar_upload'] || $config['allow_avatar_remote_upload'])) || ($auth->acl_get('u_chgavatar') && ($config['allow_avatar_local'] || $config['allow_avatar_remote']))) ? true : false; 617 620 618 621 $template->assign_vars(array( … … 621 624 622 625 'S_AVATARS_ENABLED' => $avatars_enabled, 623 'S_UPLOAD_AVATAR_FILE' => $can_upload,624 'S_UPLOAD_AVATAR_URL' => $can_upload,626 'S_UPLOAD_AVATAR_FILE' => ($can_upload && $config['allow_avatar_upload']) ? true : false, 627 'S_UPLOAD_AVATAR_URL' => ($can_upload && $config['allow_avatar_remote_upload']) ? true : false, 625 628 'S_LINK_AVATAR' => ($auth->acl_get('u_chgavatar') && $config['allow_avatar_remote']) ? true : false, 626 629 'S_DISPLAY_GALLERY' => ($auth->acl_get('u_chgavatar') && $config['allow_avatar_local']) ? true : false)
Note:
See TracChangeset
for help on using the changeset viewer.