diff --git a/phpBB/adm/style/acp_profile.html b/phpBB/adm/style/acp_profile.html index 9bc3111fc9..c018981ccb 100644 --- a/phpBB/adm/style/acp_profile.html +++ b/phpBB/adm/style/acp_profile.html @@ -27,10 +27,17 @@

{L_FIELD_TYPE_EXPLAIN}
{FIELD_TYPE}
+ +
+

{L_FIELD_IDENT_EXPLAIN}
+
{FIELD_IDENT}
+
+

{L_FIELD_IDENT_EXPLAIN}
+

{L_DISPLAY_PROFILE_FIELD_EXPLAIN}
checked="checked" /> {L_YES} checked="checked" /> {L_NO}
diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index 3a7e86616f..485bff7bc8 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -1741,7 +1741,12 @@ class acp_users $s_sort_dir .= ''; } - $order_by = $sk_sql[$sort_key] . ' ' . (($sort_dir == 'a') ? 'ASC' : 'DESC'); + if (!isset($sk_sql[$sort_key])) + { + $sort_key = 'a'; + } + + $order_by = $sk_sql[$sort_key] . ' ' . (($sort_dir == 'a') ? 'ASC' : 'DESC'); $sql = 'SELECT COUNT(attach_id) as num_attachments FROM ' . ATTACHMENTS_TABLE . " diff --git a/phpBB/includes/ucp/ucp_attachments.php b/phpBB/includes/ucp/ucp_attachments.php index 549e3a11b2..2312d1f30d 100644 --- a/phpBB/includes/ucp/ucp_attachments.php +++ b/phpBB/includes/ucp/ucp_attachments.php @@ -78,11 +78,17 @@ class ucp_attachments $s_sort_dir .= ''; } + if (!isset($sort_key_sql[$sort_key])) + { + $sort_key = 'a'; + } + $order_by = $sort_key_sql[$sort_key] . ' ' . (($sort_dir == 'a') ? 'ASC' : 'DESC'); $sql = 'SELECT COUNT(attach_id) as num_attachments FROM ' . ATTACHMENTS_TABLE . ' - WHERE poster_id = ' . $user->data['user_id']; + WHERE poster_id = ' . $user->data['user_id'] . ' + AND is_orphan = 0'; $result = $db->sql_query($sql); $num_attachments = $db->sql_fetchfield('num_attachments'); $db->sql_freeresult($result); @@ -92,6 +98,7 @@ class ucp_attachments LEFT JOIN ' . TOPICS_TABLE . ' t ON (a.topic_id = t.topic_id AND a.in_message = 0) LEFT JOIN ' . PRIVMSGS_TABLE . ' p ON (a.post_msg_id = p.msg_id AND a.in_message = 1) WHERE a.poster_id = ' . $user->data['user_id'] . " + AND a.is_orphan = 0 ORDER BY $order_by"; $result = $db->sql_query_limit($sql, $config['topics_per_page'], $start); diff --git a/phpBB/includes/ucp/ucp_confirm.php b/phpBB/includes/ucp/ucp_confirm.php index 2c83306e5e..e40e89cbf5 100644 --- a/phpBB/includes/ucp/ucp_confirm.php +++ b/phpBB/includes/ucp/ucp_confirm.php @@ -77,12 +77,21 @@ class ucp_confirm if ($change_lang) { - $lang = $change_lang; - $user->lang_name = $lang = $change_lang; - $user->lang_path = $phpbb_root_path . 'language/' . $lang . '/'; - $user->lang = array(); - $user->add_lang(array('common', 'ucp')); + $change_lang = basename($change_lang); + + if (file_exists($phpbb_root_path . 'language/' . $change_lang . '/')) + { + $user->lang_name = $lang = $change_lang; + $user->lang_path = $phpbb_root_path . 'language/' . $lang . '/'; + $user->lang = array(); + $user->add_lang(array('common', 'ucp')); + } + else + { + $change_lang = ''; + } } + include($phpbb_root_path . 'includes/captcha/captcha_gd.' . $phpEx); $policy = $policy_modules[array_rand($policy_modules)]; } diff --git a/phpBB/includes/ucp/ucp_pm_options.php b/phpBB/includes/ucp/ucp_pm_options.php index 4344b32895..256e781f1f 100644 --- a/phpBB/includes/ucp/ucp_pm_options.php +++ b/phpBB/includes/ucp/ucp_pm_options.php @@ -479,6 +479,11 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit } // Check + if (!isset($global_privmsgs_rules[$check_option])) + { + $check_option = 0; + } + define_check_option(($check_option && !isset($back['rule'])) ? true : false, $check_option, $check_lang); if ($check_option && !isset($back['rule'])) diff --git a/phpBB/includes/ucp/ucp_pm_viewfolder.php b/phpBB/includes/ucp/ucp_pm_viewfolder.php index db257b4cb0..6ce9ef187d 100644 --- a/phpBB/includes/ucp/ucp_pm_viewfolder.php +++ b/phpBB/includes/ucp/ucp_pm_viewfolder.php @@ -440,8 +440,6 @@ function get_pm_from($folder_id, $folder, $user_id) $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_key = (!in_array($sort_key, array('a', 't', 's'))) ? 't' : $sort_key; - $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/language/en/groups.php b/phpBB/language/en/groups.php index d28583bfb6..a936058162 100644 --- a/phpBB/language/en/groups.php +++ b/phpBB/language/en/groups.php @@ -66,6 +66,7 @@ $lang = array_merge($lang, array( 'GROUP_RESIGNED_PENDING' => 'Your pending membership was successfully removed from the selected group', 'GROUP_TYPE' => 'Group type', 'GROUP_UNDISCLOSED' => 'Hidden group', + 'FORUM_UNDISCLOSED' => 'Moderating hidden forum(s)', 'LOGIN_EXPLAIN_GROUP' => 'You need to login to view group details', diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index f50e79ed21..fa297d5b89 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -52,7 +52,8 @@ switch ($mode) $start = request_var('start', 0); $submit = (isset($_POST['submit'])) ? true : false; -$sort_key = request_var('sk', 'c'); +$default_key = 'c'; +$sort_key = request_var('sk', $default_key); $sort_dir = request_var('sd', 'a'); @@ -168,6 +169,7 @@ switch ($mode) } $s_forum_select = ''; + $undisclosed_forum = false; if (isset($forum_id_ary[$row['user_id']])) { @@ -175,14 +177,28 @@ switch ($mode) { foreach ($forum_id_ary[$row['user_id']] as $forum_id) { - if (isset($forums[$forum_id]) && $auth->acl_get('f_list', $forum_id)) + if (isset($forums[$forum_id])) { - $s_forum_select .= ''; + if ($auth->acl_get('f_list', $forum_id)) + { + $s_forum_select .= ''; + } + else + { + $undisclosed_forum = true; + } } } } } + // If the mod is only moderating non-viewable forums let us display this circumstance + // instead of saying they are moderating all forums + if (!$s_forum_select && $undisclosed_forum) + { + $s_forum_select = $user->lang['FORUM_UNDISCLOSED']; + } + if ($row['group_type'] == GROUP_HIDDEN && !$auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel') && $row['ug_user_id'] != $user->data['user_id']) { $group_name = $user->lang['GROUP_UNDISCLOSED']; @@ -1049,6 +1065,11 @@ switch ($mode) } // Sorting and order + if (!isset($sort_key_sql[$sort_key])) + { + $sort_key = $default_key; + } + $order_by .= $sort_key_sql[$sort_key] . ' ' . (($sort_dir == 'a') ? 'ASC' : 'DESC'); // Count the users ... diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php index 3710bd9f50..c3b9d73a03 100644 --- a/phpBB/viewforum.php +++ b/phpBB/viewforum.php @@ -194,8 +194,6 @@ $limit_days = array(0 => $user->lang['ALL_TOPICS'], 1 => $user->lang['1_DAY'], 7 $sort_by_text = array('a' => $user->lang['AUTHOR'], 't' => $user->lang['POST_TIME'], 'r' => $user->lang['REPLIES'], 's' => $user->lang['SUBJECT'], 'v' => $user->lang['VIEWS']); $sort_by_sql = array('a' => 't.topic_first_poster_name', 't' => 't.topic_last_post_time', 'r' => 't.topic_replies', 's' => 't.topic_title', 'v' => 't.topic_views'); -$sort_key = (!in_array($sort_key, array('a', 't', 'r', 's', 'v'))) ? 't' : $sort_key; - $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); @@ -225,15 +223,7 @@ if ($sort_days) } else { - if ($auth->acl_get('m_approve', $forum_id)) - { - $topics_count = ($forum_data['forum_topics_real']) ? $forum_data['forum_topics_real'] : 1; - } - else - { - $topics_count = ($forum_data['forum_topics']) ? $forum_data['forum_topics'] : 1; - } - + $topics_count = ($auth->acl_get('m_approve', $forum_id)) ? $forum_data['forum_topics_real'] : $forum_data['forum_topics']; $sql_limit_time = ''; } diff --git a/phpBB/viewonline.php b/phpBB/viewonline.php index 3edf7090d6..f38073a80b 100644 --- a/phpBB/viewonline.php +++ b/phpBB/viewonline.php @@ -33,6 +33,11 @@ $sort_key_text = array('a' => $user->lang['SORT_USERNAME'], 'b' => $user->lang[' $sort_key_sql = array('a' => 'u.username', 'b' => 's.session_time', 'c' => 's.session_page'); // Sorting and order +if (!isset($sort_key_text[$sort_key])) +{ + $sort_key = 'b'; +} + $order_by = $sort_key_sql[$sort_key] . ' ' . (($sort_dir == 'a') ? 'ASC' : 'DESC'); // Whois requested