From 98a3aef7d9a8c7609cbd898a5ed9dd612148db46 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Mon, 10 Oct 2005 23:21:51 +0000 Subject: [PATCH] r538: Implemented cansubscribe permission --- favourite.php | 10 +++++----- showreport.php | 2 ++ templates/showreport.tpl | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/favourite.php b/favourite.php index 174d048..b4e4d8a 100644 --- a/favourite.php +++ b/favourite.php @@ -16,11 +16,6 @@ $focus['showreport'] = 'focus'; require_once('./global.php'); -if (!$bugsys->userinfo['userid']) -{ - $message->error_permission(); -} - // ################################################################### if (empty($_REQUEST['do'])) @@ -38,6 +33,11 @@ if ($_REQUEST['do'] == 'handle') $message->error($lang->getlex('error_invalid_id')); } + if (!can_perform('cansubscribe', $bug['productid'])) + { + $message->error_permission(); + } + if ($db->query_first("SELECT * FROM " . TABLE_PREFIX . "favourite WHERE userid = " . $bugsys->userinfo['userid'] . " AND bugid = " . intval($bugsys->in['bugid']))) { $db->query("DELETE FROM " . TABLE_PREFIX . "favourite WHERE userid = " . $bugsys->userinfo['userid'] . " AND bugid = " . intval($bugsys->in['bugid'])); diff --git a/showreport.php b/showreport.php index f930c9a..eb15cb0 100644 --- a/showreport.php +++ b/showreport.php @@ -82,6 +82,8 @@ if ($bug['hidden'] AND !can_perform('canviewhidden', $bug['productid'])) // ################################################################### // global display items +$show['subscribe'] = can_perform('cansubscribe', $bug['productid']); + $favourite = (bool)$db->query_first("SELECT * FROM " . TABLE_PREFIX . "favourite WHERE bugid = $bug[bugid] AND userid = " . $bugsys->userinfo['userid']); $favouritetext = (($favourite) ? $lang->string('Remove from Favourites') : $lang->string('Add to Favourites')); diff --git a/templates/showreport.tpl b/templates/showreport.tpl index c73757b..86db0fa 100644 --- a/templates/showreport.tpl +++ b/templates/showreport.tpl @@ -35,7 +35,7 @@ $header / [{@"Show Bug History"}] - / [$favouritetext] + / [$favouritetext] -- 2.43.5