[imp] bug in Quota.php and Quota/cyrus.php

Michael M Slusarz slusarz at bigworm.colorado.edu
Mon Dec 30 11:02:17 PST 2002


Quoting Jean-Michel Besnard <besnard at tekkno.net>:

| Hi,
| 
| I have noticed a bug in the cyrus quota driver of IMP.
| When a user has a quota set in cyrus is using 0% of it most likely, when
| the
| user has just been created) the quota bar in IMP says QUOTA NO LIMIT.
| 
| In Quota.php
| 
| if (!empty($used) && !empty($total))  is false if $used=0
| 
| so the solution would the following test instead
| if ((!empty($used)|| $empty==0) && !empty($total))

Fixed in CVS. Thanks.

| Another bug in cyrus.php
| 
|                     return $this->_quotaHTML($quota['STORAGE']['usage'] *
| 1024,\
|  $quota['STORAGE']['limit'] * 1024);
| 
| 
| $quota does not have the index STORAGE, so it does not have to be
| $quota['STORAGE']['usage'] or $quota['STORAGE']['limit']
|  but $quota['usage'] or $quota['limit']

This is not a bug.  PHP 4.3.0 defines the index $quota['STORAGE'] (in fact, 
the $quota['usage'] and $quota['limit'] ways to access the data are 
deprecated now.)

michael

______________________________________________
Michael Slusarz [slusarz at bigworm.colorado.edu]
The University of Colorado at Boulder


More information about the imp mailing list