1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 01:39:24 +02:00
Oinktube/objects/categoryDelete.json.php
2022-03-17 11:43:59 -03:00

17 lines
536 B
PHP

<?php
header('Content-Type: application/json');
global $global, $config;
if (!isset($global['systemRootPath'])) {
require_once '../videos/configuration.php';
}
require_once $global['systemRootPath'] . 'objects/user.php';
require_once $global['systemRootPath'] . 'objects/category.php';
if (!Category::canCreateCategory()) {
die('{"error":"' . __("Permission denied") . '"}');
}
require_once 'category.php';
$obj = new Category($_POST['id']);
$response = $obj->delete();
echo '{"status":"' . $response . '"}';