From 889e8eaf7c40817663dd602a21ac771062ccac3b Mon Sep 17 00:00:00 2001 From: Alex AUVOLAT Date: Thu, 21 Jun 2012 16:34:27 +0200 Subject: Big change, sir. Can now upload any kind of files. --- lib/file/delfld.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 lib/file/delfld.php (limited to 'lib/file/delfld.php') diff --git a/lib/file/delfld.php b/lib/file/delfld.php new file mode 100644 index 0000000..c1cacf0 --- /dev/null +++ b/lib/file/delfld.php @@ -0,0 +1,16 @@ += 3, 'file'); +$fldid = intval($args[2]); + +$fld = mysql_fetch_assoc(sql( + "SELECT id, name, comment, public, owner ". + "FROM folders WHERE id = $fldid" + )); +assert_error($fld && $fld['owner'] == $user['id'], + "This folder does not exist, or you are not allowed to edit it."); + +token_validate("Do you really want to delete this folder ?", "folder-file-$fldid"); +sql("DELETE FROM folders WHERE id = $fldid"); +sql("UPDATE files SET folder = 0 WHERE folder = $fldid"); +header("location: file"); -- cgit v1.2.3