final move of files
[web.mtrack] / admin / deleterepo.php
diff --git a/admin/deleterepo.php b/admin/deleterepo.php
new file mode 100644 (file)
index 0000000..dcb3eda
--- /dev/null
@@ -0,0 +1,18 @@
+<?php # vim:ts=2:sw=2:et:
+/* For licensing and copyright terms, see the file named LICENSE */
+include '../../inc/common.php';
+
+if ($_SERVER['REQUEST_METHOD'] == 'POST') {
+  $rid = $_POST['repoid'];
+
+  MTrackACL::requireAllRights("repo:$rid", 'delete');
+
+  $S = MTrackRepo::loadById($rid);
+  $CS = MTrackChangeset::begin("repo:$rid", "Delete repo $S->shortname");
+  $S->deleteRepo($CS);
+  $CS->commit();
+}
+
+header("Location: ${ABSWEB}browse.php");
+exit;
+