From a0cd251df0629b6def18930307247f07fbd74c1a Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Sun, 12 Feb 2012 14:28:29 +0000 Subject: [PATCH] New folder functionality Extra code added to allow creation of new folders Minor fix to delete function by adding action var --- lib/file-control.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/lib/file-control.php b/lib/file-control.php index d410aae..ce0c0ee 100644 --- a/lib/file-control.php +++ b/lib/file-control.php @@ -6,7 +6,7 @@ $file=$_GET['file']; $docRoot = str_replace("\\","/",$_SERVER['DOCUMENT_ROOT']); // Not done the first time we are on the save loop (ie, before the form posting reload) -if ($_GET['action']=="load"||$_GET['action']=="rename"||$_GET['action']=="delete"||isset($_POST['contents'])) { +if ($_GET['action']=="load"||$_GET['action']=="newFolder"||$_GET['action']=="rename"||$_GET['action']=="delete"||isset($_POST['contents'])) { $file= str_replace("|","/",$file); } @@ -41,6 +41,18 @@ if ($_GET['action']=="load") { }; }; +// If we're due to add a new folder... +if ($_GET['action']=="newFolder") { + if ($_SESSION['userLevel'] > 0) { + mkdir($docRoot.$file, 0707); + // Reload file manager + echo ''; + } else { + echo ''; + echo ''; + } +} + // If we're due to rename a file... if ($_GET['action']=="rename") { if ($_SESSION['userLevel'] > 0) { @@ -65,7 +77,7 @@ if ($_GET['action']=="delete") { } } // Reload file manager - echo ''; + echo ''; } else { echo ''; echo '';