|
From: Ulf E. <ulf...@us...> - 2005-10-02 21:33:26
|
Update of /cvsroot/phpbt/phpbt/inc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17927/inc Modified Files: functions.php auth.php Log Message: Allow admins and project admins to delete bugs Index: functions.php =================================================================== RCS file: /cvsroot/phpbt/phpbt/inc/functions.php,v retrieving revision 1.65 retrieving revision 1.66 diff -u -r1.65 -r1.66 --- functions.php 8 Sep 2005 20:05:42 -0000 1.65 +++ functions.php 1 Oct 2005 15:19:55 -0000 1.66 @@ -676,8 +676,14 @@ // Delete a bug and all associated records from the database function delete_bug($bug_id) { - global $db; + global $db, $perm; + // Permissions + $projectid = $db->getOne("select project_id". + " from ".TBL_BUG." b". + " where b.bug_id = ".$db->quote($bug_id)); + $perm->check_proj($projectid); + // Attachments $attary = $db->getAll("select file_name, project_id". " from ".TBL_ATTACHMENT." a, ".TBL_BUG." b". Index: auth.php =================================================================== RCS file: /cvsroot/phpbt/phpbt/inc/auth.php,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- auth.php 2 Sep 2005 19:17:24 -0000 1.23 +++ auth.php 1 Oct 2005 15:19:55 -0000 1.24 @@ -115,7 +115,7 @@ } } - function check_proj($project_id) { + function check_proj($project_id = -1) { global $db; if ($this->have_perm_proj($project_id)) { |