Exemple #1
0
 *
 * @author AndreaG | andrea@smartgap.it
 * @version 0.0.1
 * @copyright SmartGaP s.r.l.
 * @package esyFileManager
 * @site http://www.smartgap.it | http://esyfilemanager.smartgap.it
 */
/**
 * INCLUDES
 */
require_once "config.php";
require_once "classes/class.filemanager.php";
$FM = new esyFileManager();
$user = get_current_user();
//sleep(5);
$used = $FM->dirSize(FILES_FOLDER);
$quota = exec("cat /tmp/quotas | grep {$user} | awk '{print \$2}'");
$quota = $quota * 1024;
if ($quota == "user") {
    $quota_n = disk_total_space($_SERVER['DOCUMENT_ROOT']);
    $disp_n = disk_free_space($_SERVER['DOCUMENT_ROOT']);
    $used_n = $quota_n - $disp_n;
    $quota_to_print = $FM->bytesToSize($quota_n);
    $used_to_print = $FM->bytesToSize($used_n);
    $disp_to_print = $FM->bytesToSize($disp_n);
} else {
    $quota_to_print = $FM->bytesToSize($quota);
    $used_to_print = $FM->bytesToSize($used);
    $disp_to_print = $FM->bytesToSize($quota - $used);
}
?>
        ?>
/"><?php 
        echo $dirname;
        ?>
</option>
		<?php 
        $FM->listDirs(0, $dirname . "/");
        ?>
		</select>
		<?php 
        break;
    case 'fileinfo':
        $path = pathinfo($_POST['path']);
        echo "<div>";
        if (is_dir($_POST['path'])) {
            $size = $FM->dirSize($_POST['path']);
            echo "{$text['cartella']}: ";
            echo $path['basename'];
        } else {
            echo "File: ";
            echo "<a href='download.php?file={$_POST['path']}'>" . $path['basename'] . "</a>";
            echo "<br>";
            echo "{$text['tipo']}: ";
            echo $path['extension'];
        }
        echo "<br>";
        if (file_exists($_POST['path'])) {
            $size = filesize($_POST['path']);
            echo "{$text['dimensioni']}: ";
            echo $FM->bytesToSize($size);
            if (isset($path['extension']) && ($path['extension'] == "jpeg" || $path['extension'] == "jpg" || $path['extension'] == "gif" || $path['extension'] == "png" || $path['extension'] == "JPG")) {