Author Topic: Real User Used Quota  (Read 263 times)

0 Members and 1 Guest are viewing this topic.

Real User Used Quota
« on: August 23, 2017, 03:43:15 PM »
I creted admin module to show real used quota for all users

Re: Real User Used Quota
« Reply #1 on: August 26, 2017, 04:30:01 AM »
First of all - Great job.
Sorry but I never used github for something different than "git clone ..." and I have no idea how to make a "Pull request" so I will put it here. As I have my own users on the shell and for them I have created an Unlimited (Quota) package I noticed a small error. If the package is Unlimited the quota is 0 (zero) and I saw "Division by zero ... bla bla bla". I made a small fix which you might like:
Code: [Select]
null; <- Added for no warnings
null; <- Added for no warnings
$result[$i]['disk_quota'] * 1024 1024;
                    if (
$packageMaxQuotaBytes == "0") { <- Added for "Division by zero" error
echo "Unlimited";
                    } else {
$usedQuotaPercent round($allQuota 100 $packageMaxQuotaBytes2);
$usedQuotaProgress round($allQuota 100 $packageMaxQuotaBytes0);
"[$usedQuotaPercent %]";
$progressBarClass 'progressBarGreen';
                    if (
$usedQuotaProgress 50) {
$progressBarClass 'progressBarOrange';
                    if (
$usedQuotaProgress 90) {
$progressBarClass 'progressBarRed';

Like this for users with package "Unlimited" you see "Unlimited [%]" and always a full green bar. For the other users with different packages you see "[3.01%]" and green bar (for example). Something like this:

Hope you like it.
Current uptime:
UNIX is a very simple OS, but you have to be a GENIUS to understand it ...

Re: Real User Used Quota
« Reply #2 on: September 06, 2017, 01:27:03 PM »
Something is wrong

Parse error: syntax error, unexpected '<' in /usr/local/cwpsrv/htdocs/resources/admin/modules/users_used_quota.php on line 268

Can you please add the full code here?