[ Index ] |
|
Code source de IMP H3 (4.1.5) |
1 <?php 2 /** 3 * Implementation of the Quota API for Cyrus IMAP servers. 4 * 5 * $Horde: imp/lib/Quota/cyrus.php,v 1.22.10.14 2007/01/02 13:55:02 jan Exp $ 6 * 7 * Copyright 2002-2007 Mike Cochrane <mike@graftonhall.co.nz> 8 * 9 * See the enclosed file COPYING for license information (GPL). If you 10 * did not receive this file, see http://www.fsf.org/copyleft/gpl.html. 11 * 12 * @author Mike Cochrane <mike@graftonhall.co.nz> 13 * @since IMP 4.0 14 * @package IMP_Quota 15 */ 16 class IMP_Quota_cyrus extends IMP_Quota { 17 18 /** 19 * Get quota information (used/allocated), in bytes. 20 * 21 * @return mixed An associative array. 22 * 'limit' = Maximum quota allowed 23 * 'usage' = Currently used portion of quota (in bytes) 24 * Returns PEAR_Error on failure. 25 */ 26 function getQuota() 27 { 28 $quota = @imap_get_quotaroot($_SESSION['imp']['stream'], 29 $GLOBALS['imp_search']->isSearchMbox($_SESSION['imp']['mailbox']) ? 'INBOX' : $_SESSION['imp']['mailbox']); 30 31 if (is_array($quota)) { 32 if (isset($quota['limit'])) { 33 return array('usage' => $quota['usage'] * 1024, 'limit' => $quota['limit'] * 1024); 34 } elseif (isset($quota['STORAGE']['limit'])) { 35 return array('usage' => $quota['STORAGE']['usage'] * 1024, 'limit' => $quota['STORAGE']['limit'] * 1024); 36 } 37 return array('usage' => 0, 'limit' => 0); 38 } 39 40 return PEAR::raiseError(_("Unable to retrieve quota"), 'horde.error'); 41 } 42 43 }
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Thu Nov 29 12:30:07 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |