summaryrefslogtreecommitdiffstats
path: root/deleteStory.php
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--deleteStory.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/deleteStory.php b/deleteStory.php
new file mode 100644
index 0000000..17a4901
--- /dev/null
+++ b/deleteStory.php
@@ -0,0 +1,21 @@
+<?php
+require_once(__DIR__.'/lib/commons/functions.common.inc.php');
+require_once(__DIR__.'/lib/commons/functions.http.inc.php');
+require_once(__DIR__.'/lib/commons/functions.files.inc.php');
+require_once(__DIR__.'/lib/functions.stories.inc.php');
+
+//print_r($_POST);exit();
+
+$storyName = getMandatoryPostParameter('story-name', NULL, true);
+
+$pathToStory = generatePath(['stories', $storyName], __DIR__);
+
+if (dir_exists($pathToStory)) {
+ rm_dir($pathToStory, TRUE);
+ echo "dir deleted";
+} else {
+ echo "dir does not exist";
+ return 1;
+}
+
+?>