mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 01:39:24 +02:00
19 lines
629 B
PHP
19 lines
629 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/playlist.php';
|
|
if (!User::isLogged()) {
|
|
die('{"error":"'.__("Permission denied").'"}');
|
|
}
|
|
$obj = new PlayList($_POST['playlist_id']);
|
|
if (!PlayLists::canManageAllPlaylists()) {
|
|
if (User::getId() !== $obj->getUsers_id()) {
|
|
die('{"error":"'.__("Permission denied").'"}');
|
|
}
|
|
}
|
|
|
|
echo '{"status":"'.$obj->delete().'"}';
|