From 6b7f90de270c53f6dbea7e3de47901ba2ade79a7 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sun, 11 May 2003 16:38:43 +0000 Subject: [PATCH] re-enable posting. ;) git-svn-id: file:///svn/phpbb/trunk@4006 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_posting.php | 57 +++++++++++++++------------- 1 file changed, 30 insertions(+), 27 deletions(-) diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 3e0f0af014..34cf8a48f9 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -594,7 +594,7 @@ function upload_attachment($filename) } // Check Image Size, if it is an image - if (!$acl->gets('m_', 'a_') && $cat_id == IMAGE_CAT) + if (!$auth->acl_gets('m_', 'a_') && $cat_id == IMAGE_CAT) { list($width, $height) = getimagesize($file); @@ -1229,42 +1229,45 @@ function user_notification($mode, $subject, $forum_id, $topic_id, $post_id) } $db->sql_freeresult($result); - $sql = "SELECT a.user_id + if ($ids != '') + { + $sql = "SELECT a.user_id FROM " . ACL_OPTIONS_TABLE . " ao, " . ACL_USERS_TABLE . " a WHERE a.user_id IN (" . $ids . ") AND ao.auth_option_id = a.auth_option_id AND ao.auth_option = 'f_read' AND a.forum_id = " . $forum_id; - $result = $db->sql_query($sql); + $result = $db->sql_query($sql); - while ($row = $db->sql_fetchrow($result)) - { - $allowed_users[] = $row['user_id']; - } - $db->sql_freeresult($result); - - // Now grab group settings ... users can belong to multiple groups so we grab - // the minimum setting for all options. ACL_NO overrides ACL_YES so act appropriatley - $sql = "SELECT ug.user_id, MIN(a.auth_setting) as min_setting - FROM " . USER_GROUP_TABLE . " ug, " . ACL_OPTIONS_TABLE . " ao, " . ACL_GROUPS_TABLE . " a - WHERE ug.user_id IN (" . $ids . ") - AND a.group_id = ug.group_id - AND ao.auth_option_id = a.auth_option_id - AND ao.auth_option = 'f_read' - AND a.forum_id = " . $forum_id . " - GROUP BY ao.auth_option, a.forum_id"; - $result = $db->sql_query($sql); - - while ($row = $db->sql_fetchrow($result)) - { - if ($row['min_setting'] == 1) + while ($row = $db->sql_fetchrow($result)) { $allowed_users[] = $row['user_id']; } - } - $db->sql_freeresult($result); + $db->sql_freeresult($result); - $allowed_users = array_unique($allowed_users); + // Now grab group settings ... users can belong to multiple groups so we grab + // the minimum setting for all options. ACL_NO overrides ACL_YES so act appropriatley + $sql = "SELECT ug.user_id, MIN(a.auth_setting) as min_setting + FROM " . USER_GROUP_TABLE . " ug, " . ACL_OPTIONS_TABLE . " ao, " . ACL_GROUPS_TABLE . " a + WHERE ug.user_id IN (" . $ids . ") + AND a.group_id = ug.group_id + AND ao.auth_option_id = a.auth_option_id + AND ao.auth_option = 'f_read' + AND a.forum_id = " . $forum_id . " + GROUP BY ao.auth_option, a.forum_id"; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + if ($row['min_setting'] == 1) + { + $allowed_users[] = $row['user_id']; + } + } + $db->sql_freeresult($result); + + $allowed_users = array_unique($allowed_users); + } // if ($topic_notification)