Skip to content

Commit

Permalink
GH-114: Lock down bug tracker to developers only
Browse files Browse the repository at this point in the history
All further conversation about bugs is supposed to happen on Github.
We still allow developers to edit the bug tracker, so they can clean
up.

We start by disallowing users to add patches.
  • Loading branch information
cmb69 authored and derickr committed Aug 1, 2024
1 parent 31edeaf commit 4a29f1a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 3 additions & 1 deletion www/bug.php
Original file line number Diff line number Diff line change
Expand Up @@ -1109,7 +1109,9 @@
<br>
OUTPUT;
}
echo "<p><a href='patch-add.php?bug_id={$bug_id}'>Add a Patch</a></p>";
if ($logged_in) {
echo "<p><a href='patch-add.php?bug_id={$bug_id}'>Add a Patch</a></p>";
}

$pullRequestRepository = $container->get(PullRequestRepository::class);
$pulls = $pullRequestRepository->findAllByBugId($bug_id);
Expand Down
7 changes: 7 additions & 0 deletions www/patch-add.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@
// Authenticate
bugs_authenticate($user, $pw, $logged_in, $user_flags);

if (!$logged_in) {
response_header('Developers only');
display_bug_error('Only developers are allowed to add patches');
response_footer();
exit;
}

$canpatch = true;

/// Input vars
Expand Down

0 comments on commit 4a29f1a

Please sign in to comment.