'; $location = str_replace("|","/",xssClean($_GET['location'],"html")); if ($location=="/") {$location = "";}; $dirArray = $filesArray = $finalArray = array(); // Get dir/file list over FTP if (isset($ftpSite)) { ftpStart(); // Show user warning if no good connection if (!$ftpConn || !$ftpLogin) { die(''); exit; } // Get our simple and detailed lists and close the FTP connection $ftpList = ftpGetList($ftpConn, $ftpRoot.$location); $finalArray = $ftpList['simpleList']; $ftpItems = $ftpList['detailedList']; ftpEnd(); // or get local list } else { $finalArray = scanDir($scanDir.$location); } foreach($finalArray as $entry) { $canAdd = true; for ($i=0;$i\n";} if ($i==count($finalArray)-1 && isset($_GET['location'])) { echo "\n"; } $type == "folder" ? $class = 'pft-directory' : $class = 'pft-file '.strtolower($ext); $loadParam = $type == "folder" ? "true" : "false"; echo "
  •         ".xssClean(basename($fileFolderName),"html")." "; if (!isset($ftpSite)) { $thisPermVal = $serverType=="Linux" ? substr(sprintf('%o', fileperms($docRoot.$iceRoot.$fileFolderName)), -3) : ''; } else { // Work out perms value $thisPermVal = 0; $r = $ftpItems[basename($fileFolderName)]['rights']; // Owner $thisPermVal += substr($r,1,1) == "r" ? 400 : 0; $thisPermVal += substr($r,2,1) == "w" ? 200 : 0; $thisPermVal += substr($r,3,1) == "x" ? 100 : 0; // Group $thisPermVal += substr($r,4,1) == "r" ? 40 : 0; $thisPermVal += substr($r,5,1) == "w" ? 20 : 0; $thisPermVal += substr($r,6,1) == "x" ? 10 : 0; // Public $thisPermVal += substr($r,7,1) == "r" ? 4 : 0; $thisPermVal += substr($r,8,1) == "w" ? 2 : 0; $thisPermVal += substr($r,9,1) == "x" ? 1 : 0; } $permColors = $thisPermVal == 777 ? 'background: #800; color: #eee' : 'color: #888'; echo ''; echo $thisPermVal; echo "
  • \n"; } echo ' '; ?>