From e47897c1397ac200e4dfb52bc4a169177b97f762 Mon Sep 17 00:00:00 2001 From: GHsun Date: Mon, 25 Jul 2016 11:10:14 +0100 Subject: [PATCH 1/3] Update index.php --- index.php | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 57 insertions(+), 1 deletion(-) diff --git a/index.php b/index.php index ef1d808..6a6c612 100644 --- a/index.php +++ b/index.php @@ -2953,7 +2953,7 @@ function outputHtml() || (GateKeeper::isDeleteAllowed())) { ?> - + + From 0d8c630743caa6560c51f3a2b2833f13cb956455 Mon Sep 17 00:00:00 2001 From: GHsun Date: Mon, 25 Jul 2016 11:12:47 +0100 Subject: [PATCH 2/3] Additional functions for ajax External function to rename files and directories --- addfunctions.php | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 addfunctions.php diff --git a/addfunctions.php b/addfunctions.php new file mode 100644 index 0000000..734e055 --- /dev/null +++ b/addfunctions.php @@ -0,0 +1,33 @@ +2 ? '' : '.'.$ext); + @rename($rnm_dir, $n_file); + $out['name'] = $n_file; + echo json_encode($out); + } else { + $dir = dirname($rnm_dir); + $n_dir = $dir.'/'.$new_name; + @rename($rnm_dir, $n_dir); + $out['name'] = $n_dir; + echo json_encode($out); + } +} + +if ($_REQUEST['function'] == 'rename'){ + re_name(); +} + +?> From 7e47a68cf960f45c452dd6298a0f9ebfc1b3431a Mon Sep 17 00:00:00 2001 From: GHsun Date: Mon, 25 Jul 2016 13:08:50 +0100 Subject: [PATCH 3/3] Update index.php --- index.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index 6a6c612..6f0568f 100644 --- a/index.php +++ b/index.php @@ -172,7 +172,7 @@ $_CONFIG['upload_enable'] = true; $_CONFIG['newdir_enable'] = true; $_CONFIG['delete_enable'] = false; - +$_CONFIG['rename_enable'] = true; /* * UPLOADING */ @@ -2045,6 +2045,12 @@ public static function isUploadAllowed(){ return true; return false; } + + public static function isRenameAllowed(){ + if(EncodeExplorer::getConfig("rename_enable") == true && GateKeeper::isUserLoggedIn() == true && GateKeeper::getUserStatus() == "admin") + return true; + return false; + } public static function isNewdirAllowed(){ if(EncodeExplorer::getConfig("newdir_enable") == true && GateKeeper::isUserLoggedIn() == true && GateKeeper::getUserStatus() == "admin") @@ -3270,8 +3276,10 @@ function(){ + +