From a2620d589f75fc0b563d0163da3eb431cbadcdd3 Mon Sep 17 00:00:00 2001 From: Christian Fowler Date: Thu, 6 Jul 2006 23:58:24 +0000 Subject: add ability to query quota info user other than current user --- LibertyQuota.php | 8 ++++---- quota_inc.php | 13 +++++++++++-- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/LibertyQuota.php b/LibertyQuota.php index 0fa4bd0..adee10e 100644 --- a/LibertyQuota.php +++ b/LibertyQuota.php @@ -1,6 +1,6 @@ * - * @version $Revision: 1.9 $ $Date: 2006/02/18 21:03:46 $ $Author: spiderr $ + * @version $Revision: 1.10 $ $Date: 2006/07/06 23:58:24 $ $Author: spiderr $ */ class LibertyQuota extends LibertyBase { /** @@ -174,7 +174,7 @@ class LibertyQuota extends LibertyBase { **/ function isUserUnderQuota( $pUserId ) { $ret = FALSE; - if( is_numeric( $pUserId) ) { + if( is_numeric( $pUserId ) ) { $query = 'SELECT MAX(qo.`disk_usage`) AS `disk_usage` FROM `'.BIT_DB_PREFIX.'users_users` uu INNER JOIN `'.BIT_DB_PREFIX.'users_groups_map` ugm ON ( ugm.`user_id`=uu.`user_id` ) diff --git a/quota_inc.php b/quota_inc.php index d05679b..174cf4a 100644 --- a/quota_inc.php +++ b/quota_inc.php @@ -1,9 +1,18 @@ mUserId ) ) { + $pQuotaUserId = $assignUser->mUserId; + } else { + $pQuotaUserId = $gBitUser->mUserId; + } +} $quota = new LibertyQuota(); -$diskUsage = $quota->getUserUsage( $gBitUser->mUserId ); -$diskQuota = $quota->getUserQuota( $gBitUser->mUserId ); +$diskUsage = $quota->getUserUsage( $pQuotaUserId ); +$diskQuota = $quota->getUserQuota( $pQuotaUserId ); if( $diskQuota != 0 ) { $quotaPercent = round( (($diskUsage / $diskQuota) * 100), 0 ); -- cgit v1.3