mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-12-20 07:23:47 +01:00
LSaddon :: mailquota: replace LSdebug by LSlog logger
This commit is contained in:
parent
5f17c45cf4
commit
898e312d7e
1 changed files with 3 additions and 2 deletions
|
@ -83,6 +83,7 @@ function LSaddon_mailquota_support() {
|
||||||
* @retval array|false Array with mailbox usage and quota, or false
|
* @retval array|false Array with mailbox usage and quota, or false
|
||||||
**/
|
**/
|
||||||
function mailquota_get_usage(&$LSldapObject) {
|
function mailquota_get_usage(&$LSldapObject) {
|
||||||
|
$logger = LSlog :: get_logger("LSaddon_mailquota");
|
||||||
try {
|
try {
|
||||||
$LSldapObject -> registerOtherValue('masteruser', MAILQUOTA_IMAP_MASTER_USER);
|
$LSldapObject -> registerOtherValue('masteruser', MAILQUOTA_IMAP_MASTER_USER);
|
||||||
$imap_login = $LSldapObject -> getFData(MAILQUOTA_IMAP_MASTER_USER_FORMAT);
|
$imap_login = $LSldapObject -> getFData(MAILQUOTA_IMAP_MASTER_USER_FORMAT);
|
||||||
|
@ -91,7 +92,7 @@ function mailquota_get_usage(&$LSldapObject) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$imap_mailbox = $LSldapObject -> getFData(MAILQUOTA_IMAP_MAILBOX);
|
$imap_mailbox = $LSldapObject -> getFData(MAILQUOTA_IMAP_MAILBOX);
|
||||||
LSdebug("IMAP mailbox : '$imap_mailbox'");
|
$logger -> debug("Connect on IMAP mailbox '$imap_mailbox' with user $imap_login:xxxxxxx");
|
||||||
$mbox = @imap_open(
|
$mbox = @imap_open(
|
||||||
$imap_mailbox,
|
$imap_mailbox,
|
||||||
$imap_login,
|
$imap_login,
|
||||||
|
@ -100,7 +101,7 @@ function mailquota_get_usage(&$LSldapObject) {
|
||||||
);
|
);
|
||||||
if ($mbox) {
|
if ($mbox) {
|
||||||
$quota_values = imap_get_quotaroot($mbox, MAILQUOTA_IMAP_QUOTA_ROOT_MAILBOX);
|
$quota_values = imap_get_quotaroot($mbox, MAILQUOTA_IMAP_QUOTA_ROOT_MAILBOX);
|
||||||
LSdebug("IMAP mailbox :\n".varDump($quota_values));
|
$logger -> debug("IMAP mailbox root quota:\n".varDump($quota_values));
|
||||||
if(isset($quota_values['usage'])) {
|
if(isset($quota_values['usage'])) {
|
||||||
return array (
|
return array (
|
||||||
'usage' => intval($quota_values['usage']*1024),
|
'usage' => intval($quota_values['usage']*1024),
|
||||||
|
|
Loading…
Reference in a new issue