diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2006-11-24 14:59:26 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2006-11-24 14:59:26 +0000 |
commit | d529f78adb85698c9382ad29e4583f309eaf850a (patch) | |
tree | 58f973b636dac28e93c10274fc58b3bff777afc8 /phpBB/includes | |
parent | a0c3a326bd0e0162217589c57af90e7b477e4e88 (diff) | |
download | forums-d529f78adb85698c9382ad29e4583f309eaf850a.tar forums-d529f78adb85698c9382ad29e4583f309eaf850a.tar.gz forums-d529f78adb85698c9382ad29e4583f309eaf850a.tar.bz2 forums-d529f78adb85698c9382ad29e4583f309eaf850a.tar.xz forums-d529f78adb85698c9382ad29e4583f309eaf850a.zip |
rather large update, most important things done:
- implemented provided patch/diff file for bug #5350 (Highway of Life) with some tiny changes and alterations
- more username/colour changes/fixes
- added a note about PM rule-dependant message removals so the user is not wondering too much if he can't remember his rules. :)
- some column changes to fix unicode issues
- bugfixes
git-svn-id: file:///svn/phpbb/trunk@6650 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes')
33 files changed, 194 insertions, 104 deletions
diff --git a/phpBB/includes/acp/acp_ban.php b/phpBB/includes/acp/acp_ban.php index a4e860b7bc..44ab731072 100644 --- a/phpBB/includes/acp/acp_ban.php +++ b/phpBB/includes/acp/acp_ban.php @@ -126,7 +126,7 @@ class acp_ban AND u.user_id = b.ban_userid AND b.ban_userid <> 0 AND u.user_id <> ' . ANONYMOUS . ' - ORDER BY u.username ASC'; + ORDER BY u.username_clean ASC'; break; case 'ip': diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php index fb58c33897..a418f279e8 100644 --- a/phpBB/includes/acp/acp_groups.php +++ b/phpBB/includes/acp/acp_groups.php @@ -54,6 +54,12 @@ class acp_groups { trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action), E_USER_WARNING); } + + // Check if the user is allowed to manage this group if set to founder only. + if ($user->data['user_type'] != USER_FOUNDER && $group_row['group_founder_manage']) + { + trigger_error($user->lang['NOT_ALLOWED_MANAGE_GROUP'] . adm_back_link($this->u_action), E_USER_WARNING); + } } // Which page? @@ -263,13 +269,22 @@ class acp_groups $delete = request_var('delete', ''); $submit_ary = array( - 'colour' => request_var('group_colour', ''), - 'rank' => request_var('group_rank', 0), - 'receive_pm' => isset($_REQUEST['group_receive_pm']) ? 1 : 0, - 'legend' => isset($_REQUEST['group_legend']) ? 1 : 0, - 'message_limit' => request_var('group_message_limit', 0) + 'colour' => request_var('group_colour', ''), + 'rank' => request_var('group_rank', 0), + 'receive_pm' => isset($_REQUEST['group_receive_pm']) ? 1 : 0, + 'legend' => isset($_REQUEST['group_legend']) ? 1 : 0, + 'message_limit' => request_var('group_message_limit', 0), ); + if ($user->data['user_type'] == USER_FOUNDER) + { + $submit_ary['founder_manage'] = isset($_REQUEST['group_founder_manage']) ? 1 : 0; + } + else + { + $submit_ary['founder_manage'] = 0; + } + if (!empty($_FILES['uploadfile']['tmp_name']) || $data['uploadurl'] || $data['remotelink']) { $data['width'] = request_var('width', ''); @@ -329,7 +344,7 @@ class acp_groups // were made. $group_attributes = array(); - $test_variables = array('rank', 'colour', 'avatar', 'avatar_type', 'avatar_width', 'avatar_height', 'receive_pm', 'legend', 'message_limit'); + $test_variables = array('rank', 'colour', 'avatar', 'avatar_type', 'avatar_width', 'avatar_height', 'receive_pm', 'legend', 'message_limit', 'founder_manage'); foreach ($test_variables as $test) { if (isset($submit_ary[$test]) && ($action == 'add' || $group_row['group_' . $test] != $submit_ary[$test])) @@ -483,16 +498,19 @@ class acp_groups 'S_SPECIAL_GROUP' => ($group_type == GROUP_SPECIAL) ? true : false, 'S_DISPLAY_GALLERY' => ($config['allow_avatar_local'] && !$display_gallery) ? true : false, 'S_IN_GALLERY' => ($config['allow_avatar_local'] && $display_gallery) ? true : false, + 'S_USER_FOUNDER' => ($user->data['user_type'] == USER_FOUNDER) ? true : false, 'ERROR_MSG' => (sizeof($error)) ? implode('<br />', $error) : '', 'GROUP_NAME' => ($group_type == GROUP_SPECIAL) ? $user->lang['G_' . $group_name] : $group_name, 'GROUP_INTERNAL_NAME' => $group_name, 'GROUP_DESC' => $group_desc_data['text'], 'GROUP_RECEIVE_PM' => (isset($group_row['group_receive_pm']) && $group_row['group_receive_pm']) ? ' checked="checked"' : '', + 'GROUP_FOUNDER_MANAGE' => (isset($group_row['group_founder_manage']) && $group_row['group_founder_manage']) ? ' checked="checked"' : '', 'GROUP_LEGEND' => (isset($group_row['group_legend']) && $group_row['group_legend']) ? ' checked="checked"' : '', 'GROUP_MESSAGE_LIMIT' => (isset($group_row['group_message_limit'])) ? $group_row['group_message_limit'] : 0, 'GROUP_COLOUR' => (isset($group_row['group_colour'])) ? $group_row['group_colour'] : '', + 'S_DESC_BBCODE_CHECKED' => $group_desc_data['allow_bbcode'], 'S_DESC_URLS_CHECKED' => $group_desc_data['allow_urls'], 'S_DESC_SMILIES_CHECKED'=> $group_desc_data['allow_smilies'], diff --git a/phpBB/includes/acp/acp_inactive.php b/phpBB/includes/acp/acp_inactive.php index 2834d25181..68eeaab5b4 100755 --- a/phpBB/includes/acp/acp_inactive.php +++ b/phpBB/includes/acp/acp_inactive.php @@ -132,7 +132,7 @@ class acp_inactive // Sorting $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'], 365 => $user->lang['1_YEAR']); $sort_by_text = array('i' => $user->lang['SORT_INACTIVE'], 'j' => $user->lang['SORT_REG_DATE'], 'l' => $user->lang['SORT_LAST_VISIT'], 'r' => $user->lang['SORT_REASON'], 'u' => $user->lang['SORT_USERNAME']); - $sort_by_sql = array('i' => 'user_inactive_time', 'j' => 'user_regdate', 'l' => 'user_lastvisit', 'r' => 'user_inactive_reason', 'u' => 'username'); + $sort_by_sql = array('i' => 'user_inactive_time', 'j' => 'user_regdate', 'l' => 'user_lastvisit', 'r' => 'user_inactive_reason', 'u' => 'username_clean'); $s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = ''; gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param); diff --git a/phpBB/includes/acp/acp_logs.php b/phpBB/includes/acp/acp_logs.php index d233d7c885..211b932115 100644 --- a/phpBB/includes/acp/acp_logs.php +++ b/phpBB/includes/acp/acp_logs.php @@ -68,7 +68,7 @@ class acp_logs // Sorting $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'], 365 => $user->lang['1_YEAR']); $sort_by_text = array('u' => $user->lang['SORT_USERNAME'], 't' => $user->lang['SORT_DATE'], 'i' => $user->lang['SORT_IP'], 'o' => $user->lang['SORT_ACTION']); - $sort_by_sql = array('u' => 'u.username', 't' => 'l.log_time', 'i' => 'l.log_ip', 'o' => 'l.log_operation'); + $sort_by_sql = array('u' => 'u.username_clean', 't' => 'l.log_time', 'i' => 'l.log_ip', 'o' => 'l.log_operation'); $s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = ''; gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param); @@ -127,8 +127,8 @@ class acp_logs } $template->assign_block_vars('log', array( - 'USERNAME' => $row['username'], - 'REPORTEE_USERNAME' => ($row['reportee_username'] && $row['user_id'] != $row['reportee_id']) ? $row['reportee_username'] : '', + 'USERNAME' => $row['username_full'], + 'REPORTEE_USERNAME' => ($row['reportee_username'] && $row['user_id'] != $row['reportee_id']) ? $row['reportee_username_full'] : '', 'IP' => $row['ip'], 'DATE' => $user->format_date($row['time']), diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php index a321057fa2..d7e327e4d3 100644 --- a/phpBB/includes/acp/acp_main.php +++ b/phpBB/includes/acp/acp_main.php @@ -324,7 +324,7 @@ class acp_main foreach ($log_data as $row) { $template->assign_block_vars('log', array( - 'USERNAME' => $row['username'], + 'USERNAME' => $row['username_full'], 'IP' => $row['ip'], 'DATE' => $user->format_date($row['time']), 'ACTION' => $row['action']) diff --git a/phpBB/includes/acp/acp_modules.php b/phpBB/includes/acp/acp_modules.php index 72b87c3b92..c426e4607d 100644 --- a/phpBB/includes/acp/acp_modules.php +++ b/phpBB/includes/acp/acp_modules.php @@ -265,7 +265,7 @@ class acp_modules // Category/not category? $is_cat = (!$module_data['module_basename']) ? true : false; - // Get module informations + // Get module information $module_infos = $this->get_module_infos(); // Build name options @@ -488,7 +488,7 @@ class acp_modules } /** - * Get available module informations from module files + * Get available module information from module files */ function get_module_infos($module = '', $module_class = false) { diff --git a/phpBB/includes/acp/acp_profile.php b/phpBB/includes/acp/acp_profile.php index 9ce7f3ed92..8bfe2b8b36 100644 --- a/phpBB/includes/acp/acp_profile.php +++ b/phpBB/includes/acp/acp_profile.php @@ -936,7 +936,7 @@ class acp_profile $field_id = request_var('field_id', 0); - // Collect all informations, if something is going wrong, abort the operation + // Collect all information, if something is going wrong, abort the operation $profile_sql = $profile_lang = $empty_lang = $profile_lang_fields = array(); $default_lang_id = $lang_defs['iso'][$config['default_lang']]; diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index b4103da463..314514b8e2 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -949,7 +949,7 @@ class acp_users // Sorting $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'], 365 => $user->lang['1_YEAR']); $sort_by_text = array('u' => $user->lang['SORT_USERNAME'], 't' => $user->lang['SORT_DATE'], 'i' => $user->lang['SORT_IP'], 'o' => $user->lang['SORT_ACTION']); - $sort_by_sql = array('u' => 'l.username', 't' => 'l.log_time', 'i' => 'l.log_ip', 'o' => 'l.log_operation'); + $sort_by_sql = array('u' => 'u.username_clean', 't' => 'l.log_time', 'i' => 'l.log_ip', 'o' => 'l.log_operation'); $s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = ''; gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param); @@ -977,7 +977,7 @@ class acp_users foreach ($log_data as $row) { $template->assign_block_vars('log', array( - 'USERNAME' => $row['username'], + 'USERNAME' => $row['username_full'], 'IP' => $row['ip'], 'DATE' => $user->format_date($row['time']), 'ACTION' => nl2br($row['action']), @@ -1185,7 +1185,7 @@ class acp_users case 'prefs': $data = array( - 'dateformat' => request_var('dateformat', $user_row['user_dateformat']), + 'dateformat' => request_var('dateformat', $user_row['user_dateformat'], true), 'lang' => request_var('lang', $user_row['user_lang']), 'tz' => request_var('tz', (float) $user_row['user_timezone']), 'style' => request_var('style', $user_row['user_style']), @@ -1843,6 +1843,19 @@ class acp_users trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); } + // Check the founder only entry for this group to make sure everything is well + $sql = 'SELECT group_founder_manage + FROM ' . GROUPS_TABLE . ' + WHERE group_id = ' . $group_id; + $result = $db->sql_query($sql); + $founder_manage = (int) $db->sql_fetchfield('group_founder_manage'); + $db->sql_freeresult($result); + + if ($user->data['user_type'] != USER_FOUNDER && $founder_manage) + { + trigger_error($user->lang['NOT_ALLOWED_MANAGE_GROUP'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); + } + // Add user/s to group if ($error = group_user_add($group_id, $user_id)) { @@ -1877,7 +1890,7 @@ class acp_users $db->sql_freeresult($result); // Select box for other groups - $sql = 'SELECT group_id, group_name, group_type + $sql = 'SELECT group_id, group_name, group_type, group_founder_manage FROM ' . GROUPS_TABLE . ' ' . ((sizeof($id_ary)) ? 'WHERE ' . $db->sql_in_set('group_id', $id_ary, true) : '') . ' ORDER BY group_type DESC, group_name ASC'; @@ -1891,6 +1904,12 @@ class acp_users continue; } + // Do not display those groups not allowed to be managed + if ($user->data['user_type'] != USER_FOUNDER && $row['group_founder_manage']) + { + continue; + } + $s_group_options .= '<option' . (($row['group_type'] == GROUP_SPECIAL) ? ' class="sep"' : '') . ' value="' . $row['group_id'] . '">' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</option>'; } $db->sql_freeresult($result); diff --git a/phpBB/includes/acp/auth.php b/phpBB/includes/acp/auth.php index bc17e4b4ae..35b0cd29e2 100644 --- a/phpBB/includes/acp/auth.php +++ b/phpBB/includes/acp/auth.php @@ -293,7 +293,7 @@ class auth_admin extends auth $sql = 'SELECT user_id as ug_id, username as ug_name FROM ' . USERS_TABLE . ' WHERE ' . $db->sql_in_set('user_id', array_keys($hold_ary)) . ' - ORDER BY username ASC'; + ORDER BY username_clean ASC'; } else { @@ -606,7 +606,7 @@ class auth_admin extends auth $sql = 'SELECT user_id, username FROM ' . USERS_TABLE . ' WHERE ' . $db->sql_in_set('user_id', $auth_ary['users']) . ' - ORDER BY username'; + ORDER BY username_clean ASC'; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) diff --git a/phpBB/includes/bbcode.php b/phpBB/includes/bbcode.php index 409aab18e4..9536abddd3 100644 --- a/phpBB/includes/bbcode.php +++ b/phpBB/includes/bbcode.php @@ -221,7 +221,7 @@ class bbcode { $this->bbcode_cache[$bbcode_id] = array( 'preg' => array( - '#\[img:$uid\](.*?)\[/img:$uid\]#s' => str_replace('$2', '[ img ]', $this->bbcode_tpl('url', $bbcode_id)), + '#\[img:$uid\](.*?)\[/img:$uid\]#s' => str_replace('$2', '[ img ]', $this->bbcode_tpl('url', $bbcode_id, true)), ) ); } @@ -300,7 +300,7 @@ class bbcode { $this->bbcode_cache[$bbcode_id] = array( 'preg' => array( - '#\[flash=([0-9]+),([0-9]+):$uid\](.*?)\[/flash:$uid\]#' => str_replace('$1', '$3', str_replace('$2', '[ flash ]', $this->bbcode_tpl('url', $bbcode_id))) + '#\[flash=([0-9]+),([0-9]+):$uid\](.*?)\[/flash:$uid\]#' => str_replace('$1', '$3', str_replace('$2', '[ flash ]', $this->bbcode_tpl('url', $bbcode_id, true))) ) ); } @@ -381,7 +381,7 @@ class bbcode /** * Return bbcode template */ - function bbcode_tpl($tpl_name, $bbcode_id = -1) + function bbcode_tpl($tpl_name, $bbcode_id = -1, $skip_bitfield_check = false) { if (empty($bbcode_hardtpl)) { @@ -403,7 +403,7 @@ class bbcode $template_bitfield = new bitfield($this->template_bitfield); } - if ($bbcode_id != -1 && !$template_bitfield->get($bbcode_id)) + if ($bbcode_id != -1 && !$template_bitfield->get($bbcode_id) && !$skip_bitfield_check) { return (isset($bbcode_hardtpl[$tpl_name])) ? $bbcode_hardtpl[$tpl_name] : false; } diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index dac39e5940..001702a39e 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -1865,7 +1865,7 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa } } - // The result parameter is always an array, holding the relevant informations... + // The result parameter is always an array, holding the relevant information... if ($result['status'] == LOGIN_SUCCESS) { $redirect = request_var('redirect', "{$phpbb_root_path}index.$phpEx"); @@ -2676,7 +2676,7 @@ function get_backtrace() $trace['file'] = substr($trace['file'], 1); $args = array(); - // If include/require/include_once is not called, do not show arguments - they may contain sensible informations + // If include/require/include_once is not called, do not show arguments - they may contain sensible information if (!in_array($trace['function'], array('include', 'require', 'include_once'))) { unset($trace['args']); @@ -2773,11 +2773,12 @@ function truncate_string($string, $max_length = 60, $allow_reply = true) * @param int $user_id The users id * @param string $username The users name * @param string $username_colour The users colour -* @param string $guest_username optional field to specify the guest username. It will be used in favor of the GUEST language variable then. +* @param string $guest_username optional parameter to specify the guest username. It will be used in favor of the GUEST language variable then. +* @param string $custom_profile_url optional parameter to specify a profile url. The user id get appended to this url as &u={user_id} * * @return string A string consisting of what is wanted based on $mode. */ -function get_username_string($mode, $user_id, $username, $username_colour = '', $guest_username = false) +function get_username_string($mode, $user_id, $username, $username_colour = '', $guest_username = false, $custom_profile_url = false) { global $phpbb_root_path, $phpEx, $user; @@ -2796,7 +2797,8 @@ function get_username_string($mode, $user_id, $username, $username_colour = '', // Only show the link if not anonymous if ($user_id && $user_id != ANONYMOUS) { - $profile_url = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . (int) $user_id); + $profile_url = ($custom_profile_url !== false) ? $custom_profile_url : append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile'); + $profile_url .= '&u=' . (int) $user_id; $full_string = '<a href="' . $profile_url . '"' . (($username_colour) ? ' style="color: ' . $username_colour . '; font-weight: bold;"' : '') . '>' . $username . '</a>'; } else @@ -3116,7 +3118,7 @@ function page_header($page_title = '', $display_online_list = true) $reading_sql . ((!$config['load_online_guests']) ? ' AND s.session_user_id <> ' . ANONYMOUS : '') . ' AND u.user_id = s.session_user_id - ORDER BY u.username ASC, s.session_ip ASC'; + ORDER BY u.username_clean ASC, s.session_ip ASC'; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index 283053ca6d..c00a2cd3d9 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -160,7 +160,7 @@ function make_forum_select($select_id = false, $ignore_id = false, $ignore_acl = if ($return_array) { - // Include some more informations... + // Include some more information... $selected = (is_array($select_id)) ? ((in_array($row['forum_id'], $select_id)) ? true : false) : (($row['forum_id'] == $select_id) ? true : false); $forum_list[$row['forum_id']] = array_merge(array('padding' => $padding, 'selected' => $selected), $row); } @@ -471,7 +471,7 @@ function move_posts($post_ids, $topic_id, $auto_sync = true) sync('forum', 'forum_id', $forum_ids, true); } - // Update posted informations + // Update posted information update_posted_info($topic_ids); } @@ -942,7 +942,7 @@ function delete_topic_shadows($max_age, $forum_id = '', $auto_sync = true) } /** -* Update/Sync posted informations for topics +* Update/Sync posted information for topics */ function update_posted_info(&$topic_ids) { @@ -2144,7 +2144,7 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id case 'user': $log_type = LOG_USERS; - $sql_forum = 'AND l.reportee_id = ' . intval($user_id); + $sql_forum = 'AND l.reportee_id = ' . (int) $user_id; break; case 'users': @@ -2161,7 +2161,7 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id return; } - $sql = "SELECT l.*, u.username + $sql = "SELECT l.*, u.username, u.user_colour FROM " . LOG_TABLE . " l, " . USERS_TABLE . " u WHERE l.log_type = $log_type AND u.user_id = l.user_id @@ -2186,10 +2186,15 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id $log[$i] = array( 'id' => $row['log_id'], - 'reportee_id' => $row['reportee_id'], - 'reportee_username' => '', + + 'reportee_id' => $row['reportee_id'], + 'reportee_username' => '', + 'reportee_username_full'=> '', + 'user_id' => $row['user_id'], - 'username' => '<a href="' . $profile_url . '&u=' . $row['user_id'] . '">' . $row['username'] . '</a>', + 'username' => $row['username'], + 'username_full' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour'], false, $profile_url), + 'ip' => $row['log_ip'], 'time' => $row['log_time'], 'forum_id' => $row['forum_id'], @@ -2272,21 +2277,31 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id } } - if ($reportee_id_list) + if (sizeof($reportee_id_list)) { $reportee_id_list = array_unique($reportee_id_list); $reportee_names_list = array(); - if (!function_exists('user_get_id_name')) + $sql = 'SELECT user_id, username, user_colour + FROM ' . USERS_TABLE . ' + WHERE ' . $db->sql_in_set('user_id', $reportee_id_list); + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) { - include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx); + $reportee_names_list[$row['user_id']] = $row; } - - user_get_id_name($reportee_id_list, $reportee_names_list); + $db->sql_freeresult($result); foreach ($log as $key => $row) { - $log[$key]['reportee_username'] = (isset($reportee_names_list[$row['reportee_id']])) ? '<a href="' . $profile_url . '&u=' . $row['reportee_id'] . '">' . $reportee_names_list[$row['reportee_id']] . '</a>' : false; + if (!isset($reportee_names_list[$row['reportee_id']])) + { + continue; + } + + $log[$key]['reportee_username'] = $reportee_names_list[$row['reportee_id']]['username']; + $log[$key]['reportee_username_full'] = get_username_string('full', $row['reportee_id'], $reportee_names_list[$row['reportee_id']]['username'], $reportee_names_list[$row['reportee_id']]['user_colour'], false, $profile_url); } } @@ -2385,7 +2400,7 @@ function view_warned_users(&$users, &$user_count, $limit = 0, $offset = 0, $limi { global $db; - $sql = 'SELECT user_id, username, user_warnings, user_last_warning + $sql = 'SELECT user_id, username, user_colour, user_warnings, user_last_warning FROM ' . USERS_TABLE . ' WHERE user_warnings > 0 ' . (($limit_days) ? "AND user_last_warning >= $limit_days" : '') . " diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 258652e07c..663b6bfe19 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -712,7 +712,7 @@ function display_attachments($forum_id, $blockname, &$attachment_data, &$update_ $extensions = $cache->obtain_attach_extensions(); } - // Look for missing attachment informations... + // Look for missing attachment information... $attach_ids = array(); foreach ($attachment_data as $pos => $attachment) { diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php index 273a74edef..4625ba47d0 100644 --- a/phpBB/includes/functions_messenger.php +++ b/phpBB/includes/functions_messenger.php @@ -987,7 +987,7 @@ class smtp_class { fputs($this->socket, $command . "\r\n"); - (!$private_info) ? $this->add_backtrace("# $command") : $this->add_backtrace('# Ommitting sensitive Informations'); + (!$private_info) ? $this->add_backtrace("# $command") : $this->add_backtrace('# Ommitting sensitive information'); // We could put additional code here } diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 37d8c0cd2b..23460c8dec 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -96,8 +96,8 @@ function generate_smilies($mode, $forum_id) } /** -* Update Post Informations (First/Last Post in topic/forum) -* Should be used instead of sync() if only the last post informations are out of sync... faster +* Update Post Information (First/Last Post in topic/forum) +* Should be used instead of sync() if only the last post information are out of sync... faster * * @param string $type Can be forum|topic * @param mixed $ids topic/forum ids @@ -1388,11 +1388,11 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u $subject = truncate_string($subject); $data['topic_title'] = truncate_string($data['topic_title']); - // Collect some basic informations about which tables and which rows to update/insert + // Collect some basic information about which tables and which rows to update/insert $sql_data = array(); $poster_id = ($mode == 'edit') ? $data['poster_id'] : (int) $user->data['user_id']; - // Collect Informations + // Collect Information switch ($post_mode) { case 'post': diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index 685a2964ac..1107f824be 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -120,7 +120,7 @@ function get_folder($user_id, $folder_id = false) $folder = array(); - // Get folder informations + // Get folder information $sql = 'SELECT folder_id, COUNT(msg_id) as num_messages, SUM(pm_unread) as num_unread FROM ' . PRIVMSGS_TO_TABLE . " WHERE user_id = $user_id @@ -242,7 +242,7 @@ function clean_sentbox($num_sentbox_messages) } /** -* Check Rule against Message Informations +* Check Rule against Message Information */ function check_rule(&$rules, &$rule_row, &$message_row, $user_id) { @@ -297,7 +297,7 @@ function check_rule(&$rules, &$rule_row, &$message_row, $user_id) $auth2 = new auth(); $auth2->acl($userdata); - if (!$auth2->acl_get('a_') && !$auth->acl_get('m_') && !$auth2->acl_getf_global('m_')) + if (!$auth2->acl_get('a_') && !$auth2->acl_get('m_') && !$auth2->acl_getf_global('m_')) { return array('action' => $rule_row['rule_action'], 'pm_unread' => $message_row['pm_unread'], 'pm_marked' => $message_row['pm_marked']); } @@ -429,7 +429,7 @@ function place_pm_into_folder(&$global_privmsgs_rules, $release = false) $row['author_in_group'] = $memberships[$row['user_id']]; } - // Check Rule - this should be very quick since we have all informations we need + // Check Rule - this should be very quick since we have all information we need $is_match = false; foreach ($user_rules as $rule_row) { @@ -515,11 +515,12 @@ function place_pm_into_folder(&$global_privmsgs_rules, $release = false) // Do not change the order of processing // The number of queries needed to be executed here highly depends on the defined rules and are // only gone through if new messages arrive. - $num_not_moved = 0; + $num_not_moved = $num_removed = 0; // Delete messages if (sizeof($delete_ids)) { + $num_removed = sizeof($delete_ids); delete_pm($user_id, $delete_ids, PRIVMSGS_NO_BOX); } @@ -694,7 +695,10 @@ function place_pm_into_folder(&$global_privmsgs_rules, $release = false) $user->data['user_unread_privmsg'] -= $num_unread; } - return $num_not_moved; + return array( + 'not_moved' => $num_not_moved, + 'deleted' => $num_removed, + ); } /** @@ -911,7 +915,7 @@ function delete_pm($user_id, $msg_ids, $folder_id) return false; } - // Get PM Informations for later deleting + // Get PM Information for later deleting $sql = 'SELECT msg_id, pm_unread, pm_new FROM ' . PRIVMSGS_TO_TABLE . ' WHERE ' . $db->sql_in_set('msg_id', array_map('intval', $msg_ids)) . " @@ -952,7 +956,7 @@ function delete_pm($user_id, $msg_ids, $folder_id) $db->sql_query($sql); // Set delete flag for those intended to receive the PM - // We do not remove the message actually, to retain some basic informations (sent time for example) + // We do not remove the message actually, to retain some basic information (sent time for example) $sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . ' SET pm_deleted = 1 WHERE ' . $db->sql_in_set('msg_id', array_keys($delete_rows)); @@ -962,7 +966,7 @@ function delete_pm($user_id, $msg_ids, $folder_id) } else { - // Delete Private Message Informations + // Delete private message data $sql = 'DELETE FROM ' . PRIVMSGS_TO_TABLE . " WHERE user_id = $user_id AND folder_id = $folder_id @@ -1058,7 +1062,7 @@ function rebuild_header($check_ary) } /** -* Print out/assign recipient informations +* Print out/assign recipient information */ function write_pm_addresses($check_ary, $author_id, $plaintext = false) { @@ -1248,11 +1252,11 @@ function submit_pm($mode, $subject, &$data, $update_message, $put_in_outbox = tr $current_time = time(); - // Collect some basic informations about which tables and which rows to update/insert + // Collect some basic information about which tables and which rows to update/insert $sql_data = array(); $root_level = 0; - // Recipient Informations + // Recipient Information $recipients = $to = $bcc = array(); if ($mode != 'edit') diff --git a/phpBB/includes/functions_upload.php b/phpBB/includes/functions_upload.php index a7a76cf526..ff32e4447d 100644 --- a/phpBB/includes/functions_upload.php +++ b/phpBB/includes/functions_upload.php @@ -9,7 +9,7 @@ */ /** -* Responsible for holding all file relevant informations, as well as doing file-specific operations. +* Responsible for holding all file relevant information, as well as doing file-specific operations. * The {@link fileupload fileupload class} can be used to upload several files, each of them being this object to operate further on. * @package phpBB3 */ diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 0664ab45ec..514cd26d48 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -408,7 +408,7 @@ function user_delete($mode, $user_id, $post_username = false) AND folder_id = ' . PRIVMSGS_NO_BOX; $db->sql_query($sql); - // Delete all to-informations + // Delete all to-information $sql = 'DELETE FROM ' . PRIVMSGS_TO_TABLE . ' WHERE user_id = ' . $user_id; $db->sql_query($sql); @@ -1529,10 +1529,12 @@ function group_create(&$group_id, $type, $name, $desc, $group_attributes, $allow 'group_receive_pm' => 'int', 'group_legend' => 'int', 'group_message_limit' => 'int', + + 'group_founder_manage' => 'int', ); // Those are group-only attributes - $group_only_ary = array('group_receive_pm', 'group_legend', 'group_message_limit'); + $group_only_ary = array('group_receive_pm', 'group_legend', 'group_message_limit', 'group_founder_manage'); // Check data if (!utf8_strlen($name) || utf8_strlen($name) > 40) @@ -1719,7 +1721,7 @@ function group_delete($group_id, $group_name = false) /** * Add user(s) to group * -* @return false if no errors occurred, else the user lang string for the relevant error, for example 'NO_USER' +* @return mixed false if no errors occurred, else the user lang string for the relevant error, for example 'NO_USER' */ function group_user_add($group_id, $user_id_ary = false, $username_ary = false, $group_name = false, $default = false, $leader = 0, $pending = 0, $group_attributes = false) { diff --git a/phpBB/includes/mcp/mcp_forum.php b/phpBB/includes/mcp/mcp_forum.php index b277fb0a46..bf9ef5280d 100644 --- a/phpBB/includes/mcp/mcp_forum.php +++ b/phpBB/includes/mcp/mcp_forum.php @@ -114,7 +114,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info) $replies = ($auth->acl_get('m_approve', $forum_id)) ? $row['topic_replies_real'] : $row['topic_replies']; - // Get folder img, topic status/type related informations + // Get folder img, topic status/type related information $folder_img = $folder_alt = $topic_type = ''; topic_status($row, $replies, false, $folder_img, $folder_alt, $topic_type); diff --git a/phpBB/includes/mcp/mcp_front.php b/phpBB/includes/mcp/mcp_front.php index 5c4e39bfc4..acfedb583f 100644 --- a/phpBB/includes/mcp/mcp_front.php +++ b/phpBB/includes/mcp/mcp_front.php @@ -134,7 +134,7 @@ function mcp_front_view($id, $mode, $action) $global_id = $forum_list[0]; $sql = $db->sql_build_query('SELECT', array( - 'SELECT' => 'r.report_time, p.post_id, p.post_subject, u.username, u.user_id, t.topic_id, t.topic_title, f.forum_id, f.forum_name', + 'SELECT' => 'r.report_time, p.post_id, p.post_subject, u.username, u.user_colour, u.user_id, t.topic_id, t.topic_title, f.forum_id, f.forum_name', 'FROM' => array( REPORTS_TABLE => 'r', @@ -176,11 +176,14 @@ function mcp_front_view($id, $mode, $action) 'U_MCP_TOPIC' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'f=' . $row['forum_id'] . '&t=' . $row['topic_id'] . "&i=$id&mode=topic_view"), 'U_FORUM' => (!$global_topic) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']) : '', 'U_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $row['forum_id'] . '&t=' . $row['topic_id']), - 'U_REPORTER' => ($row['user_id'] == ANONYMOUS) ? '' : append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['user_id']), + + 'REPORTER_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']), + 'REPORTER' => get_username_string('username', $row['user_id'], $row['username'], $row['user_colour']), + 'REPORTER_COLOUR' => get_username_string('colour', $row['user_id'], $row['username'], $row['user_colour']), + 'U_REPORTER' => get_username_string('profile', $row['user_id'], $row['username'], $row['user_colour']), 'FORUM_NAME' => (!$global_topic) ? $row['forum_name'] : $user->lang['GLOBAL_ANNOUNCEMENT'], 'TOPIC_TITLE' => $row['topic_title'], - 'REPORTER' => ($row['user_id'] == ANONYMOUS) ? $user->lang['GUEST'] : $row['username'], 'SUBJECT' => ($row['post_subject']) ? $row['post_subject'] : $user->lang['NO_SUBJECT'], 'REPORT_TIME' => $user->format_date($row['report_time'])) ); @@ -218,7 +221,7 @@ function mcp_front_view($id, $mode, $action) foreach ($log as $row) { $template->assign_block_vars('log', array( - 'USERNAME' => $row['username'], + 'USERNAME' => $row['username_full'], 'IP' => $row['ip'], 'TIME' => $user->format_date($row['time']), 'ACTION' => $row['action'], diff --git a/phpBB/includes/mcp/mcp_logs.php b/phpBB/includes/mcp/mcp_logs.php index f9cf7d27df..44acc10174 100755 --- a/phpBB/includes/mcp/mcp_logs.php +++ b/phpBB/includes/mcp/mcp_logs.php @@ -102,7 +102,7 @@ class mcp_logs // Sorting $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'], 365 => $user->lang['1_YEAR']); $sort_by_text = array('u' => $user->lang['SORT_USERNAME'], 't' => $user->lang['SORT_DATE'], 'i' => $user->lang['SORT_IP'], 'o' => $user->lang['SORT_ACTION']); - $sort_by_sql = array('u' => 'u.username', 't' => 'l.log_time', 'i' => 'l.log_ip', 'o' => 'l.log_operation'); + $sort_by_sql = array('u' => 'u.username_clean', 't' => 'l.log_time', 'i' => 'l.log_ip', 'o' => 'l.log_operation'); $s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = ''; gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param); @@ -146,7 +146,7 @@ class mcp_logs } $template->assign_block_vars('log', array( - 'USERNAME' => $row['username'], + 'USERNAME' => $row['username_full'], 'IP' => $row['ip'], 'DATE' => $user->format_date($row['time']), 'ACTION' => $row['action'], diff --git a/phpBB/includes/mcp/mcp_notes.php b/phpBB/includes/mcp/mcp_notes.php index 302ace9755..e681ebab96 100755 --- a/phpBB/includes/mcp/mcp_notes.php +++ b/phpBB/includes/mcp/mcp_notes.php @@ -161,7 +161,7 @@ class mcp_notes $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'], 365 => $user->lang['1_YEAR']); $sort_by_text = array('a' => $user->lang['SORT_USERNAME'], 'b' => $user->lang['SORT_DATE'], 'c' => $user->lang['SORT_IP'], 'd' => $user->lang['SORT_ACTION']); - $sort_by_sql = array('a' => 'u.username', 'b' => 'l.log_time', 'c' => 'l.log_ip', 'd' => 'l.log_operation'); + $sort_by_sql = array('a' => 'u.username_clean', 'b' => 'l.log_time', 'c' => 'l.log_ip', 'd' => 'l.log_operation'); $s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = ''; gen_sort_selects($limit_days, $sort_by_text, $st, $sk, $sd, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param); @@ -181,7 +181,7 @@ class mcp_notes foreach ($log_data as $row) { $template->assign_block_vars('usernotes', array( - 'REPORT_BY' => $row['username'], + 'REPORT_BY' => $row['username_full'], 'REPORT_AT' => $user->format_date($row['time']), 'ACTION' => $row['action'], 'IP' => $row['ip'], diff --git a/phpBB/includes/mcp/mcp_post.php b/phpBB/includes/mcp/mcp_post.php index 21ca7c11c3..b2b0ceb419 100644 --- a/phpBB/includes/mcp/mcp_post.php +++ b/phpBB/includes/mcp/mcp_post.php @@ -159,7 +159,7 @@ function mcp_post_details($id, $mode, $action) foreach ($log_data as $row) { $template->assign_block_vars('usernotes', array( - 'REPORT_BY' => $row['username'], + 'REPORT_BY' => $row['username_full'], 'REPORT_AT' => $user->format_date($row['time']), 'ACTION' => $row['action'], 'ID' => $row['id']) diff --git a/phpBB/includes/mcp/mcp_reports.php b/phpBB/includes/mcp/mcp_reports.php index 0b5f29a4f6..709d685e88 100755 --- a/phpBB/includes/mcp/mcp_reports.php +++ b/phpBB/includes/mcp/mcp_reports.php @@ -64,7 +64,7 @@ class mcp_reports // closed reports are accessed by report id $report_id = request_var('r', 0); - $sql = 'SELECT r.post_id, r.user_id, r.report_closed, report_time, r.report_text, rr.reason_title, rr.reason_description, u.username + $sql = 'SELECT r.post_id, r.user_id, r.report_closed, report_time, r.report_text, rr.reason_title, rr.reason_description, u.username, u.user_colour FROM ' . REPORTS_TABLE . ' r, ' . REPORTS_REASONS_TABLE . ' rr, ' . USERS_TABLE . ' u WHERE ' . (($report_id) ? 'r.report_id = ' . $report_id : "r.post_id = $post_id AND r.report_closed = 0") . ' AND rr.reason_id = r.reason_id @@ -136,7 +136,6 @@ class mcp_reports 'U_MCP_WARN_REPORTER' => ($auth->acl_getf_global('m_warn')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&mode=warn_user&u=' . $report['user_id']) : '', 'U_MCP_WARN_USER' => ($auth->acl_getf_global('m_warn')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&mode=warn_user&u=' . $post_info['user_id']) : '', 'U_VIEW_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&p=' . $post_info['post_id'] . '#p' . $post_info['post_id']), - 'U_VIEW_REPORTER_PROFILE' => ($report['user_id'] != ANONYMOUS) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $report['user_id']) : '', 'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&t=' . $post_info['topic_id']), 'EDIT_IMG' => $user->img('icon_post_edit', $user->lang['EDIT_POST']), @@ -146,7 +145,6 @@ class mcp_reports 'REPORTED_IMG' => $user->img('icon_topic_reported', $user->lang['POST_REPORTED']), 'REPORT_REASON_TITLE' => $reason['title'], 'REPORT_REASON_DESCRIPTION' => $reason['description'], - 'REPORTER_NAME' => ($report['user_id'] == ANONYMOUS) ? $user->lang['GUEST'] : $report['username'], 'REPORT_DATE' => $user->format_date($report['report_time']), 'REPORT_TEXT' => $report['report_text'], @@ -155,6 +153,11 @@ class mcp_reports 'POST_AUTHOR' => get_username_string('username', $post_info['user_id'], $post_info['username'], $post_info['user_colour'], $post_info['post_username']), 'U_POST_AUTHOR' => get_username_string('profile', $post_info['user_id'], $post_info['username'], $post_info['user_colour'], $post_info['post_username']), + 'REPORTER_FULL' => get_username_string('full', $report['user_id'], $report['username'], $report['user_colour']), + 'REPORTER_COLOUR' => get_username_string('colour', $report['user_id'], $report['username'], $report['user_colour']), + 'REPORTER_NAME' => get_username_string('username', $report['user_id'], $report['username'], $report['user_colour']), + 'U_VIEW_REPORTER_PROFILE' => get_username_string('profile', $report['user_id'], $report['username'], $report['user_colour']), + 'POST_PREVIEW' => $message, 'POST_SUBJECT' => $post_info['post_subject'], 'POST_DATE' => $user->format_date($post_info['post_time']), diff --git a/phpBB/includes/mcp/mcp_warn.php b/phpBB/includes/mcp/mcp_warn.php index da76dc8b58..4206582d01 100755 --- a/phpBB/includes/mcp/mcp_warn.php +++ b/phpBB/includes/mcp/mcp_warn.php @@ -88,9 +88,12 @@ function mcp_warn_front_view($id, $mode) { $template->assign_block_vars('highest', array( 'U_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&mode=user_notes&u=' . $row['user_id']), - 'U_USER' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['user_id']), - 'USERNAME' => $row['username'], + 'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']), + 'USERNAME' => $row['username'], + 'USERNAME_COLOUR' => ($row['user_colour']) ? '#' . $row['user_colour'] : '', + 'U_USER' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['user_id']), + 'WARNING_TIME' => $user->format_date($row['user_last_warning']), 'WARNINGS' => $row['user_warnings'], ) @@ -99,7 +102,7 @@ function mcp_warn_front_view($id, $mode) // And now the 5 most recent users to get in trouble - $sql = 'SELECT u.user_id, u.username, u.user_warnings, w.warning_time + $sql = 'SELECT u.user_id, u.username, u.user_colour, u.user_warnings, w.warning_time FROM ' . USERS_TABLE . ' u, ' . WARNINGS_TABLE . ' w WHERE u.user_id = w.user_id ORDER BY w.warning_time DESC'; @@ -109,9 +112,12 @@ function mcp_warn_front_view($id, $mode) { $template->assign_block_vars('latest', array( 'U_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&mode=user_notes&u=' . $row['user_id']), - 'U_USER' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['user_id']), - 'USERNAME' => $row['username'], + 'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']), + 'USERNAME' => $row['username'], + 'USERNAME_COLOUR' => ($row['user_colour']) ? '#' . $row['user_colour'] : '', + 'U_USER' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['user_id']), + 'WARNING_TIME' => $user->format_date($row['warning_time']), 'WARNINGS' => $row['user_warnings'], ) @@ -137,7 +143,7 @@ function mcp_warn_list_view($id, $mode, $action) $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'], 365 => $user->lang['1_YEAR']); $sort_by_text = array('a' => $user->lang['SORT_USERNAME'], 'b' => $user->lang['SORT_DATE'], 'c' => $user->lang['SORT_WARNINGS']); - $sort_by_sql = array('a' => 'username', 'b' => 'user_last_warning', 'c' => 'user_warnings'); + $sort_by_sql = array('a' => 'username_clean', 'b' => 'user_last_warning', 'c' => 'user_warnings'); $s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = ''; gen_sort_selects($limit_days, $sort_by_text, $st, $sk, $sd, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param); @@ -155,9 +161,12 @@ function mcp_warn_list_view($id, $mode, $action) { $template->assign_block_vars('user', array( 'U_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&mode=user_notes&u=' . $row['user_id']), - 'U_USER' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['user_id']), - 'USERNAME' => $row['username'], + 'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']), + 'USERNAME' => $row['username'], + 'USERNAME_COLOUR' => ($row['user_colour']) ? '#' . $row['user_colour'] : '', + 'U_USER' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['user_id']), + 'WARNING_TIME' => $user->format_date($row['user_last_warning']), 'WARNINGS' => $row['user_warnings'], ) diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index 7882b7dc05..ad6a049a65 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -140,7 +140,7 @@ class session { global $phpEx, $SID, $_SID, $db, $config, $phpbb_root_path; - // Give us some basic informations + // Give us some basic information $this->time_now = time(); $this->cookie_data = array('u' => 0, 'k' => ''); $this->update_session_page = $update_session_page; diff --git a/phpBB/includes/ucp/ucp_main.php b/phpBB/includes/ucp/ucp_main.php index d7630765e7..57a8d0f86a 100644 --- a/phpBB/includes/ucp/ucp_main.php +++ b/phpBB/includes/ucp/ucp_main.php @@ -418,7 +418,7 @@ class ucp_main $topic_id = $row['topic_moved_id']; } - // Get folder img, topic status/type related informations + // Get folder img, topic status/type related information $folder_img = $folder_alt = $topic_type = ''; topic_status($row, $replies, $unread_topic, $folder_img, $folder_alt, $topic_type); @@ -579,7 +579,7 @@ class ucp_main $replies = ($auth->acl_get('m_approve', $forum_id)) ? $row['topic_replies_real'] : $row['topic_replies']; - // Get folder img, topic status/type related informations + // Get folder img, topic status/type related information $folder_img = $folder_alt = $topic_type = ''; $unread_topic = false; diff --git a/phpBB/includes/ucp/ucp_pm.php b/phpBB/includes/ucp/ucp_pm.php index c7c77836d4..b51f265df3 100644 --- a/phpBB/includes/ucp/ucp_pm.php +++ b/phpBB/includes/ucp/ucp_pm.php @@ -240,10 +240,11 @@ class ucp_pm } // If new messages arrived, place them into the appropiate folder - $num_not_moved = 0; + $num_not_moved = $num_removed = 0; + if ($user->data['user_new_privmsg'] && $action == 'view_folder') { - place_pm_into_folder($global_privmsgs_rules, request_var('release', 0)); + $return = place_pm_into_folder($global_privmsgs_rules, request_var('release', 0)); $num_not_moved = $user->data['user_new_privmsg']; // Make sure num_not_moved is valid. @@ -256,6 +257,9 @@ class ucp_pm $num_not_moved = $user->data['user_new_privmsg'] = $user->data['user_unread_privmsg'] = 0; } + + // Assign the number of private messages being removed due to rules. + $num_removed = $return['deleted']; } if (!$msg_id && $folder_id == PRIVMSGS_NO_BOX) @@ -350,8 +354,10 @@ class ucp_pm 'CUR_FOLDER_ID' => $folder_id, 'CUR_FOLDER_NAME' => $folder_status['folder_name'], 'NUM_NOT_MOVED' => $num_not_moved, + 'NUM_REMOVED' => $num_removed, 'RELEASE_MESSAGE_INFO' => sprintf($user->lang['RELEASE_MESSAGES'], '<a href="' . $this->u_action . '&folder=' . $folder_id . '&release=1">', '</a>'), 'NOT_MOVED_MESSAGES' => ($num_not_moved == 1) ? $user->lang['NOT_MOVED_MESSAGE'] : sprintf($user->lang['NOT_MOVED_MESSAGES'], $num_not_moved), + 'RULE_REMOVED_MESSAGES' => ($num_removed == 1) ? $user->lang['RULE_REMOVED_MESSAGE'] : sprintf($user->lang['RULE_REMOVED_MESSAGES'], $num_removed), 'S_FOLDER_OPTIONS' => $s_folder_options, 'S_TO_FOLDER_OPTIONS' => $s_to_folder_options, diff --git a/phpBB/includes/ucp/ucp_pm_viewfolder.php b/phpBB/includes/ucp/ucp_pm_viewfolder.php index acfa1758b8..4277639d83 100644 --- a/phpBB/includes/ucp/ucp_pm_viewfolder.php +++ b/phpBB/includes/ucp/ucp_pm_viewfolder.php @@ -163,7 +163,7 @@ function view_folder($id, $mode, $folder_id, $folder) { foreach ($id_ary as $ug_id => $_id) { - $user_colour = ($recipient_list[$type][$ug_id]['colour']) ? ' style="color:#' . $recipient_list[$type][$ug_id]['colour'] . '"' : ''; + $user_colour = ($recipient_list[$type][$ug_id]['colour']) ? ' style="font-weight: bold; color:#' . $recipient_list[$type][$ug_id]['colour'] . '"' : ''; if ($type == 'u') { @@ -440,7 +440,7 @@ function get_pm_from($folder_id, $folder, $user_id) // PM ordering options $limit_days = array(0 => $user->lang['ALL_MESSAGES'], 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'], 365 => $user->lang['1_YEAR']); $sort_by_text = array('a' => $user->lang['AUTHOR'], 't' => $user->lang['POST_TIME'], 's' => $user->lang['SUBJECT']); - $sort_by_sql = array('a' => 'u.username', 't' => 'p.message_time', 's' => 'p.message_subject'); + $sort_by_sql = array('a' => 'u.username_clean', 't' => 'p.message_time', 's' => 'p.message_subject'); $s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = ''; gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param); diff --git a/phpBB/includes/ucp/ucp_pm_viewmessage.php b/phpBB/includes/ucp/ucp_pm_viewmessage.php index 25dfac4807..cc23fc0fce 100644 --- a/phpBB/includes/ucp/ucp_pm_viewmessage.php +++ b/phpBB/includes/ucp/ucp_pm_viewmessage.php @@ -49,7 +49,7 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row) // Assign TO/BCC Addresses to template write_pm_addresses(array('to' => $message_row['to_address'], 'bcc' => $message_row['bcc_address']), $author_id); - $user_info = get_user_informations($author_id, $message_row); + $user_info = get_user_information($author_id, $message_row); // Parse the message and subject $message = $message_row['message_text']; @@ -376,9 +376,9 @@ function message_history($msg_id, $user_id, $message_row, $folder) } /** -* Get User Informations (only for message display) +* Get user information (only for message display) */ -function get_user_informations($user_id, $user_row) +function get_user_information($user_id, $user_row) { global $db, $auth, $user, $cache; global $phpbb_root_path, $phpEx, $config; diff --git a/phpBB/includes/ucp/ucp_prefs.php b/phpBB/includes/ucp/ucp_prefs.php index 2c6d9b79af..c085e54143 100644 --- a/phpBB/includes/ucp/ucp_prefs.php +++ b/phpBB/includes/ucp/ucp_prefs.php @@ -31,7 +31,7 @@ class ucp_prefs $data = array( 'notifymethod' => request_var('notifymethod', $user->data['user_notify_type']), - 'dateformat' => request_var('dateformat', $user->data['user_dateformat']), + 'dateformat' => request_var('dateformat', $user->data['user_dateformat'], true), 'lang' => request_var('lang', $user->data['user_lang']), 'style' => request_var('style', (int) $user->data['user_style']), 'tz' => request_var('tz', (float) $user->data['user_timezone']), diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php index 7994acdc85..fcbc2675f8 100644 --- a/phpBB/includes/ucp/ucp_register.php +++ b/phpBB/includes/ucp/ucp_register.php @@ -100,13 +100,22 @@ class ucp_register return; } - // Try to manually determine the timezone + // Try to manually determine the timezone and adjust the dst if the server date/time complies with the default setting +/- 1 $timezone = date('Z') / 3600; $is_dst = date('I'); - $timezone = ($is_dst) ? $timezone - 1 : $timezone; - if (!isset($user->lang['tz_zones'][(string) $timezone])) + if ($config['board_timezone'] == $timezone || $config['board_timezone'] == ($timezone - 1)) { + $timezone = ($is_dst) ? $timezone - 1 : $timezone; + + if (!isset($user->lang['tz_zones'][(string) $timezone])) + { + $timezone = $config['board_timezone']; + } + } + else + { + $is_dst = $config['board_dst']; $timezone = $config['board_timezone']; } diff --git a/phpBB/includes/ucp/ucp_zebra.php b/phpBB/includes/ucp/ucp_zebra.php index 2548037b10..b65ba2fd29 100644 --- a/phpBB/includes/ucp/ucp_zebra.php +++ b/phpBB/includes/ucp/ucp_zebra.php @@ -202,7 +202,7 @@ class ucp_zebra WHERE z.user_id = ' . $user->data['user_id'] . " AND $sql_and AND u.user_id = z.zebra_id - ORDER BY u.username ASC"; + ORDER BY u.username_clean ASC"; $result = $db->sql_query($sql); $s_username_options = ''; |