<?php
/************************************************************************/
/* Maximus CMS: Web Portal System                                       */
/* ==============================                                       */
/*                                                                      */
/* Copyright (c) 2002 - 2006                                            */
/* http://www.php-maximus.fr                                            */
/* dev@php-maximus.org                                                  */
/*                                                                      */
/* This program is free software. You can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License.       */
/************************************************************************/
/* Based on PHP-NUKE: Web Portal System                                 */
/************************************************************************/
if (!defined('ADMIN_ALLOW') && !defined('ADMIN_MAX')) {
	die ("Access Denied");
}
if ($acces == 1) {
if($admintest && $adminsecu)  {

    $dir = dir(''.$cache.'/Modules/');
    $numfile = -2;
    if(!is_object($dir))
    return false;
    while($file = $dir -> read())
   {
        if($file === '.' OR $file === '..')  continue;
            if(is_file($cache.'/Modules/'.$file))
            {
           $sizeF = filesize($cache.'/Modules/'.$file);
              $size+=$sizeF;
		$numfile++;
         }
     }
    $dir -> close();
// blocks
    $dir = dir(''.$cache.'/Blocks/');
    $numfile = -2;
    if(!is_object($dir))
    return false;
    while($file = $dir -> read())
   {
        if($file === '.' OR $file === '..')  continue;
            if(is_file($cache.'/Blocks/'.$file))
            {
           $sizeF = filesize($cache.'/Blocks/'.$file);
              $size+=$sizeF;
		$numfile++;
         }
     }
    $dir -> close();
//
// configuration
    $dir = dir(''.$cache.'/Configuration/');
    $numfile = -2;
    if(!is_object($dir))
    return false;
    while($file = $dir -> read())
   {
        if($file === '.' OR $file === '..')  continue;
            if(is_file($cache.'/Configuration/'.$file))
            {
           $sizeF = filesize($cache.'/Configuration/'.$file);
              $size+=$sizeF;
		$numfile++;
         }
     }
    $dir -> close();
//

$place = disk_free_space(''.$cache.'/');
$placekb = round(($place / 1024), 3);
$placemb = round(($placekb / 1024), 3);
$placegb = round(($placemb / 1024), 3);

if ($placegb >= 1) {
$placefree = " <b>$placegb</b> "._MEM_1."";}
elseif ($placemb >= 1) {
$placefree = " <b>$placemb</b> "._MEM_2."";}
elseif ($placekb >= 1) {
$placefree = " <b>$placekb</b> "._MEM_3."";}
else { $placefree = " <b>$place</b> "._MEM_4."";}


$sizekb = round(($size / 1024), 3);
$sizemb = round(($sizekb / 1024), 3);
$sizegb = round(($sizemb / 1024), 3);

if ($sizegb >= 1) {
$sizereal = " <b>$sizegb</b> "._MEM_1."";}
elseif ($sizemb >= 1) {
$sizereal = " <b>$sizemb</b> "._MEM_2."";}
elseif ($sizekb >= 1) {
$sizereal = " <b>$sizekb</b> "._MEM_3."";}
else { $sizereal = " <b>$size</b> "._MEM_4."";}

echo ""._SIZE_CACHE_FREE." $placefree<br />"
    .""._SIZE_CACHE." $sizereal<br />"
    ."<b>$numfile</b> "._FILES."<br />";
echo "</table>";
die();


}
}else {
	echo "Access Denied";
}