aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2007-04-30 13:32:18 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2007-04-30 13:32:18 +0000
commit816bc5da616f1326d97fa20ccf59f3b1bca9fe1d (patch)
tree912bfdefef01c5b362af07bce0517cea0a0983d2 /phpBB/includes
parentef427b6483e89d797fed11485bdc857039d3b61f (diff)
downloadforums-816bc5da616f1326d97fa20ccf59f3b1bca9fe1d.tar
forums-816bc5da616f1326d97fa20ccf59f3b1bca9fe1d.tar.gz
forums-816bc5da616f1326d97fa20ccf59f3b1bca9fe1d.tar.bz2
forums-816bc5da616f1326d97fa20ccf59f3b1bca9fe1d.tar.xz
forums-816bc5da616f1326d97fa20ccf59f3b1bca9fe1d.zip
"Ghost" topics in active topics list when shadow topics and corresponding topic in same resultset [#10313]
Find a member supporting hidden groups for those able to see them [#10305] Display hidden groups for all those able to see them across the board (composing messages, viewonline) Fix space for sending PM's to groups Let the permissions_phpbb file be included the same way as all other permission files [#10301] Add request_a-z+ handling within modules_auth suggested by Pyramide. This will allow modders to directly show/hide their module in addition to !empty() $_REQUEST variables. [#10297] git-svn-id: file:///svn/phpbb/trunk@7433 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/functions_admin.php7
-rw-r--r--phpBB/includes/functions_module.php4
-rw-r--r--phpBB/includes/ucp/ucp_pm_compose.php51
-rw-r--r--phpBB/includes/ucp/ucp_pm_options.php2
4 files changed, 45 insertions, 19 deletions
diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php
index a96e6f7240..5a45b9f9dc 100644
--- a/phpBB/includes/functions_admin.php
+++ b/phpBB/includes/functions_admin.php
@@ -2916,12 +2916,9 @@ function add_permission_language()
{
global $user, $phpEx;
- // First of all, our own file.
- $user->add_lang('acp/permissions_phpbb');
-
$files_to_add = array();
- // Now search in acp and mods folder for permissions_ files.
+ // Search in acp and mods folder for permissions_ files.
foreach (array('acp/', 'mods/') as $path)
{
$dh = @opendir($user->lang_path . $path);
@@ -2930,7 +2927,7 @@ function add_permission_language()
{
while (($file = readdir($dh)) !== false)
{
- if (strpos($file, 'permissions_') === 0 && strpos($file, 'permissions_phpbb') === false && substr($file, -(strlen($phpEx) + 1)) === '.' . $phpEx)
+ if (strpos($file, 'permissions_') === 0 && substr($file, -(strlen($phpEx) + 1)) === '.' . $phpEx)
{
$files_to_add[] = $path . substr($file, 0, -(strlen($phpEx) + 1));
}
diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php
index 86cc93435d..bbb44d4b3d 100644
--- a/phpBB/includes/functions_module.php
+++ b/phpBB/includes/functions_module.php
@@ -298,7 +298,7 @@ class p_master
break;
default:
- if (!preg_match('#(?:acl_([a-z_]+)(,\$id)?)|(?:\$id)|(?:aclf_([a-z_]+))|(?:cfg_([a-z_]+))#', $token))
+ if (!preg_match('#(?:acl_([a-z_]+)(,\$id)?)|(?:\$id)|(?:aclf_([a-z_]+))|(?:cfg_([a-z_]+))|(?:request_([a-z_]+))#', $token))
{
$token = '';
}
@@ -314,7 +314,7 @@ class p_master
$forum_id = ($forum_id === false) ? $this->acl_forum_id : $forum_id;
$is_auth = false;
- eval('$is_auth = (int) (' . preg_replace(array('#acl_([a-z_]+)(,\$id)?#', '#\$id#', '#aclf_([a-z_]+)#', '#cfg_([a-z_]+)#'), array('(int) $auth->acl_get(\'\\1\'\\2)', '(int) $forum_id', '(int) $auth->acl_getf_global(\'\\1\')', '(int) $config[\'\\1\']'), $module_auth) . ');');
+ eval('$is_auth = (int) (' . preg_replace(array('#acl_([a-z_]+)(,\$id)?#', '#\$id#', '#aclf_([a-z_]+)#', '#cfg_([a-z_]+)#', '#request_([a-z_]+)#'), array('(int) $auth->acl_get(\'\\1\'\\2)', '(int) $forum_id', '(int) $auth->acl_getf_global(\'\\1\')', '(int) $config[\'\\1\']', '!empty($_REQUEST[\'\\1\'])'), $module_auth) . ');');
return $is_auth;
}
diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php
index 3cf3f41225..cc15cbc264 100644
--- a/phpBB/includes/ucp/ucp_pm_compose.php
+++ b/phpBB/includes/ucp/ucp_pm_compose.php
@@ -72,11 +72,24 @@ function compose_pm($id, $mode, $action)
{
if ($config['allow_mass_pm'] && $auth->acl_get('u_masspm'))
{
- $sql = 'SELECT group_id, group_name, group_type
- FROM ' . GROUPS_TABLE . '
- WHERE group_type <> ' . GROUP_HIDDEN . '
- AND group_receive_pm = 1
- ORDER BY group_type DESC';
+ $sql = 'SELECT g.group_id, g.group_name, g.group_type
+ FROM ' . GROUPS_TABLE . ' g';
+
+ if (!$auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel'))
+ {
+ $sql .= ' LEFT JOIN ' . USER_GROUP_TABLE . ' ug
+ ON (
+ g.group_id = ug.group_id
+ AND ug.user_id = ' . $user->data['user_id'] . '
+ AND ug.user_pending = 0
+ )
+ WHERE (g.group_type <> ' . GROUP_HIDDEN . ' OR ug.user_id = ' . $user->data['user_id'] . ')';
+ }
+
+ $sql .= ($auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel')) ? ' WHERE ' : ' AND ';
+
+ $sql .= 'g.group_receive_pm = 1
+ ORDER BY g.group_type DESC, g.group_name ASC';
$result = $db->sql_query($sql);
$group_options = '';
@@ -731,17 +744,33 @@ function compose_pm($id, $mode, $action)
{
$sql = 'SELECT user_id as id, username as name, user_colour as colour
FROM ' . USERS_TABLE . '
- WHERE ' . $db->sql_in_set('user_id', array_map('intval', array_keys($address_list['u'])));
+ WHERE ' . $db->sql_in_set('user_id', array_map('intval', array_keys($address_list['u']))) . '
+ ORDER BY username_clean ASC';
$result['u'] = $db->sql_query($sql);
}
if (!empty($address_list['g']))
{
- $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'])));
+ $sql = 'SELECT g.group_id AS id, g.group_name AS name, g.group_colour AS colour, g.group_type
+ FROM ' . GROUPS_TABLE . ' g';
+
+ if (!$auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel'))
+ {
+ $sql .= ' LEFT JOIN ' . USER_GROUP_TABLE . ' ug
+ ON (
+ g.group_id = ug.group_id
+ AND ug.user_id = ' . $user->data['user_id'] . '
+ AND ug.user_pending = 0
+ )
+ WHERE (g.group_type <> ' . GROUP_HIDDEN . ' OR ug.user_id = ' . $user->data['user_id'] . ')';
+ }
+
+ $sql .= ($auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel')) ? ' WHERE ' : ' AND ';
+
+ $sql .= 'g.group_receive_pm = 1
+ AND ' . $db->sql_in_set('g.group_id', array_map('intval', array_keys($address_list['g']))) . '
+ ORDER BY g.group_name ASC';
+
$result['g'] = $db->sql_query($sql);
}
diff --git a/phpBB/includes/ucp/ucp_pm_options.php b/phpBB/includes/ucp/ucp_pm_options.php
index cb55236936..f242c864b6 100644
--- a/phpBB/includes/ucp/ucp_pm_options.php
+++ b/phpBB/includes/ucp/ucp_pm_options.php
@@ -717,7 +717,7 @@ function define_cond_option($hardcoded, $cond_option, $rule_option, $global_rule
AND ug.user_id = ' . $user->data['user_id'] . '
AND ug.user_pending = 0
)
- WHERE (ug.user_id = ' . $user->data['user_id'] . ' OR g.group_type <> ' . GROUP_HIDDEN . ')
+ WHERE (ug.user_id = ' . $user->data['user_id'] . ' OR g.group_type <> ' . GROUP_HIDDEN . ')
AND';
}
else