* EMailAdmin: fixed not shown (used) quota for arbitrary user in admin

This commit is contained in:
Ralf Becker 2015-07-04 18:52:41 +00:00
parent 0ffe6fcb12
commit 01f2df4ece
2 changed files with 5 additions and 5 deletions

View File

@ -197,7 +197,7 @@ class emailadmin_imap extends Horde_Imap_Client_Socket implements defaultimap
* *
* Plugins can overwrite it to eg. construct a special admin user name * Plugins can overwrite it to eg. construct a special admin user name
* *
* @param string $_username =null create an admin connection for given user or $this->acc_imap_username * @param string $_username =true create an admin connection for given user or $this->acc_imap_username
*/ */
function adminConnection($_username=true) function adminConnection($_username=true)
{ {

View File

@ -57,9 +57,9 @@ class emailadmin_imap_dovecot extends emailadmin_imap
* *
* Prefixes adminUsername with real username (separated by an asterisk) * Prefixes adminUsername with real username (separated by an asterisk)
* *
* @param string $_username =null create an admin connection for given user or $this->acc_imap_username * @param string $_username =true create an admin connection for given user or $this->acc_imap_username
*/ */
function adminConnection($_username=null) function adminConnection($_username=true)
{ {
// generate admin user name of $username // generate admin user name of $username
if (($pos = strpos($this->acc_imap_admin_username, '*')) !== false) // remove evtl. set username if (($pos = strpos($this->acc_imap_admin_username, '*')) !== false) // remove evtl. set username
@ -231,8 +231,8 @@ class emailadmin_imap_dovecot extends emailadmin_imap
// we are authenticated with master but for current user // we are authenticated with master but for current user
if(($quota = $this->getStorageQuotaRoot('INBOX'))) if(($quota = $this->getStorageQuotaRoot('INBOX')))
{ {
$userData['quotaLimit'] = (int) ($quota['limit'] / 1024); $userData['quotaLimit'] = (int) ($quota['QMAX'] / 1024);
$userData['quotaUsed'] = (int) ($quota['usage'] / 1024); $userData['quotaUsed'] = (int) ($quota['USED'] / 1024);
} }
$this->username = $bufferUsername; $this->username = $bufferUsername;
$this->loginName = $bufferLoginName; $this->loginName = $bufferLoginName;