- Timestamp:
- 06/14/12 18:31:57 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.3/expressoMail1_2/inc/class.imap_functions.inc.php
r6482 r6508 4346 4346 4347 4347 $data = array(); 4348 $quota_root = $this->get_quota(array('folder_id' => "INBOX"));4349 4348 $quota_root = $this->get_quota(array('folder_id' => "INBOX")); 4349 $data["quota_root"] = $quota_root; 4350 4350 4351 4351 foreach ($response_array as $idx=>$line) { 4352 4352 $line2 = str_replace('"', "", $line); 4353 4353 $line2 = str_replace(" /vendor/cmu/cyrus-imapd/size (value.shared ",";",str_replace("* ANNOTATION ","",$line2)); 4354 list($folder,$size) = explode(";",$line2); 4355 $quota_used = str_replace(")","",$size);4354 list($folder,$size) = explode(";",$line2); 4355 4356 4356 $quota=$this->get_quotaroot(array('folder' => $folder)); 4357 $isroot=(strpos($quota['quota_root'],$folder)!==false); 4358 $quota_used = $isroot?$quota['quota_used']*1024:str_replace(")","",$size); 4357 4359 $hasquota=($quota['quota_root']!=""); 4358 $isroot=(strpos($quota['quota_root'],$folder)!==false); 4359 $quotaPercent = ($hasquota?(($quota_used / 1024) / $quota['quota_limit'])*100:0); 4360 $quotaPercent = ($hasquota?(($quota_used / 1024) / $quota['quota_limit'])*100:0); 4360 4361 $folder = mb_convert_encoding($folder, "ISO_8859-1", "UTF7-IMAP"); 4361 4362 if(!preg_match('/user\\'.$this->imap_delimiter.$this->username.'\\'.$this->imap_delimiter.'/i',$folder)){ … … 4375 4376 include_once("class.imapfp.inc.php"); 4376 4377 $imapfp = new imapfp(); 4377 4378 4378 4379 if(!$imapfp->open($this->imap_server,$this->imap_port)) 4379 4380 return $imapfp->get_error(); … … 4387 4388 $data = array(); 4388 4389 4389 foreach ($response_array as $idx=>$line) { 4390 $line2 = str_replace('"', "", $line); 4390 foreach ($response_array as $idx=>$line) { 4391 if($idx == 0) 4392 continue; 4393 $line2 = str_replace('"', "", $line); 4391 4394 $line2 = str_replace(" /vendor/cmu/cyrus-imapd/size (value.shared ",";",str_replace("* ANNOTATION ","",$line2)); 4392 list($folder,$size) = explode(";",$line2); 4393 $quota_used = str_replace(")","",$size); 4395 list($folder,$size) = explode(";",$line2); 4394 4396 $quota=$this->get_quotaroot(array('folder' => $folder)); 4395 $hasquota=($quota['quota_limit']!="");4396 4397 $isroot=(strpos($quota['quota_root'],$folder)!==false); 4397 4398 if($isroot){ 4398 $quotaPercent = ($hasquota?(($quota_used / 1024) / $quota['quota_limit'])*100:0); 4399 $folder = mb_convert_encoding($folder, "ISO_8859-1", "UTF7-IMAP"); 4400 if(preg_match('/user\\'.$this->imap_delimiter.$this->username.'\\'.$this->imap_delimiter.'/i',$folder)){ 4401 $folder = preg_replace('/user\\'.$this->imap_delimiter.$this->username.'\\'.$this->imap_delimiter.'/i','', $folder); 4402 $data[$folder] = array("quota_percent" => ($hasquota?sprintf("%.1f",round($quotaPercent,1)):''), "quota_used" => $quota_used, "quota_limit" => ($isroot && $folder!=$this->functions->getLang("Inbox")?$quota['quota_limit']:'')); 4403 return $data; 4404 } 4405 4399 return $quota; 4406 4400 } 4407 4401 }
Note: See TracChangeset
for help on using the changeset viewer.