Files
resatennis_tyroltenn/IDrive/.config/restoreLocation.php

48 lines
1.3 KiB
PHP
Executable File

<?php
include_once 'path.php';
if(!isset($_SESSION['validUser']) || $_SESSION['validUser'] !== true)
exit(header("Location:../index.php"));
else {
$userName = getUserName();
$fullPath = isset($_GET['fullPath'])?$_GET['fullPath']:'/';
$fullPath = phpRealEscapeString($fullPath);
$dirArrayDefault = dirlist($fullPath);
session_write_close();
$countDir = count($dirArrayDefault);
$resStatus = true;
$resHtml = '';
$dirArray = array();
$type = array();
if($countDir>0){
$resHtml .= '<div class="excludefiles" style="overflow: hidden;">';
$resHtml .= '<table id="excludeFilesPath" width="100%" border="0" cellspacing="0" cellpadding="0" class="folderBackupContent backupset_table">';
$resHtml .= '<tbody>';
$index=0;
$resHtml .= getRemoteLocationListHTML($dirArrayDefault,$fullPath); //Calling function
$resHtml .= "</tbody></table></div>";
if($index==0){
$resStatus = false;
$resHtml = '<div class="nfiles" style="display:block;">'.NO_FILES.'</div>';
}
} else {
$resStatus = false;
$resHtml = '';
}
if(isset($_GET['fullPath'])){
$resArr[]=$resStatus;
$resArr[]=$resHtml;
$resArr[]= array('url'=>$fullPath,'dir'=>$dirArray,'type'=>$type);
echo json_encode($resArr);
exit;
} else {
echo $resHtml;
}
}
?>