php8
[web.mtrack] / admin / deleterepo.php
1 <?php # vim:ts=2:sw=2:et:
2 /* For licensing and copyright terms, see the file named LICENSE */
3 include '../../inc/common.php';
4
5 if ($_SERVER['REQUEST_METHOD'] == 'POST') {
6   $rid = $_POST['repoid'];
7
8   MTrackACL::requireAllRights("repo:$rid", 'delete');
9
10   $S = MTrackRepo::loadById($rid);
11   $CS = MTrackChangeset::begin("repo:$rid", "Delete repo $S->shortname");
12   $S->deleteRepo($CS);
13   $CS->commit();
14 }
15
16 header("Location: ${ABSWEB}browse.php");
17 exit;
18