2010-03-10 07:03:40 -05:00
|
|
|
<?php
|
|
|
|
|
|
2011-03-01 17:20:16 -05:00
|
|
|
require_once('../lib/base.php');
|
2011-04-16 04:12:53 -04:00
|
|
|
require( 'template.php' );
|
2011-03-01 17:20:16 -05:00
|
|
|
if( !OC_USER::isLoggedIn()){
|
2011-03-02 17:58:46 -05:00
|
|
|
header( "Location: ".OC_HELPER::linkTo( "index.php" ));
|
2011-03-01 17:20:16 -05:00
|
|
|
exit();
|
2010-08-12 11:30:20 -04:00
|
|
|
}
|
|
|
|
|
|
2011-04-18 09:07:14 -04:00
|
|
|
// Highlight navigation entry
|
2011-04-17 14:00:07 -04:00
|
|
|
OC_APP::setActiveNavigationEntry( "settings" );
|
2011-04-18 09:07:14 -04:00
|
|
|
OC_UTIL::addScript( "settings", "main" );
|
|
|
|
|
OC_UTIL::addStyle( "settings", "settings" );
|
|
|
|
|
|
|
|
|
|
// calculate the disc space
|
2011-04-17 07:47:45 -04:00
|
|
|
$used=OC_FILESYSTEM::filesize('/');
|
2011-04-17 10:40:44 -04:00
|
|
|
$free=OC_FILESYSTEM::free_space();
|
2011-04-17 07:47:45 -04:00
|
|
|
$total=$free+$used;
|
|
|
|
|
$relative=round(($used/$total)*100);
|
2011-04-18 09:07:14 -04:00
|
|
|
|
|
|
|
|
// Return template
|
|
|
|
|
$tmpl = new OC_TEMPLATE( "settings", "index", "admin");
|
2011-04-17 07:47:45 -04:00
|
|
|
$tmpl->assign('usage',OC_HELPER::humanFileSize($used));
|
|
|
|
|
$tmpl->assign('total_space',OC_HELPER::humanFileSize($total));
|
|
|
|
|
$tmpl->assign('usage_relative',$relative);
|
2011-03-01 17:20:16 -05:00
|
|
|
$tmpl->printPage();
|
2010-03-10 07:03:40 -05:00
|
|
|
|
|
|
|
|
?>
|