while (false !== ($file = readdir($handle))) { $dirFiles[] = $file; } sort($dirFiles, SORT_LOCALE_STRING); foreach ($dirFiles as $file) { if (is_dir($file)) { if ($file != "." && $file != ".." && $file != "flags" && $file != "css" && $file != "scripts" && $file != "images") { $dirlist .= '<li><img src="/flags/directory.png" alt=">" title=">" class="flag" /><a href="' . $file . '">' . $file . '</a></li>'; } } else { if ($file != "favicon.ico" && $file != "index.php" && $file != "readme.txt" && $file != "robots.txt") { $countryArray = explode(".", $file); if (count(countryArray) > 0) { $country = strtoupper($countryArray[0]); $last_modification_date = date("F d Y ", filemtime($file)); $file_size = _format_bytes(filesize($file)); $fileList .= '<li><img src="/flags/' . $country . '.png" alt=">" title=">" class="flag" /><a href="' . $file . '">' . $file . '</a> ' . $file_size . ' (last update : ' . $last_modification_date . ')</li>'; } } } } closedir($handle); } ?> <h1>Download server</h1> <div style="font-family: Arial,Verdana,sans-serif;background-color: rgb(235, 245, 252);font-size: 1em;padding: 25px;text-align: left;"><?php if (file_exists("../readme.txt")) { include "../readme.txt"; } ?> </div>
<?php require_once '../../../config/functions.inc.php'; $path = $_GET['path']; $ext = "*." . $_GET['ext']; $fullpath = $path . $ext; // echo $fullpath; $output = array(); $return_arr = array(); $array = glob($fullpath); usort($array, create_function('$b,$a', 'return filemtime($a) - filemtime($b);')); // sort by most recent modified foreach ($array as $file) { $output['filename'] = basename($file); $output['filepath'] = $file; $output['filesize'] = _format_bytes(filesize($file)); // dir needs writeable to be set array_push($return_arr, $output); } echo json_encode($return_arr);
Disk Size </div> <div class="cell last"> <?php echo _format_bytes($ds); ?> </div> </div> <div class="row"> <div class="cell"> Disk Free </div> <div class="cell last"> <?php echo _format_bytes($fs); ?> </div> </div> </div> <br/> <div class="spacer"></div> <label>Timezone </label> <select id="timeZone" name="timeZone" onChange="timeZoneChange()"> <option value="" selected>Select</option> <?php $timezone_identifiers = DateTimeZone::listIdentifiers(); for ($i = 0; $i < count($timezone_identifiers); $i++) { echo "<option value=\"{$timezone_identifiers[$i]}\">{$timezone_identifiers[$i]}</option>"; } ?>
<?php echo cntDevices(); ?> </div> </div> <div class="row"> <div class="cell"> Total Configuration Files </div> <div class="cell last"> <?php $files = scan_dir($config_data_basedir); $filecnt = $files['total_files']; $fileByte = $files['total_size']; $fileByte = str_replace(",", "", $fileByte); echo "{$filecnt} files, " . _format_bytes($fileByte) . "\n"; ?> </div> </div> <div class="row"> <!-- blank --> <div class="cell"></div> <div class="cell last"></div> </div> <div class="row"> <div class="cell"> Purge Configuration Files </div> <div class="cell last"> Purge files older than <input id="purgeDays" type="text" size="2" maxlength="3" /> days <button id="purgeBtn" onclick="purge()">Go!</button> <span id="pleaseWait" style="display:none">Please wait... <img width="12" height="12" src='images/ajax_loader.gif' alt='Please wait... '/></span>
$ret = create_zip($list, $targetfile, true); $after = time(); $difference = $after - $before; fwrite($handle, "Compression time = " . $difference . " seconds"); $filetype = "Note : This file is of type zip and can be extracted using any unzip application"; } else { if (class_exists(Zip)) { $before = time(); $ret = create_zip_Zip($list, $targetfile, true); $after = time(); $difference = $after - $before; fwrite($handle, "Compression time = " . $difference . " seconds"); $filetype = "Note : This file is of type zip and can be extracted using any unzip application"; } else { $ret = "Zip support not present in your server. Please contact your server administrator to <a target=\"_blank\" href=\"http://www.php.net/manual/en/zip.installation.php\">install zip libraries</a>"; } } if ($ret == "1") { echo "done. <br/><br/>"; echo "<b>Download File : <a href=" . get_bloginfo('wpurl') . "/wp-content" . DML_LOG_FILE . $filename . ">" . str_replace('/', '', $filename) . "</a></b> (" . _format_bytes(filesize($targetfile)) . ")<br/><br/>"; echo $filetype . "<br/>"; } else { echo "failed. <br/><br/>"; echo "Sorry Sonny! Something went wrong. <b>Reason : " . $ret . "</b><br/>"; } echo '<br/><br/><table><tr bgcolor="#cec9c9"><td><b> Feel free to contact the author - <a href="http://aneeskA.com" target="_blank">aneeskA</a> - for any clarification at <i>contact(at)aneeskA(dot)com</i> </b></td></tr></table>'; fclose($handle); ?> </div>