Backend for delete post

This commit is contained in:
Marijn Jansen
2017-02-01 14:13:22 +01:00
parent f10d9c14a1
commit d87d0b7295
4 changed files with 90 additions and 1 deletions

View File

@@ -0,0 +1,20 @@
<?php
session_start();
require_once "../../queries/post.php";
require_once "../../queries/user.php";
if (isset($_SESSION["userID"]) and
getRoleByID($_SESSION["userID"]) != 'frozen' and
getRoleByID($_SESSION["userID"]) != 'banned') {
if (empty($_POST["postID"]) or empty($_SESSION["userID"])) {
header('HTTP/1.1 500 Non enough arguments');
}
deletePost($_POST["postID"], $_SESSION["userID"]);
return;
} else {
echo "frozen";
}