diff options
| author | bitweaver.org <bitweaver@users.sourceforge.net> | 2005-06-19 05:02:20 +0000 |
|---|---|---|
| committer | bitweaver.org <bitweaver@users.sourceforge.net> | 2005-06-19 05:02:20 +0000 |
| commit | 9896c8e5b5aa9b110bea5c4dbc438525489e15c0 (patch) | |
| tree | cb1237f32a289854859c5ca4930074f60d639d45 /index.php | |
| download | quota-9896c8e5b5aa9b110bea5c4dbc438525489e15c0.tar.gz quota-9896c8e5b5aa9b110bea5c4dbc438525489e15c0.tar.bz2 quota-9896c8e5b5aa9b110bea5c4dbc438525489e15c0.zip | |
IMPORT TikiPro CLYDE FINAL
Diffstat (limited to 'index.php')
| -rw-r--r-- | index.php | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/index.php b/index.php new file mode 100644 index 0000000..2913f4f --- /dev/null +++ b/index.php @@ -0,0 +1,44 @@ +<?php +// +----------------------------------------------------------------------+ +// | Copyright (c) 2004, bitweaver.org +// +----------------------------------------------------------------------+ +// | All Rights Reserved. See copyright.txt for details and a complete list of authors. +// | Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details +// | +// | For comments, please use phpdocu.sourceforge.net documentation standards!!! +// | -> see http://phpdocu.sourceforge.net/ +// +----------------------------------------------------------------------+ +// | Authors: spider <spider@steelsun.com> +// +----------------------------------------------------------------------+ +// +// $Id: index.php,v 1.1 2005/06/19 05:02:20 bitweaver Exp $ + +require_once( '../bit_setup_inc.php' ); + +$gBitSystem->verifyPackage( 'quota' ); + +require_once( QUOTA_PKG_PATH.'LibertyQuota.php' ); + +$quota = new LibertyQuota(); +$diskUsage = $quota->getUserUsage( $gBitUser->mUserId ); +$diskQuota = $quota->getUserQuota( $gBitUser->mUserId ); + +if( $diskQuota != 0 ) { + $quotaPercent = round( (($diskUsage / $diskQuota) * 100), 0 ); +} else { + $quotaPercent = 0; +} + +if( $quotaPercent > 100 ) { + $errors['disk_quota'] = "You are over your disk quota."; + $smarty->assign_by_ref( 'errors', $errors ); + $quotaPercent = 100; +} + +$smarty->assign( 'usage', round( ($diskUsage / 1000000), 2 ) ); +$smarty->assign( 'quota', round( ($diskQuota / 1000000), 2 ) ); +$smarty->assign_by_ref( 'quotaPercent', $quotaPercent ); + +$gBitSystem->display( 'bitpackage:quota/quota.tpl', 'View Quota' ); + +?> |
