diff options
-rw-r--r-- | phpBB/adm/style/acp_groups.html | 2 | ||||
-rw-r--r-- | phpBB/includes/functions.php | 13 | ||||
-rw-r--r-- | phpBB/includes/functions_user.php | 2 | ||||
-rw-r--r-- | phpBB/includes/ucp/ucp_groups.php | 26 | ||||
-rw-r--r-- | phpBB/includes/ucp/ucp_pm_compose.php | 3 | ||||
-rw-r--r-- | phpBB/index.php | 21 | ||||
-rw-r--r-- | phpBB/install/convertors/convert_phpbb20.php | 2 | ||||
-rw-r--r-- | phpBB/language/en/acp/groups.php | 1 | ||||
-rw-r--r-- | phpBB/language/en/groups.php | 7 | ||||
-rw-r--r-- | phpBB/memberlist.php | 7 |
10 files changed, 60 insertions, 24 deletions
diff --git a/phpBB/adm/style/acp_groups.html b/phpBB/adm/style/acp_groups.html index 012acdb03d..9cfcdaf310 100644 --- a/phpBB/adm/style/acp_groups.html +++ b/phpBB/adm/style/acp_groups.html @@ -65,7 +65,7 @@ <dd><input name="group_legend" type="checkbox" class="radio" id="group_legend"{GROUP_LEGEND} /></dd> </dl> <dl> - <dt><label for="group_receive_pm">{L_GROUP_RECEIVE_PM}:</label></dt> + <dt><label for="group_receive_pm">{L_GROUP_RECEIVE_PM}:</label><br /><span>{L_GROUP_RECEIVE_PM_EXPLAIN}</span></dt> <dd><input name="group_receive_pm" type="checkbox" class="radio" id="group_receive_pm"{GROUP_RECEIVE_PM} /></dd> </dl> <dl> diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 24b03fc367..dbe8330c90 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -3151,8 +3151,15 @@ function get_backtrace() } // Strip the current directory from path - $trace['file'] = str_replace(array($path, '\\'), array('', '/'), $trace['file']); - $trace['file'] = substr($trace['file'], 1); + if (empty($trace['file'])) + { + $trace['file'] = ''; + } + else + { + $trace['file'] = str_replace(array($path, '\\'), array('', '/'), $trace['file']); + $trace['file'] = substr($trace['file'], 1); + } $args = array(); // If include/require/include_once is not called, do not show arguments - they may contain sensible information @@ -3177,7 +3184,7 @@ function get_backtrace() $output .= '<br />'; $output .= '<b>FILE:</b> ' . htmlspecialchars($trace['file']) . '<br />'; - $output .= '<b>LINE:</b> ' . $trace['line'] . '<br />'; + $output .= '<b>LINE:</b> ' . ((!empty($trace['line'])) ? $trace['line'] : '') . '<br />'; $output .= '<b>CALL:</b> ' . htmlspecialchars($trace['class'] . $trace['type'] . $trace['function']) . '(' . ((sizeof($args)) ? implode(', ', $args) : '') . ')<br />'; } diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 31226ac30c..fae22f7ad2 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -2390,7 +2390,7 @@ function get_group_name($group_id) /** * Obtain either the members of a specified group, the groups the specified user is subscribed to -* or checking if a specified user is in a specified group +* or checking if a specified user is in a specified group. This function does not return pending memberships. * * Note: Never use this more than once... first group your users/groups */ diff --git a/phpBB/includes/ucp/ucp_groups.php b/phpBB/includes/ucp/ucp_groups.php index ea5acf346f..55eb4ec0bc 100644 --- a/phpBB/includes/ucp/ucp_groups.php +++ b/phpBB/includes/ucp/ucp_groups.php @@ -143,8 +143,22 @@ class ucp_groups case 'join': - if (group_memberships($group_id, $user->data['user_id'], true)) + $sql = 'SELECT ug.*, u.username, u.username_clean, u.user_email + FROM ' . USER_GROUP_TABLE . ' ug, ' . USERS_TABLE . ' u + WHERE ug.user_id = u.user_id + AND ug.group_id = ' . $group_id . ' + AND ug.user_id = ' . $user->data['user_id']; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if ($row) { + if ($row['user_pending']) + { + trigger_error($user->lang['ALREADY_IN_GROUP_PENDING'] . $return_page); + } + trigger_error($user->lang['ALREADY_IN_GROUP'] . $return_page); } @@ -817,7 +831,7 @@ class ucp_groups // Approve, demote or promote group_user_attributes('approve', $group_id, $mark_ary, false, ($group_id) ? $group_row['group_name'] : false); - trigger_error($user->lang['USERS_APPROVED'] . $return_page); + trigger_error($user->lang['USERS_APPROVED'] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $this->u_action . '&action=list&g=' . $group_id . '">', '</a>')); break; @@ -881,7 +895,7 @@ class ucp_groups $user->add_lang('acp/groups'); - trigger_error($user->lang['GROUP_DEFS_UPDATED'] . $return_page); + trigger_error($user->lang['GROUP_DEFS_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $this->u_action . '&action=list&g=' . $group_id . '">', '</a>')); } else { @@ -924,10 +938,10 @@ class ucp_groups if ($error) { - trigger_error($user->lang[$error] . $return_page); + trigger_error($user->lang[$error] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $this->u_action . '&action=list&g=' . $group_id . '">', '</a>')); } - trigger_error($user->lang['GROUP_USERS_REMOVE'] . $return_page); + trigger_error($user->lang['GROUP_USERS_REMOVE'] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $this->u_action . '&action=list&g=' . $group_id . '">', '</a>')); } else { @@ -980,7 +994,7 @@ class ucp_groups trigger_error($user->lang[$error] . $return_page); } - trigger_error($user->lang['GROUP_USERS_ADDED'] . $return_page); + trigger_error($user->lang['GROUP_USERS_ADDED'] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $this->u_action . '&action=list&g=' . $group_id . '">', '</a>')); break; diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index fed72402f2..b5cba63c97 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -74,7 +74,7 @@ function compose_pm($id, $mode, $action) { $sql = 'SELECT group_id, group_name, group_type FROM ' . GROUPS_TABLE . ' - WHERE group_type NOT IN (' . GROUP_HIDDEN . ', ' . GROUP_CLOSED . ') + WHERE group_type <> ' . GROUP_HIDDEN . ' AND group_receive_pm = 1 ORDER BY group_type DESC'; $result = $db->sql_query($sql); @@ -730,6 +730,7 @@ function compose_pm($id, $mode, $action) $sql = 'SELECT group_id as id, group_name as name, group_colour as colour, group_type FROM ' . GROUPS_TABLE . ' WHERE group_receive_pm = 1 + AND group_type <> ' . GROUP_HIDDEN . ' AND ' . $db->sql_in_set('group_id', array_map('intval', array_keys($address_list['g']))); $result['g'] = $db->sql_query($sql); } diff --git a/phpBB/index.php b/phpBB/index.php index 84faea917f..92eda26000 100644 --- a/phpBB/index.php +++ b/phpBB/index.php @@ -36,16 +36,27 @@ $l_total_post_s = ($total_posts == 0) ? 'TOTAL_POSTS_ZERO' : 'TOTAL_POSTS_OTHER' $l_total_topic_s = ($total_topics == 0) ? 'TOTAL_TOPICS_ZERO' : 'TOTAL_TOPICS_OTHER'; // Grab group details for legend display -$sql = 'SELECT group_id, group_name, group_colour, group_type - FROM ' . GROUPS_TABLE . ' - WHERE group_legend = 1 - AND group_type <> ' . GROUP_HIDDEN . ' - ORDER BY group_name ASC'; +$sql = 'SELECT g.group_id, g.group_name, g.group_colour, g.group_type, ug.user_id + FROM ' . GROUPS_TABLE . ' g + LEFT JOIN ' . USER_GROUP_TABLE . ' ug + ON ( + g.group_id = ug.group_id + AND g.group_type = ' . GROUP_HIDDEN . ' + AND ug.user_id = ' . $user->data['user_id'] . ' + AND ug.user_pending = 0 + ) + WHERE g.group_legend = 1 + ORDER BY g.group_name ASC'; $result = $db->sql_query($sql); $legend = ''; while ($row = $db->sql_fetchrow($result)) { + if ($row['group_type'] == GROUP_HIDDEN && empty($row['user_id'])) + { + continue; + } + $colour_text = ($row['group_colour']) ? ' style="color:#' . $row['group_colour'] . '"' : ''; if ($row['group_name'] == 'BOTS') diff --git a/phpBB/install/convertors/convert_phpbb20.php b/phpBB/install/convertors/convert_phpbb20.php index 1436d4a256..eb04a64bec 100644 --- a/phpBB/install/convertors/convert_phpbb20.php +++ b/phpBB/install/convertors/convert_phpbb20.php @@ -158,7 +158,7 @@ if (!$get_info) } // TerraFrost's validated birthday mod - if (get_config_value('bday_required') !== false) + if (get_config_value('bday_require') !== false) { define('MOD_BIRTHDAY_TERRA', true); } diff --git a/phpBB/language/en/acp/groups.php b/phpBB/language/en/acp/groups.php index f69ac02168..fa49030ccb 100644 --- a/phpBB/language/en/acp/groups.php +++ b/phpBB/language/en/acp/groups.php @@ -81,6 +81,7 @@ $lang = array_merge($lang, array( 'GROUP_PROMOTE' => 'Promote to group leader', 'GROUP_RANK' => 'Group rank', 'GROUP_RECEIVE_PM' => 'Group able to receive private messages', + 'GROUP_RECEIVE_PM_EXPLAIN' => 'Please note that hidden groups are not able to be messaged, regardless of this setting.', 'GROUP_REQUEST' => 'Request', 'GROUP_SETTINGS' => 'Set user preferences', 'GROUP_SETTINGS_EXPLAIN' => 'Here you can force changes in users current preferences. Please note these settings are not saved for the group itself. They are intended as a quick method of altering the preferences of all users in this group.', diff --git a/phpBB/language/en/groups.php b/phpBB/language/en/groups.php index bd11356684..b9aee65871 100644 --- a/phpBB/language/en/groups.php +++ b/phpBB/language/en/groups.php @@ -31,10 +31,11 @@ if (empty($lang) || !is_array($lang)) // in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine $lang = array_merge($lang, array( - 'ALREADY_DEFAULT_GROUP' => 'The selected group is already your default group', - 'ALREADY_IN_GROUP' => 'You are already a member of the selected group', + 'ALREADY_DEFAULT_GROUP' => 'The selected group is already your default group.', + 'ALREADY_IN_GROUP' => 'You are already a member of the selected group.', + 'ALREADY_IN_GROUP_PENDING' => 'You already requested joining the selected group.', - 'CHANGED_DEFAULT_GROUP' => 'Successfully changed default group', + 'CHANGED_DEFAULT_GROUP' => 'Successfully changed default group.', 'GROUP_AVATAR' => 'Group avatar', 'GROUP_CHANGE_DEFAULT' => 'Are you sure you want to change your default membership to the group ā%sā?', diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index b8dccf28ad..e1601e9a0d 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -202,13 +202,14 @@ switch ($mode) } } - // If the mod is only moderating non-viewable forums let us display this circumstance - // instead of saying they are moderating all forums + // If the mod is only moderating non-viewable forums we skip the user. There is no gain in displaying the person then... if (!$s_forum_select && $undisclosed_forum) { - $s_forum_select = '<option value="">' . $user->lang['FORUM_UNDISCLOSED'] . '</option>'; +// $s_forum_select = '<option value="">' . $user->lang['FORUM_UNDISCLOSED'] . '</option>'; + continue; } + // The person is moderating several "public" forums, therefore the person should be listed, but not giving the real group name if hidden. 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']; |