Files
resatennis_tyroltenn/IDrive/.config/fullPathSelection.php

46 lines
1.2 KiB
PHP
Executable File

<?php
include_once 'path.php';
if(!isset($_SESSION['validUser']) || $_SESSION['validUser'] !== true)
exit(header("Location:../index.php"));
$dirArray = array();
$type = array();
$fullPath = isset($_GET['fullPath'])?$_GET['fullPath']:'/';
//$fullPath = phpRealEscapeString($fullPath);
$fullPath = rawurldecode($fullPath);
$dir_list = getListForDirectory($fullPath);
session_write_close();
$countDir = count($dir_list);
$resStatus = true;
$resHtml = '';
$exclude_opt = isset($_GET['exclude_option'])?$_GET['exclude_option']:'';//Added by sajana for hiding exclude option in pop-up...
if($exclude_opt=="no")
$class='';
else
$class='class="file_menu_list"';
if($countDir>0){
$index=0;
$resHtml = getLocalDirListHTML($dir_list,$fullPath);
if($index==0){
$resStatus = false;
$resHtml = '<div class="nfiles" style="display:block;">'.NO_FILES.'</div>';
}
} else {
$resStatus = false;
$resHtml = '<div class="nfiles" style="display:block;">'.NO_FILES.'</div>';
}
if(isset($_GET['fullPath'])){
$resArr[]=$resStatus;
$resArr[]=$resHtml;
$resArr[]= array('url'=>rawurlencode($fullPath),'dir'=>$dirArray,'type'=>$type, 'dir_list'=>$dir_list);
echo json_encode($resArr);
exit;
}
else {
echo $resHtml;
}
?>