1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 17:59:55 +02:00
Oinktube/objects/playlistRemove.php
Caleb Mazalevskis 8ce4b01fda
Stricter checking.
'!==' is slightly more secure than '!=' due to type strictness/looseness.
2022-02-03 09:25:00 +08:00

17 lines
553 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 (User::getId() !== $obj->getUsers_id()) {
die('{"error":"'.__("Permission denied").'"}');
}
echo '{"status":"'.$obj->delete().'"}';