1
0
mirror of https://github.com/Foltik/Shimapan synced 2024-11-10 23:53:31 -05:00

Allow users to delete their own files

This commit is contained in:
Foltik 2016-08-15 02:24:32 -04:00
parent eecfe7e35f
commit 19e082cc14

View File

@ -115,7 +115,7 @@ function delete($filename, $deleteid)
$q->execute(); $q->execute();
$result = $q->fetch(); $result = $q->fetch();
if ($_SESSION['level'] === '0' || $result['user'] === $_SESSION['id']) { if ($_SESSION['level'] === '0' || $result['user'] === $_SESSION['user']) {
$q = $db->prepare("DELETE FROM files WHERE id = (:id)"); $q = $db->prepare("DELETE FROM files WHERE id = (:id)");
$q->bindParam(':id', $result['id']); $q->bindParam(':id', $result['id']);
$q->execute(); $q->execute();