Changeset 702 for trunk/forum/includes/ucp
- Timestamp:
- Mar 31, 2010, 6:32:40 PM (15 years ago)
- Location:
- trunk/forum/includes/ucp
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/forum/includes/ucp/ucp_activate.php
r400 r702 3 3 * 4 4 * @package ucp 5 * @version $Id : ucp_activate.php 9067 2008-11-21 13:21:53Z Kellanved$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 57 57 } 58 58 59 // Do not allow activating by non administrators when admin activation is on 60 // Only activation type the user should be able to do is INACTIVE_REMIND 61 // or activate a new password which is not an activation state :@ 62 if (!$user_row['user_newpasswd'] && $user_row['user_inactive_reason'] != INACTIVE_REMIND && $config['require_activation'] == USER_ACTIVATION_ADMIN && !$auth->acl_get('a_user')) 63 { 64 if (!$user->data['is_registered']) 65 { 66 login_box('', $user->lang['NO_AUTH_OPERATION']); 67 } 68 trigger_error('NO_AUTH_OPERATION'); 69 } 70 59 71 $update_password = ($user_row['user_newpasswd']) ? true : false; 60 72 … … 73 85 WHERE user_id = ' . $user_row['user_id']; 74 86 $db->sql_query($sql); 87 88 add_log('user', $user_row['user_id'], 'LOG_USER_NEW_PASSWORD', $user_row['username']); 75 89 } 76 90 -
trunk/forum/includes/ucp/ucp_attachments.php
r400 r702 3 3 * 4 4 * @package ucp 5 * @version $Id : ucp_attachments.php 8479 2008-03-29 00:22:48Z naderman$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 185 185 'U_SORT_DOWNLOADS' => $this->u_action . "&sk=e&sd=" . (($sort_key == 'e' && $sort_dir == 'a') ? 'd' : 'a'), 186 186 'U_SORT_POST_TIME' => $this->u_action . "&sk=f&sd=" . (($sort_key == 'f' && $sort_dir == 'a') ? 'd' : 'a'), 187 'U_SORT_TOPIC_TITLE' => $this->u_action . "&sk=g&sd=" . (($sort_key == ' f' && $sort_dir == 'a') ? 'd' : 'a'),187 'U_SORT_TOPIC_TITLE' => $this->u_action . "&sk=g&sd=" . (($sort_key == 'g' && $sort_dir == 'a') ? 'd' : 'a'), 188 188 189 189 'S_DISPLAY_MARK_ALL' => ($num_attachments) ? true : false, -
trunk/forum/includes/ucp/ucp_confirm.php
r400 r702 3 3 * 4 4 * @package VC 5 * @version $Id : ucp_confirm.php 8655 2008-06-13 19:39:01Z acydburn$6 * @copyright (c) 2005 phpBB Group5 * @version $Id$ 6 * @copyright (c) 2005 2008 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License 8 8 * … … 38 38 global $db, $user, $phpbb_root_path, $config, $phpEx; 39 39 40 // Do we have an id? No, then just exit 41 $confirm_id = request_var('id', ''); 42 $type = request_var('type', 0); 43 44 if (!$confirm_id || !$type) 45 { 46 exit; 47 } 48 49 // Try and grab code for this id and session 50 $sql = 'SELECT code, seed 51 FROM ' . CONFIRM_TABLE . " 52 WHERE session_id = '" . $db->sql_escape($user->session_id) . "' 53 AND confirm_id = '" . $db->sql_escape($confirm_id) . "' 54 AND confirm_type = $type"; 55 $result = $db->sql_query($sql); 56 $row = $db->sql_fetchrow($result); 57 $db->sql_freeresult($result); 58 59 // If we have a row then grab data else create a new id 60 if (!$row) 61 { 62 exit; 63 } 64 65 if ($config['captcha_gd']) 66 { 67 include($phpbb_root_path . 'includes/captcha/captcha_gd.' . $phpEx); 68 } 69 else 70 { 71 include($phpbb_root_path . 'includes/captcha/captcha_non_gd.' . $phpEx); 72 } 73 74 $captcha = new captcha(); 75 $captcha->execute($row['code'], $row['seed']); 40 include($phpbb_root_path . 'includes/captcha/captcha_factory.' . $phpEx); 41 $captcha = phpbb_captcha_factory::get_instance($config['captcha_plugin']); 42 $captcha->init(request_var('type', 0)); 43 $captcha->execute(); 76 44 77 45 garbage_collection(); -
trunk/forum/includes/ucp/ucp_groups.php
r400 r702 3 3 * 4 4 * @package ucp 5 * @version $Id : ucp_groups.php 9067 2008-11-21 13:21:53Z Kellanved$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 42 42 { 43 43 case 'membership': 44 44 45 45 $this->page_title = 'UCP_USERGROUPS_MEMBER'; 46 46 … … 341 341 ); 342 342 343 $group_id_ary[] = $row['group_id'];343 $group_id_ary[] = (int) $row['group_id']; 344 344 } 345 345 $db->sql_freeresult($result); … … 415 415 $action = (isset($_POST['addusers'])) ? 'addusers' : request_var('action', ''); 416 416 $group_id = request_var('g', 0); 417 417 418 418 include($phpbb_root_path . 'includes/functions_display.' . $phpEx); 419 419 … … 439 439 trigger_error($user->lang['NOT_ALLOWED_MANAGE_GROUP'] . $return_page, E_USER_WARNING); 440 440 } 441 441 442 442 $group_name = $group_row['group_name']; 443 443 $group_type = $group_row['group_type']; 444 444 445 445 $avatar_img = (!empty($group_row['group_avatar'])) ? get_user_avatar($group_row['group_avatar'], $group_row['group_avatar_type'], $group_row['group_avatar_width'], $group_row['group_avatar_height'], 'GROUP_AVATAR') : '<img src="' . $phpbb_root_path . 'adm/images/no_avatar.gif" alt="" />'; 446 446 … … 451 451 'GROUP_DESC_DISP' => generate_text_for_display($group_row['group_desc'], $group_row['group_desc_uid'], $group_row['group_desc_bitfield'], $group_row['group_desc_options']), 452 452 'GROUP_TYPE' => $group_row['group_type'], 453 453 454 454 'AVATAR' => $avatar_img, 455 455 'AVATAR_IMAGE' => $avatar_img, … … 605 605 // group. This prevents existing group members being updated if no changes 606 606 // were made. 607 607 608 608 $group_attributes = array(); 609 $test_variables = array('rank', 'colour', 'avatar', 'avatar_type', 'avatar_width', 'avatar_height', 'receive_pm', 'legend', 'message_limit', 'max_recipients'); 610 foreach ($test_variables as $test) 611 { 612 if ($action == 'add' || (isset($submit_ary[$test]) && $group_row['group_' . $test] != $submit_ary[$test])) 609 $test_variables = array( 610 'rank' => 'int', 611 'colour' => 'string', 612 'avatar' => 'string', 613 'avatar_type' => 'int', 614 'avatar_width' => 'int', 615 'avatar_height' => 'int', 616 'receive_pm' => 'int', 617 'legend' => 'int', 618 'message_limit' => 'int', 619 'max_recipients'=> 'int', 620 ); 621 622 foreach ($test_variables as $test => $type) 623 { 624 if (isset($submit_ary[$test]) && ($action == 'add' || $group_row['group_' . $test] != $submit_ary[$test])) 613 625 { 626 settype($submit_ary[$test], $type); 614 627 $group_attributes['group_' . $test] = $group_row['group_' . $test] = $submit_ary[$test]; 615 628 } … … 676 689 $display_gallery = (isset($_POST['display_gallery'])) ? true : false; 677 690 678 if ($config['allow_avatar _local'] && $display_gallery)691 if ($config['allow_avatar'] && $config['allow_avatar_local'] && $display_gallery) 679 692 { 680 693 avatar_gallery($category, $avatar_select, 4); 681 694 } 682 683 $avatars_enabled = ($c an_upload || ($config['allow_avatar_local'] || $config['allow_avatar_remote'])) ? true : false;695 696 $avatars_enabled = ($config['allow_avatar'] && (($can_upload && ($config['allow_avatar_upload'] || $config['allow_avatar_remote_upload'])) || ($config['allow_avatar_local'] || $config['allow_avatar_remote']))) ? true : false; 684 697 685 698 $template->assign_vars(array( 686 699 'S_EDIT' => true, 687 700 'S_INCLUDE_SWATCH' => true, 688 'S_CAN_UPLOAD' => $can_upload, 689 'S_FORM_ENCTYPE' => ($can_upload) ? ' enctype="multipart/form-data"' : '', 701 'S_FORM_ENCTYPE' => ($config['allow_avatar'] && $can_upload && ($config['allow_avatar_upload'] || $config['allow_avatar_remote_upload'])) ? ' enctype="multipart/form-data"' : '', 690 702 'S_ERROR' => (sizeof($error)) ? true : false, 691 703 'S_SPECIAL_GROUP' => ($group_type == GROUP_SPECIAL) ? true : false, 692 704 'S_AVATARS_ENABLED' => $avatars_enabled, 693 'S_DISPLAY_GALLERY' => ($config['allow_avatar _local'] && !$display_gallery) ? true : false,705 'S_DISPLAY_GALLERY' => ($config['allow_avatar'] && $config['allow_avatar_local'] && !$display_gallery) ? true : false, 694 706 'S_IN_GALLERY' => ($config['allow_avatar_local'] && $display_gallery) ? true : false, 707 708 'S_UPLOAD_AVATAR_FILE' => ($config['allow_avatar'] && $config['allow_avatar_upload'] && $can_upload) ? true : false, 709 'S_UPLOAD_AVATAR_URL' => ($config['allow_avatar'] && $config['allow_avatar_remote_upload'] && $can_upload) ? true : false, 710 'S_LINK_AVATAR' => ($config['allow_avatar'] && $config['allow_avatar_remote']) ? true : false, 695 711 696 712 'ERROR_MSG' => (sizeof($error)) ? implode('<br />', $error) : '', … … 698 714 'GROUP_MESSAGE_LIMIT' => (isset($group_row['group_message_limit'])) ? $group_row['group_message_limit'] : 0, 699 715 'GROUP_MAX_RECIPIENTS' => (isset($group_row['group_max_recipients'])) ? $group_row['group_max_recipients'] : 0, 700 716 701 717 'GROUP_DESC' => $group_desc_data['text'], 702 718 'S_DESC_BBCODE_CHECKED' => $group_desc_data['allow_bbcode'], … … 840 856 841 857 'U_ACTION' => $this->u_action . "&g=$group_id", 858 'S_UCP_ACTION' => $this->u_action . "&g=$group_id", 842 859 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=ucp&field=usernames'), 843 860 )); … … 897 914 { 898 915 $start = 0; 899 916 900 917 do 901 918 { … … 949 966 } 950 967 968 // redirect to last screen 969 redirect($this->u_action . '&action=list&g=' . $group_id); 970 951 971 break; 952 972 … … 995 1015 } 996 1016 1017 // redirect to last screen 1018 redirect($this->u_action . '&action=list&g=' . $group_id); 1019 997 1020 break; 998 1021 … … 1028 1051 1029 1052 $default = request_var('default', 0); 1030 1053 1031 1054 if (confirm_box(true)) 1032 1055 { -
trunk/forum/includes/ucp/ucp_main.php
r400 r702 3 3 * 4 4 * @package ucp 5 * @version $Id : ucp_main.php 9136 2008-11-30 14:36:59Z acydburn$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 634 634 function assign_topiclist($mode = 'subscribed', $forbidden_forum_ary = array()) 635 635 { 636 global $user, $db, $template, $config, $ auth, $phpbb_root_path, $phpEx;636 global $user, $db, $template, $config, $cache, $auth, $phpbb_root_path, $phpEx; 637 637 638 638 $table = ($mode == 'subscribed') ? TOPICS_WATCH_TABLE : BOOKMARKS_TABLE; 639 639 $start = request_var('start', 0); 640 641 // Grab icons 642 $icons = $cache->obtain_icons(); 640 643 641 644 $sql_array = array( … … 777 780 topic_status($row, $replies, $unread_topic, $folder_img, $folder_alt, $topic_type); 778 781 779 $view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id"); 782 $view_topic_url_params = "f=$forum_id&t=$topic_id"; 783 $view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", $view_topic_url_params); 780 784 781 785 // Send vars to template … … 810 814 'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt), 811 815 'TOPIC_FOLDER_IMG_SRC' => $user->img($folder_img, $folder_alt, false, '', 'src'), 816 'TOPIC_FOLDER_IMG_ALT' => $user->lang[$folder_alt], 812 817 'TOPIC_ICON_IMG' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['img'] : '', 813 818 'TOPIC_ICON_IMG_WIDTH' => (!empty($icons[$row['icon_id']])) ? $icons[$row['icon_id']]['width'] : '', … … 819 824 'S_UNREAD_TOPIC' => $unread_topic, 820 825 821 'U_NEWEST_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id&view=unread") . '#unread',822 'U_LAST_POST' => $view_topic_url . '&p=' . $row['topic_last_post_id']. '#p' . $row['topic_last_post_id'],826 'U_NEWEST_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", $view_topic_url_params . '&view=unread') . '#unread', 827 'U_LAST_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", $view_topic_url_params . '&p=' . $row['topic_last_post_id']) . '#p' . $row['topic_last_post_id'], 823 828 'U_VIEW_TOPIC' => $view_topic_url, 824 829 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id), -
trunk/forum/includes/ucp/ucp_pm.php
r400 r702 2 2 /** 3 3 * @package ucp 4 * @version $Id : ucp_pm.php 8521 2008-04-21 13:20:13Z acydburn$4 * @version $Id$ 5 5 * @copyright (c) 2005 phpBB Group 6 6 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 120 120 if (!$auth->acl_get('u_sendpm')) 121 121 { 122 trigger_error('NO_AUTH_SEND_MESSAGE'); 122 // trigger_error('NO_AUTH_SEND_MESSAGE'); 123 $template->assign_vars(array( 124 'S_NO_AUTH_SEND_MESSAGE' => true, 125 'S_COMPOSE_PM_VIEW' => true, 126 )); 127 128 $tpl_file = 'ucp_pm_viewfolder'; 129 break; 123 130 } 124 131 -
trunk/forum/includes/ucp/ucp_pm_compose.php
r400 r702 3 3 * 4 4 * @package ucp 5 * @version $Id : ucp_pm_compose.php 9168 2008-12-03 16:48:06Z acydburn$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 47 47 $lastclick = request_var('lastclick', 0); 48 48 49 // Reply to all triggered (quote/reply) 50 $reply_to_all = request_var('reply_to_all', 0); 51 49 52 // Do NOT use request_var or specialchars here 50 53 $address_list = isset($_REQUEST['address_list']) ? $_REQUEST['address_list'] : array(); … … 85 88 redirect(append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm')); 86 89 } 90 91 // Since viewtopic.php language entries are used in several modes, 92 // we include the language file here 93 $user->add_lang('viewtopic'); 87 94 88 95 // Output PM_TO box if message composing … … 311 318 if (($action == 'reply' || $action == 'quote' || $action == 'quotepost') && !sizeof($address_list) && !$refresh && !$submit && !$preview) 312 319 { 313 if ($action == 'quotepost') 320 // Add the original author as the recipient if quoting a post or only replying and not having checked "reply to all" 321 if ($action == 'quotepost' || !$reply_to_all) 314 322 { 315 323 $address_list = array('u' => array($post['author_id'] => 'to')); … … 317 325 else 318 326 { 319 // We try to include every previously listed member from the TO Header 327 // We try to include every previously listed member from the TO Header - Reply to all 320 328 $address_list = rebuild_header(array('to' => $post['to_address'])); 321 329 … … 440 448 441 449 // If this is a quote/reply "to all"... we may increase the max_recpients to the number of original recipients 442 if (($action == 'reply' || $action == 'quote') && $max_recipients )450 if (($action == 'reply' || $action == 'quote') && $max_recipients && $reply_to_all) 443 451 { 444 452 // We try to include every previously listed member from the TO Header … … 632 640 if ($load && $drafts) 633 641 { 634 load_drafts(0, 0, $id );642 load_drafts(0, 0, $id, $action, $msg_id); 635 643 } 636 644 … … 747 755 if (!sizeof($error) && $preview) 748 756 { 749 $user->add_lang('viewtopic');750 757 $preview_message = $message_parser->format_display($enable_bbcode, $enable_urls, $enable_smilies, false); 751 758 … … 761 768 $parse_sig->bbcode_bitfield = $preview_signature_bitfield; 762 769 763 $parse_sig->format_display($ enable_bbcode, $enable_urls, $enable_smilies);770 $parse_sig->format_display($config['allow_sig_bbcode'], $config['allow_sig_links'], $config['allow_sig_smilies']); 764 771 $preview_signature = $parse_sig->message; 765 772 unset($parse_sig); … … 805 812 806 813 // Decode text for message display 807 $bbcode_uid = (($action == 'quote' || $action == 'forward') && !$preview && !$refresh && !sizeof($error)) ? $bbcode_uid : $message_parser->bbcode_uid;814 $bbcode_uid = (($action == 'quote' || $action == 'forward') && !$preview && !$refresh && (!sizeof($error) || (sizeof($error) && !$submit))) ? $bbcode_uid : $message_parser->bbcode_uid; 808 815 809 816 $message_parser->decode_message($bbcode_uid); … … 851 858 $forward_text[] = $user->lang['FWD_ORIGINAL_MESSAGE']; 852 859 $forward_text[] = sprintf($user->lang['FWD_SUBJECT'], censor_text($message_subject)); 853 $forward_text[] = sprintf($user->lang['FWD_DATE'], $user->format_date($message_time ));860 $forward_text[] = sprintf($user->lang['FWD_DATE'], $user->format_date($message_time, false, true)); 854 861 $forward_text[] = sprintf($user->lang['FWD_FROM'], $quote_username_text); 855 862 $forward_text[] = sprintf($user->lang['FWD_TO'], implode(', ', $fwd_to_field['to'])); … … 1040 1047 'SMILIES_STATUS' => ($smilies_status) ? $user->lang['SMILIES_ARE_ON'] : $user->lang['SMILIES_ARE_OFF'], 1041 1048 'URL_STATUS' => ($url_status) ? $user->lang['URL_IS_ON'] : $user->lang['URL_IS_OFF'], 1049 'MAX_FONT_SIZE' => (int) $config['max_post_font_size'], 1042 1050 'MINI_POST_IMG' => $user->img('icon_post_target', $user->lang['PM']), 1043 1051 'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '', … … 1125 1133 1126 1134 // Build usernames to add 1127 $usernames = (isset($_REQUEST['username'])) ? array(request_var('username', '', true)) : array(); 1135 $usernames = request_var('username', '', true); 1136 $usernames = (empty($usernames)) ? array() : array($usernames); 1137 1128 1138 $username_list = request_var('username_list', '', true); 1129 1139 if ($username_list) … … 1139 1149 global $refresh, $submit, $preview; 1140 1150 1141 $refresh = $preview =true;1151 $refresh = true; 1142 1152 $submit = false; 1153 1154 // Preview is only true if there was also a message entered 1155 if (request_var('message', '')) 1156 { 1157 $preview = true; 1158 } 1143 1159 } 1144 1160 -
trunk/forum/includes/ucp/ucp_pm_options.php
r400 r702 3 3 * 4 4 * @package ucp 5 * @version $Id : ucp_pm_options.php 8479 2008-03-29 00:22:48Z naderman$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 109 109 $db->sql_query($sql); 110 110 $msg = $user->lang['FOLDER_ADDED']; 111 } 112 else 113 { 114 $msg = $user->lang['FOLDER_NAME_EMPTY']; 111 115 } 112 116 } … … 634 638 { 635 639 global $template; 640 global $module; 641 642 $exclude = array(); 643 644 if (!$module->loaded('zebra', 'friends')) 645 { 646 $exclude[RULE_IS_FRIEND] = true; 647 } 648 649 if (!$module->loaded('zebra', 'foes')) 650 { 651 $exclude[RULE_IS_FOE] = true; 652 } 636 653 637 654 $s_rule_options = ''; … … 640 657 foreach ($check_ary as $value => $_check) 641 658 { 659 if (isset($exclude[$value])) 660 { 661 continue; 662 } 642 663 $s_rule_options .= '<option value="' . $value . '"' . (($value == $rule_option) ? ' selected="selected"' : '') . '>' . $rule_lang[$value] . '</option>'; 643 664 } -
trunk/forum/includes/ucp/ucp_pm_viewfolder.php
r400 r702 3 3 * 4 4 * @package ucp 5 * @version $Id : ucp_pm_viewfolder.php 8795 2008-08-29 11:50:01Z Kellanved$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 66 66 $mark_options = array('mark_important', 'delete_marked'); 67 67 68 // Minimise edits 69 if (!$auth->acl_get('u_pm_delete') && $key = array_search('delete_marked', $mark_options)) 70 { 71 unset($mark_options[$key]); 72 } 73 68 74 $s_mark_options = ''; 69 75 foreach ($mark_options as $mark_option) … … 116 122 if ($folder_id == PRIVMSGS_OUTBOX || $folder_id == PRIVMSGS_SENTBOX) 117 123 { 118 $recipient_list = $address = array(); 119 120 foreach ($folder_info['rowset'] as $message_id => $row) 121 { 122 $address[$message_id] = rebuild_header(array('to' => $row['to_address'], 'bcc' => $row['bcc_address'])); 123 $_save = array('u', 'g'); 124 foreach ($_save as $save) 125 { 126 if (isset($address[$message_id][$save]) && sizeof($address[$message_id][$save])) 127 { 128 foreach (array_keys($address[$message_id][$save]) as $ug_id) 129 { 130 $recipient_list[$save][$ug_id] = array('name' => $user->lang['NA'], 'colour' => ''); 131 } 132 } 133 } 134 } 135 136 $_types = array('u', 'g'); 137 foreach ($_types as $ug_type) 138 { 139 if (!empty($recipient_list[$ug_type])) 140 { 141 if ($ug_type == 'u') 142 { 143 $sql = 'SELECT user_id as id, username as name, user_colour as colour 144 FROM ' . USERS_TABLE . ' 145 WHERE '; 146 } 147 else 148 { 149 $sql = 'SELECT group_id as id, group_name as name, group_colour as colour, group_type 150 FROM ' . GROUPS_TABLE . ' 151 WHERE '; 152 } 153 $sql .= $db->sql_in_set(($ug_type == 'u') ? 'user_id' : 'group_id', array_map('intval', array_keys($recipient_list[$ug_type]))); 154 155 $result = $db->sql_query($sql); 156 157 while ($row = $db->sql_fetchrow($result)) 158 { 159 if ($ug_type == 'g') 160 { 161 $row['name'] = ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['name']] : $row['name']; 162 } 163 164 $recipient_list[$ug_type][$row['id']] = array('name' => $row['name'], 'colour' => $row['colour']); 165 } 166 $db->sql_freeresult($result); 167 } 168 } 169 170 foreach ($address as $message_id => $adr_ary) 171 { 172 foreach ($adr_ary as $type => $id_ary) 173 { 174 foreach ($id_ary as $ug_id => $_id) 175 { 176 if ($type == 'u') 177 { 178 $address_list[$message_id][] = get_username_string('full', $ug_id, $recipient_list[$type][$ug_id]['name'], $recipient_list[$type][$ug_id]['colour']); 179 } 180 else 181 { 182 $user_colour = ($recipient_list[$type][$ug_id]['colour']) ? ' style="font-weight: bold; color:#' . $recipient_list[$type][$ug_id]['colour'] . '"' : ''; 183 $link = '<a href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&g=' . $ug_id) . '"' . $user_colour . '>'; 184 $address_list[$message_id][] = $link . $recipient_list[$type][$ug_id]['name'] . (($link) ? '</a>' : ''); 185 } 186 } 187 } 188 } 189 unset($recipient_list, $address); 124 $address_list = get_recipient_strings($folder_info['rowset']); 190 125 } 191 192 $data = array();193 126 194 127 foreach ($folder_info['pm_list'] as $message_id) … … 268 201 { 269 202 // Build Recipient List if in outbox/sentbox 270 $address = array(); 203 204 $address_temp = $address = $data = array(); 205 271 206 if ($folder_id == PRIVMSGS_OUTBOX || $folder_id == PRIVMSGS_SENTBOX) 272 207 { 273 208 foreach ($folder_info['rowset'] as $message_id => $row) 274 209 { 275 $address[$message_id] = rebuild_header(array('to' => $row['to_address'], 'bcc' => $row['bcc_address'])); 210 $address_temp[$message_id] = rebuild_header(array('to' => $row['to_address'], 'bcc' => $row['bcc_address'])); 211 $address[$message_id] = array(); 276 212 } 277 213 } … … 297 233 foreach ($_types as $ug_type) 298 234 { 299 if (isset($address [$message_id][$ug_type]) && sizeof($address[$message_id][$ug_type]))235 if (isset($address_temp[$message_id][$ug_type]) && sizeof($address_temp[$message_id][$ug_type])) 300 236 { 237 if (!isset($address[$message_id][$ug_type])) 238 { 239 $address[$message_id][$ug_type] = array(); 240 } 301 241 if ($ug_type == 'u') 302 242 { … … 311 251 WHERE '; 312 252 } 313 $sql .= $db->sql_in_set(($ug_type == 'u') ? 'user_id' : 'group_id', array_map('intval', array_keys($address [$message_id][$ug_type])));253 $sql .= $db->sql_in_set(($ug_type == 'u') ? 'user_id' : 'group_id', array_map('intval', array_keys($address_temp[$message_id][$ug_type]))); 314 254 315 255 $result = $db->sql_query($sql); … … 317 257 while ($info_row = $db->sql_fetchrow($result)) 318 258 { 319 $address[$message_id][$ug_type][$address [$message_id][$ug_type][$info_row['id']]][] = $info_row['name'];320 unset($address [$message_id][$ug_type][$info_row['id']]);259 $address[$message_id][$ug_type][$address_temp[$message_id][$ug_type][$info_row['id']]][] = $info_row['name']; 260 unset($address_temp[$message_id][$ug_type][$info_row['id']]); 321 261 } 322 262 $db->sql_freeresult($result); … … 324 264 } 325 265 266 // There is the chance that all recipients of the message got deleted. To avoid creating 267 // exports without recipients, we add a bogus "undisclosed recipient". 268 if (!(isset($address[$message_id]['g']) && sizeof($address[$message_id]['g'])) && 269 !(isset($address[$message_id]['u']) && sizeof($address[$message_id]['u']))) 270 { 271 $address[$message_id]['u'] = array(); 272 $address[$message_id]['u']['to'] = array(); 273 $address[$message_id]['u']['to'][] = $user->lang['UNDISCLOSED_RECIPIENT']; 274 } 275 326 276 decode_message($message_row['message_text'], $message_row['bbcode_uid']); 327 277 328 278 $data[] = array( 329 279 'subject' => censor_text($row['message_subject']), 330 280 'sender' => $row['username'], 331 'date' => $user->format_date($row['message_time']), 281 // ISO 8601 date. For PHP4 we are able to hardcode the timezone because $user->format_date() does not set it. 282 'date' => $user->format_date($row['message_time'], (PHP_VERSION >= 5) ? 'c' : "Y-m-d\TH:i:s+00:00", true), 332 283 'to' => ($folder_id == PRIVMSGS_OUTBOX || $folder_id == PRIVMSGS_SENTBOX) ? $address[$message_id] : '', 333 284 'message' => $message_row['message_text'] … … 457 408 { 458 409 $sort_by_text = array('t' => $user->lang['POST_TIME'], 's' => $user->lang['SUBJECT']); 459 $sort_by_sql = array('t' => 'p.m sg_id', 's' => 'p.message_subject');410 $sort_by_sql = array('t' => 'p.message_time', 's' => array('p.message_subject', 'p.message_time')); 460 411 } 461 412 else 462 413 { 463 414 $sort_by_text = array('a' => $user->lang['AUTHOR'], 't' => $user->lang['POST_TIME'], 's' => $user->lang['SUBJECT']); 464 $sort_by_sql = array('a' => 'u.username_clean', 't' => 'p.msg_id', 's' => 'p.message_subject');415 $sort_by_sql = array('a' => array('u.username_clean', 'p.message_time'), 't' => 'p.message_time', 's' => array('p.message_subject', 'p.message_time')); 465 416 } 466 417 … … 503 454 'TOTAL_MESSAGES' => (($pm_count == 1) ? $user->lang['VIEW_PM_MESSAGE'] : sprintf($user->lang['VIEW_PM_MESSAGES'], $pm_count)), 504 455 505 'POST_IMG' => (!$auth->acl_get('u_sendpm')) ? $user->img('button_topic_locked', 'P M_LOCKED') : $user->img('button_pm_new', 'POST_PM'),506 507 ' L_NO_MESSAGES' => (!$auth->acl_get('u_sendpm')) ? $user->lang['POST_PM_LOCKED'] : $user->lang['NO_MESSAGES'],456 'POST_IMG' => (!$auth->acl_get('u_sendpm')) ? $user->img('button_topic_locked', 'POST_PM_LOCKED') : $user->img('button_pm_new', 'POST_NEW_PM'), 457 458 'S_NO_AUTH_SEND_MESSAGE' => !$auth->acl_get('u_sendpm'), 508 459 509 460 'S_SELECT_SORT_DIR' => $s_sort_dir, … … 512 463 'S_TOPIC_ICONS' => ($config['enable_pm_icons']) ? true : false, 513 464 514 'U_POST_NEW_TOPIC' => ($auth->acl_get('u_sendpm')) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=compose') : '', 465 'U_POST_NEW_TOPIC' => ($auth->acl_get('u_sendpm')) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=compose') : '', 515 466 'S_PM_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&mode=view&action=view_folder&f=$folder_id" . (($start !== 0) ? "&start=$start" : '')), 516 467 )); … … 532 483 533 484 // Select the sort order 534 $ sql_sort_order = $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'ASC' : 'DESC');485 $direction = ($sort_dir == 'd') ? 'ASC' : 'DESC'; 535 486 $sql_start = max(0, $pm_count - $sql_limit - $start); 536 487 } … … 538 489 { 539 490 // Select the sort order 540 $ sql_sort_order = $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'DESC' : 'ASC');491 $direction = ($sort_dir == 'd') ? 'DESC' : 'ASC'; 541 492 $sql_start = $start; 493 } 494 495 // Sql sort order 496 if (is_array($sort_by_sql[$sort_key])) 497 { 498 $sql_sort_order = implode(' ' . $direction . ', ', $sort_by_sql[$sort_key]) . ' ' . $direction; 499 } 500 else 501 { 502 $sql_sort_order = $sort_by_sql[$sort_key] . ' ' . $direction; 542 503 } 543 504 -
trunk/forum/includes/ucp/ucp_pm_viewmessage.php
r400 r702 3 3 * 4 4 * @package ucp 5 * @version $Id : ucp_pm_viewmessage.php 9174 2008-12-04 19:58:42Z toonarmy$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 30 30 $folder_id = (int) $folder_id; 31 31 $author_id = (int) $message_row['author_id']; 32 $view = request_var('view', ''); 32 33 33 34 // Not able to view message, it was deleted by the sender … … 169 170 $url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm'); 170 171 172 // Number of "to" recipients 173 $num_recipients = (int) preg_match_all('/:?(u|g)_([0-9]+):?/', $message_row['to_address'], $match); 174 171 175 $template->assign_vars(array( 172 176 'MESSAGE_AUTHOR_FULL' => get_username_string('full', $author_id, $user_info['username'], $user_info['user_colour'], $user_info['username']), … … 179 183 'AUTHOR_AVATAR' => (isset($user_info['avatar'])) ? $user_info['avatar'] : '', 180 184 'AUTHOR_JOINED' => $user->format_date($user_info['user_regdate']), 181 'AUTHOR_POSTS' => ( !empty($user_info['user_posts'])) ? $user_info['user_posts'] : '',185 'AUTHOR_POSTS' => (int) $user_info['user_posts'], 182 186 'AUTHOR_FROM' => (!empty($user_info['user_from'])) ? $user_info['user_from'] : '', 183 187 … … 190 194 'QUOTE_IMG' => $user->img('icon_post_quote', $user->lang['POST_QUOTE_PM']), 191 195 'REPLY_IMG' => $user->img('button_pm_reply', $user->lang['POST_REPLY_PM']), 196 'REPORT_IMG' => $user->img('icon_post_report', 'REPORT_PM'), 192 197 'EDIT_IMG' => $user->img('icon_post_edit', $user->lang['POST_EDIT_PM']), 193 198 'MINI_POST_IMG' => $user->img('icon_post_target', $user->lang['PM']), 194 199 195 'SENT_DATE' => $user->format_date($message_row['message_time']),200 'SENT_DATE' => ($view == 'print') ? $user->format_date($message_row['message_time'], false, true) : $user->format_date($message_row['message_time']), 196 201 'SUBJECT' => $message_row['message_subject'], 197 202 'MESSAGE' => $message, … … 210 215 'U_DELETE' => ($auth->acl_get('u_pm_delete')) ? "$url&mode=compose&action=delete&f=$folder_id&p=" . $message_row['msg_id'] : '', 211 216 'U_EMAIL' => $user_info['email'], 217 'U_REPORT' => ($config['allow_pm_report']) ? append_sid("{$phpbb_root_path}report.$phpEx", "pm=" . $message_row['msg_id']) : '', 212 218 'U_QUOTE' => ($auth->acl_get('u_sendpm') && $author_id != ANONYMOUS) ? "$url&mode=compose&action=quote&f=$folder_id&p=" . $message_row['msg_id'] : '', 213 219 'U_EDIT' => (($message_row['message_time'] > time() - ($config['pm_edit_time'] * 60) || !$config['pm_edit_time']) && $folder_id == PRIVMSGS_OUTBOX && $auth->acl_get('u_pm_edit')) ? "$url&mode=compose&action=edit&f=$folder_id&p=" . $message_row['msg_id'] : '', 214 220 'U_POST_REPLY_PM' => ($auth->acl_get('u_sendpm') && $author_id != ANONYMOUS) ? "$url&mode=compose&action=reply&f=$folder_id&p=" . $message_row['msg_id'] : '', 221 'U_POST_REPLY_ALL' => ($auth->acl_get('u_sendpm') && $author_id != ANONYMOUS) ? "$url&mode=compose&action=reply&f=$folder_id&reply_to_all=1&p=" . $message_row['msg_id'] : '', 215 222 'U_PREVIOUS_PM' => "$url&f=$folder_id&p=" . $message_row['msg_id'] . "&view=previous", 216 223 'U_NEXT_PM' => "$url&f=$folder_id&p=" . $message_row['msg_id'] . "&view=next", 224 225 'U_PM_ACTION' => $url . '&mode=compose&f=' . $folder_id . '&p=' . $message_row['msg_id'], 217 226 218 227 'S_HAS_ATTACHMENTS' => (sizeof($attachments)) ? true : false, … … 220 229 'S_AUTHOR_DELETED' => ($author_id == ANONYMOUS) ? true : false, 221 230 'S_SPECIAL_FOLDER' => in_array($folder_id, array(PRIVMSGS_NO_BOX, PRIVMSGS_OUTBOX)), 231 'S_PM_RECIPIENTS' => $num_recipients, 222 232 223 233 'U_PRINT_PM' => ($config['print_pm'] && $auth->acl_get('u_pm_printpm')) ? "$url&f=$folder_id&p=" . $message_row['msg_id'] . "&view=print" : '', … … 287 297 if ($row) 288 298 { 289 $user_row['online'] = (time() - $update_time < $row['online_time'] && ($row['viewonline'] )) ? true : false;299 $user_row['online'] = (time() - $update_time < $row['online_time'] && ($row['viewonline'] || $auth->acl_get('u_viewonline'))) ? true : false; 290 300 } 291 301 } -
trunk/forum/includes/ucp/ucp_prefs.php
r400 r702 3 3 * 4 4 * @package ucp 5 * @version $Id : ucp_prefs.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 … … 283 283 'S_DISABLE_CENSORS' => $data['wordcensor'], 284 284 285 'S_CHANGE_CENSORS' => ($auth->acl_get('u_chgcensors') ) ? true : false,285 'S_CHANGE_CENSORS' => ($auth->acl_get('u_chgcensors') && $config['allow_nocensors']) ? true : false, 286 286 287 287 'S_TOPIC_SORT_DAYS' => $s_limit_topic_days, -
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) -
trunk/forum/includes/ucp/ucp_register.php
r400 r702 3 3 * 4 4 * @package ucp 5 * @version $Id : ucp_register.php 8782 2008-08-23 17:20:55Z acydburn$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 38 38 include($phpbb_root_path . 'includes/functions_profile_fields.' . $phpEx); 39 39 40 $confirm_id = request_var('confirm_id', '');41 40 $coppa = (isset($_REQUEST['coppa'])) ? ((!empty($_REQUEST['coppa'])) ? 1 : 0) : false; 42 41 $agreed = (!empty($_POST['agreed'])) ? 1 : 0; … … 54 53 } 55 54 56 57 55 if ($change_lang || $user_lang != $config['default_lang']) 58 56 { … … 69 67 } 70 68 71 $user->lang_name = $ lang = $use_lang;69 $user->lang_name = $user_lang = $use_lang; 72 70 $user->lang = array(); 71 $user->data['user_lang'] = $user->lang_name; 73 72 $user->add_lang(array('common', 'ucp')); 74 73 } … … 80 79 } 81 80 81 82 82 $cp = new custom_profile(); 83 83 84 84 $error = $cp_data = $cp_error = array(); 85 86 85 87 86 if (!$agreed || ($coppa === false && $config['coppa_enable']) || ($coppa && !$config['coppa_enable'])) … … 90 89 $add_coppa = ($coppa !== false) ? '&coppa=' . $coppa : ''; 91 90 92 $s_hidden_fields = ($confirm_id) ? array('confirm_id' => $confirm_id) : array(); 91 $s_hidden_fields = array( 92 'change_lang' => $change_lang, 93 ); 93 94 94 95 // If we change the language, we want to pass on some more possible parameter. … … 100 101 'email' => strtolower(request_var('email', '')), 101 102 'email_confirm' => strtolower(request_var('email_confirm', '')), 102 'confirm_code' => request_var('confirm_code', ''),103 'confirm_id' => request_var('confirm_id', ''),104 103 'lang' => $user->lang_name, 105 104 'tz' => request_var('tz', (float) $config['board_timezone']), 106 105 )); 107 } 106 107 } 108 109 // Checking amount of available languages 110 $sql = 'SELECT lang_id 111 FROM ' . LANG_TABLE; 112 $result = $db->sql_query($sql); 113 114 $lang_row = array(); 115 while ($row = $db->sql_fetchrow($result)) 116 { 117 $lang_row[] = $row; 118 } 119 $db->sql_freeresult($result); 108 120 109 121 if ($coppa === false && $config['coppa_enable']) … … 114 126 115 127 $template->assign_vars(array( 128 'S_LANG_OPTIONS' => (sizeof($lang_row) > 1) ? language_select($user_lang) : '', 116 129 'L_COPPA_NO' => sprintf($user->lang['UCP_COPPA_BEFORE'], $coppa_birthday), 117 130 'L_COPPA_YES' => sprintf($user->lang['UCP_COPPA_ON_AFTER'], $coppa_birthday), … … 128 141 { 129 142 $template->assign_vars(array( 143 'S_LANG_OPTIONS' => (sizeof($lang_row) > 1) ? language_select($user_lang) : '', 130 144 'L_TERMS_OF_USE' => sprintf($user->lang['TERMS_OF_USE_CONTENT'], $config['sitename'], generate_board_url()), 131 145 … … 137 151 ); 138 152 } 153 unset($lang_row); 139 154 140 155 $this->tpl_name = 'ucp_agreement'; 141 156 return; 142 157 } 143 158 159 160 // The CAPTCHA kicks in here. We can't help that the information gets lost on language change. 161 if ($config['enable_confirm']) 162 { 163 include($phpbb_root_path . 'includes/captcha/captcha_factory.' . $phpEx); 164 $captcha =& phpbb_captcha_factory::get_instance($config['captcha_plugin']); 165 $captcha->init(CONFIRM_REG); 166 } 144 167 145 168 // Try to manually determine the timezone and adjust the dst if the server date/time complies with the default setting +/- 1 … … 168 191 'email' => strtolower(request_var('email', '')), 169 192 'email_confirm' => strtolower(request_var('email_confirm', '')), 170 'confirm_code' => request_var('confirm_code', ''),171 193 'lang' => basename(request_var('lang', $user->lang_name)), 172 194 'tz' => request_var('tz', (float) $timezone), … … 188 210 array('email')), 189 211 'email_confirm' => array('string', false, 6, 60), 190 'confirm_code' => array('string', !$config['enable_confirm'], 5, 8),191 212 'tz' => array('num', false, -14, 14), 192 213 'lang' => array('match', false, '#^[a-z_\-]{2,}$#i'), 193 214 )); 215 194 216 if (!check_form_key('ucp_register')) 195 217 { 196 218 $error[] = $user->lang['FORM_INVALID']; 197 219 } 220 198 221 // Replace "error" strings with their real, localised form 199 222 $error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error); 200 223 224 if ($config['enable_confirm']) 225 { 226 $vc_response = $captcha->validate($data); 227 if ($vc_response !== false) 228 { 229 $error[] = $vc_response; 230 } 231 232 if ($config['max_reg_attempts'] && $captcha->get_attempt_count() > $config['max_reg_attempts']) 233 { 234 $error[] = $user->lang['TOO_MANY_REGISTERS']; 235 } 236 } 237 201 238 // DNSBL check 202 239 if ($config['check_dnsbl']) … … 210 247 // validate custom profile fields 211 248 $cp->submit_cp_field('register', $user->get_iso_lang_id(), $cp_data, $error); 212 213 // Visual Confirmation handling214 $wrong_confirm = false;215 if ($config['enable_confirm'])216 {217 if (!$confirm_id)218 {219 $error[] = $user->lang['CONFIRM_CODE_WRONG'];220 $wrong_confirm = true;221 }222 else223 {224 $sql = 'SELECT code225 FROM ' . CONFIRM_TABLE . "226 WHERE confirm_id = '" . $db->sql_escape($confirm_id) . "'227 AND session_id = '" . $db->sql_escape($user->session_id) . "'228 AND confirm_type = " . CONFIRM_REG;229 $result = $db->sql_query($sql);230 $row = $db->sql_fetchrow($result);231 $db->sql_freeresult($result);232 233 if ($row)234 {235 if (strcasecmp($row['code'], $data['confirm_code']) === 0)236 {237 $sql = 'DELETE FROM ' . CONFIRM_TABLE . "238 WHERE confirm_id = '" . $db->sql_escape($confirm_id) . "'239 AND session_id = '" . $db->sql_escape($user->session_id) . "'240 AND confirm_type = " . CONFIRM_REG;241 $db->sql_query($sql);242 }243 else244 {245 $error[] = $user->lang['CONFIRM_CODE_WRONG'];246 $wrong_confirm = true;247 }248 }249 else250 {251 $error[] = $user->lang['CONFIRM_CODE_WRONG'];252 $wrong_confirm = true;253 }254 }255 }256 249 257 250 if (!sizeof($error)) … … 327 320 ); 328 321 322 if ($config['new_member_post_limit']) 323 { 324 $user_row['user_new'] = 1; 325 } 326 329 327 // Register user... 330 328 $user_id = user_add($user_row, $cp_data); … … 334 332 { 335 333 trigger_error('NO_USER', E_USER_ERROR); 334 } 335 336 // Okay, captcha, your job is done. 337 if ($config['enable_confirm'] && isset($captcha)) 338 { 339 $captcha->reset(); 336 340 } 337 341 … … 441 445 $s_hidden_fields['coppa'] = $coppa; 442 446 } 447 448 if ($config['enable_confirm']) 449 { 450 $s_hidden_fields = array_merge($s_hidden_fields, $captcha->get_hidden_fields()); 451 } 443 452 $s_hidden_fields = build_hidden_fields($s_hidden_fields); 444 445 453 $confirm_image = ''; 446 454 447 455 // Visual Confirmation - Show images 448 449 456 if ($config['enable_confirm']) 450 457 { 451 if ($change_lang) 452 { 453 $str = '&change_lang=' . $change_lang; 454 $sql = 'SELECT code 455 FROM ' . CONFIRM_TABLE . " 456 WHERE confirm_id = '" . $db->sql_escape($confirm_id) . "' 457 AND session_id = '" . $db->sql_escape($user->session_id) . "' 458 AND confirm_type = " . CONFIRM_REG; 459 $result = $db->sql_query($sql); 460 if (!$row = $db->sql_fetchrow($result)) 461 { 462 $confirm_id = ''; 463 } 464 $db->sql_freeresult($result); 465 } 466 else 467 { 468 $str = ''; 469 } 470 if (!$change_lang || !$confirm_id) 471 { 472 $user->confirm_gc(CONFIRM_REG); 473 474 $sql = 'SELECT COUNT(session_id) AS attempts 475 FROM ' . CONFIRM_TABLE . " 476 WHERE session_id = '" . $db->sql_escape($user->session_id) . "' 477 AND confirm_type = " . CONFIRM_REG; 478 $result = $db->sql_query($sql); 479 $attempts = (int) $db->sql_fetchfield('attempts'); 480 $db->sql_freeresult($result); 481 482 if ($config['max_reg_attempts'] && $attempts > $config['max_reg_attempts']) 483 { 484 trigger_error('TOO_MANY_REGISTERS'); 485 } 486 487 $code = gen_rand_string(mt_rand(5, 8)); 488 $confirm_id = md5(unique_id($user->ip)); 489 $seed = hexdec(substr(unique_id(), 4, 10)); 490 491 // compute $seed % 0x7fffffff 492 $seed -= 0x7fffffff * floor($seed / 0x7fffffff); 493 494 $sql = 'INSERT INTO ' . CONFIRM_TABLE . ' ' . $db->sql_build_array('INSERT', array( 495 'confirm_id' => (string) $confirm_id, 496 'session_id' => (string) $user->session_id, 497 'confirm_type' => (int) CONFIRM_REG, 498 'code' => (string) $code, 499 'seed' => (int) $seed) 500 ); 501 $db->sql_query($sql); 502 } 503 $confirm_image = '<img src="' . append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=confirm&id=' . $confirm_id . '&type=' . CONFIRM_REG . $str) . '" alt="" title="" />'; 504 $s_hidden_fields .= '<input type="hidden" name="confirm_id" value="' . $confirm_id . '" />'; 458 $template->assign_vars(array( 459 'CAPTCHA_TEMPLATE' => $captcha->get_template(), 460 )); 505 461 } 506 462 … … 525 481 'EMAIL' => $data['email'], 526 482 'EMAIL_CONFIRM' => $data['email_confirm'], 527 'CONFIRM_IMG' => $confirm_image, 528 529 'L_CONFIRM_EXPLAIN' => sprintf($user->lang['CONFIRM_EXPLAIN'], '<a href="mailto:' . htmlspecialchars($config['board_contact']) . '">', '</a>'), 483 530 484 'L_REG_COND' => $l_reg_cond, 531 485 'L_USERNAME_EXPLAIN' => sprintf($user->lang[$config['allow_name_chars'] . '_EXPLAIN'], $config['min_name_chars'], $config['max_name_chars']), … … 534 488 'S_LANG_OPTIONS' => language_select($data['lang']), 535 489 'S_TZ_OPTIONS' => tz_select($data['tz']), 536 'S_CONFIRM_CODE' => ($config['enable_confirm']) ? true : false, 490 'S_CONFIRM_REFRESH' => ($config['enable_confirm'] && $config['confirm_refresh']) ? true : false, 491 'S_REGISTRATION' => true, 537 492 'S_COPPA' => $coppa, 538 493 'S_HIDDEN_FIELDS' => $s_hidden_fields, 539 494 'S_UCP_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register'), 540 ) 541 ); 495 )); 542 496 543 497 // -
trunk/forum/includes/ucp/ucp_remind.php
r400 r702 3 3 * 4 4 * @package ucp 5 * @version $Id : ucp_remind.php 8977 2008-10-06 14:04:33Z acydburn$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 39 39 $sql = 'SELECT user_id, username, user_permissions, user_email, user_jabber, user_notify_type, user_type, user_lang, user_inactive_reason 40 40 FROM ' . USERS_TABLE . " 41 WHERE user_email = '" . $db->sql_escape($email) . "'41 WHERE user_email_hash = '" . $db->sql_escape(phpbb_email_hash($email)) . "' 42 42 AND username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'"; 43 43 $result = $db->sql_query($sql); -
trunk/forum/includes/ucp/ucp_resend.php
r400 r702 3 3 * 4 4 * @package ucp 5 * @version $Id : ucp_resend.php 8479 2008-03-29 00:22:48Z naderman$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 46 46 $sql = 'SELECT user_id, group_id, username, user_email, user_type, user_lang, user_actkey, user_inactive_reason 47 47 FROM ' . USERS_TABLE . " 48 WHERE user_email = '" . $db->sql_escape($email) . "'48 WHERE user_email_hash = '" . $db->sql_escape(phpbb_email_hash($email)) . "' 49 49 AND username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'"; 50 50 $result = $db->sql_query($sql); … … 134 134 $messenger->im($row['user_jabber'], $row['username']); 135 135 136 $messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']); 137 $messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']); 138 $messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']); 139 $messenger->headers('X-AntiAbuse: User IP - ' . $user->ip); 140 136 141 $messenger->assign_vars(array( 137 142 'USERNAME' => htmlspecialchars_decode($user_row['username']), … … 147 152 meta_refresh(3, append_sid("{$phpbb_root_path}index.$phpEx")); 148 153 149 $message = ($config['require_activation'] == USER_ACTIVATION_ADMIN) ? $user->lang['AC IVATION_EMAIL_SENT_ADMIN'] : $user->lang['ACTIVATION_EMAIL_SENT'];154 $message = ($config['require_activation'] == USER_ACTIVATION_ADMIN) ? $user->lang['ACTIVATION_EMAIL_SENT_ADMIN'] : $user->lang['ACTIVATION_EMAIL_SENT']; 150 155 $message .= '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.$phpEx") . '">', '</a>'); 151 156 trigger_error($message); -
trunk/forum/includes/ucp/ucp_zebra.php
r400 r702 3 3 * 4 4 * @package ucp 5 * @version $Id : ucp_zebra.php 8479 2008-03-29 00:22:48Z naderman$5 * @version $Id$ 6 6 * @copyright (c) 2005 phpBB Group 7 7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License … … 53 53 if (confirm_box(true)) 54 54 { 55 // Remove users 56 if (!empty($data['usernames'])) 57 { 58 $sql = 'DELETE FROM ' . ZEBRA_TABLE . ' 59 WHERE user_id = ' . $user->data['user_id'] . ' 60 AND ' . $db->sql_in_set('zebra_id', $data['usernames']); 61 $db->sql_query($sql); 62 63 $updated = true; 64 } 65 66 // Add users 55 67 if ($data['add']) 56 68 { … … 125 137 $user_id_ary[] = $row['user_id']; 126 138 } 139 else if ($row['user_id'] != ANONYMOUS) 140 { 141 $error[] = $user->lang['NOT_ADDED_' . $l_mode . '_BOTS']; 142 } 127 143 else 128 144 { … … 183 199 } 184 200 } 185 }186 else if (sizeof($data['usernames']))187 {188 // Force integer values189 $data['usernames'] = array_map('intval', $data['usernames']);190 191 $sql = 'DELETE FROM ' . ZEBRA_TABLE . '192 WHERE user_id = ' . $user->data['user_id'] . '193 AND ' . $db->sql_in_set('zebra_id', $data['usernames']);194 $db->sql_query($sql);195 196 $updated = true;197 201 } 198 202
Note:
See TracChangeset
for help on using the changeset viewer.