diff options
Diffstat (limited to 'phpBB/includes')
-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 |
4 files changed, 33 insertions, 11 deletions
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); } |