Prechádzať zdrojové kódy

Add files via upload

yeungalan 6 rokov pred
rodič
commit
971d7e7dd6

+ 7 - 1
7-Zip File Manager/MainUI.php

@@ -44,7 +44,7 @@ include '../auth.php';
     <a class="item" onclick="functionbar_extract();">
         <i class="minus icon"></i> Extract
     </a>
-	<a class="item"  onclick="msgbox('Error: Operation is not supported','red','white')">
+	<a class="item"  onclick="functionbar_clean();">
         <i class="remove icon"></i> Clear Cache
     </a>
 	<a class="item" onclick="functionbar_info();">
@@ -318,6 +318,12 @@ function showDialog(href,x,y){
 	}
 }
 
+function functionbar_clean(){
+	$.get( 'deltmp.php', function(data) {
+		msgbox(data,'','');
+	});
+	
+}
 function msgbox(content,bgcolor,fontcolor){
 	$(".snackbar").attr("style",'background-color: ' + bgcolor + ';color:' + fontcolor);
 	ts('.snackbar').snackbar({

+ 4 - 3
7-Zip File Manager/ProgressUI.php

@@ -68,7 +68,7 @@ var f_rand = "<?php echo $_GET["rand"] ?>";
 var f_file = "<?php echo $_GET["file"] ?>";
 var f_dir = "<?php echo $_GET["dir"] ?>";
 var f_size = "<?php echo filesize($_GET["file"]); ?>";
-var f_DontCreateNewFolder = <?php echo $_GET["DontCreateNewFolder"] ?>;
+var f_DontCreateNewFolder = <?php echo isset($_GET["DontCreateNewFolder"]) ? $_GET["DontCreateNewFolder"] : "false"; ?>;
 var f_destdir = "<?php echo isset($_GET["destdir"]) ? $_GET["destdir"] : ""; ?>";
 var f_time = 1;
 var f_totaltime = 1;
@@ -118,8 +118,9 @@ $.get("opr.php?method=" + f_method + "&rand=" + f_rand + "&file=" + f_file + "&d
 		if(!f_cancel){
 			if(f_destdir.length >0){
 				//console.log('../SystemAOB/functions/file_system/move.php?from=../../../7-Zip%20File%20Manager/tmp/' + f_rand +'&to=../../' + f_destdir + f_filenameToFoldername(f_file));
-				
-				$.get( '../SystemAOB/functions/file_system/move.php?from=../../../7-Zip%20File%20Manager/tmp/' + f_rand +'&to=../../' + f_destdir + f_filenameToFoldername(f_file), function(data) {
+				//$.get( '../SystemAOB/functions/file_system/move.php?from=../../../7-Zip%20File%20Manager/tmp/' + f_rand +'&to=../../' + f_destdir + f_filenameToFoldername(f_file), function(data) {
+					
+				$.get( 'move.php?from=../7-Zip%20File%20Manager/tmp/' + f_rand +'&to=' + f_destdir + f_filenameToFoldername(f_file) + '&DontCreateNewFolder=' + f_DontCreateNewFolder , function(data) {
 					if(data !== "DONE"){
 						if(ao_module_virtualDesktop){
 							parent.msgbox(data,'<i class="caution sign icon"></i> 7-Zip File Manager',"");

+ 79 - 0
7-Zip File Manager/move.php

@@ -0,0 +1,79 @@
+<?php
+include '../auth.php';
+/*
+Original author: Toby Chui
+Branch: Master
+Commit ID: c6d6a955446ee4c7e8311229d704a8cebee1d906
+Lasted chanegd on: 5/12/2019
+URi: ArOZ-Online-Beta/src/master/SystemAOB/functions/file_system/move.php
+*/
+?>
+<?php
+//Require variable: from (Full path), to (Full path)
+function mv($var){
+	if (isset($_GET[$var]) !== false && $_GET[$var] != ""){
+		return $_GET[$var];
+	}else{
+		return null;
+	}
+}
+
+if($_GET["DontCreateNewFolder"] == "true"){
+	//echo mv("from");
+	$dir = scandir(mv("from"));
+	array_shift($dir);
+	array_shift($dir);
+	//print_r($dir);
+	
+	foreach ($dir as $filename) {
+		if(substr(mv("from"), -1) == DIRECTORY_SEPARATOR){
+			$from = mv("from").$filename;
+		}else{
+			$from = mv("from").DIRECTORY_SEPARATOR.$filename;
+		}
+		
+		if(substr(mv("to"), -1) == DIRECTORY_SEPARATOR){
+			$to = mv("to").$filename;
+		}else{
+			$to = mv("to").DIRECTORY_SEPARATOR.$filename;
+		}
+		
+		if ($from != null && $to != null){
+			if (file_exists($to)){
+				die("ERROR. Target already eixsts.");
+			}
+			if (file_exists($from)){
+				rename($from, $to);
+				echo "DONE";
+			}else{
+			echo 'ERROR';
+		}
+			
+		}
+	}
+}else{
+
+	$from = mv("from");
+	$to = mv("to");
+	if ($from != null && $to != null){
+		if (file_exists($to)){
+			die("ERROR. Target directory already eixsts.");
+		}
+		if (file_exists($from)){
+			rename($from, $to);
+			echo "DONE";
+			return true;
+			exit();
+		}else{
+		echo 'ERROR';
+		return true;
+		exit();
+	}
+		
+	}
+	
+}
+
+
+
+?>