mirror of
https://github.com/prasathmani/tinyfilemanager.git
synced 2025-07-29 04:51:15 +02:00
Fix advanced search issue for read-only user (#785)
$_POST['type']=="search" not reachable if FM_READONLY is true
This commit is contained in:
@@ -456,14 +456,6 @@ if (isset($_POST['ajax']) && !FM_READONLY) {
|
|||||||
die(true);
|
die(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
//search : get list of files from the current folder
|
|
||||||
if(isset($_POST['type']) && $_POST['type']=="search") {
|
|
||||||
$dir = FM_ROOT_PATH;
|
|
||||||
$response = scan(fm_clean_path($_POST['path']), $_POST['content']);
|
|
||||||
echo json_encode($response);
|
|
||||||
exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
// backup files
|
// backup files
|
||||||
if (isset($_POST['type']) && $_POST['type'] == "backup" && !empty($_POST['file'])) {
|
if (isset($_POST['type']) && $_POST['type'] == "backup" && !empty($_POST['file'])) {
|
||||||
$fileName = $_POST['file'];
|
$fileName = $_POST['file'];
|
||||||
@@ -632,6 +624,16 @@ if (isset($_POST['ajax']) && !FM_READONLY) {
|
|||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isset($_POST['ajax'])) {
|
||||||
|
//search : get list of files from the current folder
|
||||||
|
if(isset($_POST['type']) && $_POST['type']=="search") {
|
||||||
|
$dir = FM_ROOT_PATH;
|
||||||
|
$response = scan(fm_clean_path($_POST['path']), $_POST['content']);
|
||||||
|
echo json_encode($response);
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Delete file / folder
|
// Delete file / folder
|
||||||
if (isset($_GET['del']) && !FM_READONLY) {
|
if (isset($_GET['del']) && !FM_READONLY) {
|
||||||
$del = str_replace( '/', '', fm_clean_path( $_GET['del'] ) );
|
$del = str_replace( '/', '', fm_clean_path( $_GET['del'] ) );
|
||||||
|
Reference in New Issue
Block a user