From c3c5cdffa70bddb65f4c0a5a0f14fce187a96dda Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 20 Aug 2006 21:03:48 +0000 Subject: [PATCH] r1100: We need fetch_on_bits() for canviewownhidden in order to have per-product permissions work --- includes/class_sort.php | 2 +- index.php | 2 +- search.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/class_sort.php b/includes/class_sort.php index 7af123a..2bfc5b8 100644 --- a/includes/class_sort.php +++ b/includes/class_sort.php @@ -113,7 +113,7 @@ class ListSorter { // this WHERE clause is used for all the queries $basewhere = "bug.product IN (" . fetch_on_bits('canviewbugs') . ") - AND (!bug.hidden OR (bug.hidden AND bug.product IN (" . fetch_on_bits('canviewhidden') . "))" . (can_perform('canviewownhidden') ? " OR (bug.hidden AND bug.userid = " . $this->registry->userinfo['userid'] . ")" : "") . ")" . + AND (!bug.hidden OR (bug.hidden AND bug.product IN (" . fetch_on_bits('canviewhidden') . "))" . (can_perform('canviewownhidden') ? " OR (bug.hidden AND bug.userid = " . $this->registry->userinfo['userid'] . " AND bug.product IN (" . fetch_on_bits('canviewownhidden') . "))" : "") . ")" . (($this->registry->options['hidestatuses'] OR isset($this->registry->userinfo['hidestatuses'])) ? " AND bug.status NOT IN (" . ($this->registry->userinfo['hidestatuses'] != '' ? $this->registry->userinfo['hidestatuses'] : $this->registry->options['hidestatuses']) . ")" : ""); diff --git a/index.php b/index.php index 3911d99..599c43f 100644 --- a/index.php +++ b/index.php @@ -47,7 +47,7 @@ $pagination = new Pagination('p', 'pp'); $count = $db->query_first(" SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "bug - WHERE (!hidden OR (hidden AND product IN (" . fetch_on_bits('canviewhidden') . "))" . (can_perform('canviewownhidden') ? " OR (hidden AND userid = " . $bugsys->userinfo['userid'] . ")" : "") . ") + WHERE (!hidden OR (hidden AND product IN (" . fetch_on_bits('canviewhidden') . "))" . (can_perform('canviewownhidden') ? " OR (hidden AND userid = " . $bugsys->userinfo['userid'] . " AND product IN (" . fetch_on_bits('canviewownhidden') . "))" : "") . ") AND product IN (" . fetch_on_bits('canviewbugs') . ")" . (($bugsys->options['hidestatuses'] OR isset($bugsys->userinfo['hidestatuses'])) ? " AND status NOT IN (" . ($bugsys->userinfo['hidestatuses'] != '' ? $bugsys->userinfo['hidestatuses'] : $bugsys->options['hidestatuses']) . ")" : "") ); diff --git a/search.php b/search.php index 65b703e..4fe8283 100644 --- a/search.php +++ b/search.php @@ -257,12 +257,12 @@ if ($_REQUEST['do'] == 'process') ON (bug.bugid = bugfieldvalue.bugid) WHERE bug.bugid <> 0 AND bug.product IN (#<'ONBITS:VIEW'>#) - AND (!bug.hidden OR (bug.hidden AND bug.product IN (#<'ONBITS:HIDDEN'>#))" . (can_perform('canviewownhidden') ? " OR (bug.hidden AND bug.userid = " . $bugsys->userinfo['userid'] . ")" : "") . ") + AND (!bug.hidden OR (bug.hidden AND bug.product IN (#<'ONBITS:HIDDEN'>#))" . (can_perform('canviewownhidden') ? " OR (bug.hidden AND bug.userid = " . $bugsys->userinfo['userid'] . " AND bug.product IN (#<'ONBITS:OWNHIDDEN'>#))" : "") . ") " . implode("\n\t\t", $querybuild) . " GROUP BY bug.bugid $sortclause"; - $runquery = str_replace(array("#<'ONBITS:VIEW'>#", "#<'ONBITS:HIDDEN'>#"), array(fetch_on_bits('canviewbugs'), fetch_on_bits('canviewhidden')), $query); + $runquery = str_replace(array("#<'ONBITS:VIEW'>#", "#<'ONBITS:HIDDEN'>#", "#<'ONBITS:OWNHIDDEN'>#"), array(fetch_on_bits('canviewbugs'), fetch_on_bits('canviewhidden'), fetch_on_bits('canviewonhidden')), $query); $search = $db->query($runquery); -- 2.43.5