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

20 lines
601 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();
$resp = array('error'=> empty($response), 'msg'=>$categoryDeleteMessage);
echo json_encode($resp);