summaryrefslogtreecommitdiffstats
path: root/deleteStory.php
blob: 17a4901ccca5c9fe7ef02d40a198578e4ac200aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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;
}

?>