- Timestamp:
- 01/30/09 13:19:05 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoMail1_2/inc/class.imap_functions.inc.php
r628 r650 20 20 var $imap_options = ''; 21 21 var $functions; 22 var $foldersLimit; 22 23 23 24 function imap_functions (){ 25 $this->foldersLimit = 200; //Limit of folders (mailboxes) user can see 24 26 $this->username = $_SESSION['phpgw_info']['expressomail']['user']['userid']; 25 27 $this->password = $_SESSION['phpgw_info']['expressomail']['user']['passwd']; … … 286 288 $return["msg"] = lang("error appending mail on delete attachments"); 287 289 } 288 290 289 291 @imap_delete($this->mbox, imap_msgno($this->mbox, $params["msg_num"])); //Insere o novo e-mail sem anexos. 290 292 @imap_expunge($this->mbox); //Deleta o e-mail com anexos … … 882 884 $body = eregi_replace("</$tag>", "</$tag-->", $new_body); 883 885 } 886 // Malicious Code Remove 887 $dirtyCodePattern = "/(<([\w]+)([^>]*)on(mouse(move|over|down|up)|load|blur|change|click|dblclick|focus|key(down|up|press)|select)=[\"'][^>\"']*[\"']([^>]*)>)(.*)(<\/\\2>)?/isU"; 888 preg_match_all($dirtyCodePattern,$body,$rest,PREG_PATTERN_ORDER); 889 foreach($rest[0] as $i => $val) 890 if (!(preg_match("/window\.open/i",$rest[1][$i]) && strtoupper($rest[4][$i]) == "CLICK" )) //Calendar events 891 $body = str_replace($rest[1][$i],"<".$rest[2][$i].$rest[3][$i].$rest[7][$i].">",$body); 884 892 885 893 return "<span>".$body; … … 909 917 if(strtolower($msg->encoding[$msg_number][$index]) == 'base64') 910 918 { 911 if ($file_type == 'application/x-pkcs7-signature' )919 if ($file_type == 'application/x-pkcs7-signature' || $file_type == 'application/pkcs7-signature') 912 920 { 913 921 $export_mail = new ExportEml(); … … 1152 1160 $serverString = "{".$this->imap_server.":".$this->imap_port.$this->imap_options."}"; 1153 1161 $folders_list = imap_getmailboxes($mbox_stream, $serverString, "*"); 1162 $folders_list = array_slice($folders_list,0,$this->foldersLimit); 1163 1154 1164 $tmp = array(); 1155 1165 $result = array(); … … 1989 1999 1990 2000 if(!$flag_importance) 1991 2001 $return["status"] = imap_clearflag_full($this->mbox, $msgs_to_set, "\\Flagged", ST_UID); 1992 2002 else{ 1993 2003 $return["status"] = false; … … 2217 2227 $quota_used = (($quota['usage']/1024)* 100 + .5 )* .01; 2218 2228 if($quota_used >= $quota_limit) 2219 $quota_used = $quota_limit; 2229 { 2230 $quotaPercent = 100; 2231 } 2232 else 2233 { 2220 2234 $quotaPercent = ($quota_used / $quota_limit)*100; 2221 2235 $quotaPercent = (($quotaPercent)* 100 + .5 )* .01; 2222 2236 } 2223 2237 return array( 2224 2238 'quota_percent' => floor($quotaPercent), … … 2410 2424 $name_box = mb_convert_encoding(utf8_decode($name_box), "UTF7-IMAP", "ISO_8859-1" ); 2411 2425 $filter = $this->remove_accents($filter); 2412 //Este bloco tem a finalidade de transformar o CPFdas pastas compartilhadas em common name2426 //Este bloco tem a finalidade de transformar o login (quando numerico) das pastas compartilhadas em common name 2413 2427 $folder_name = explode($this->imap_delimiter,$name_box); 2414 2428 if (is_numeric($folder_name[1])) { … … 2465 2479 { 2466 2480 $header = $this->get_header($uid_msg); 2481 $flag = $header->Unseen.$header->Recent.$header->Flagged.$header->Draft; 2467 2482 $subject = $this->decode_string($header->fetchsubject); 2468 2483 $from = $header->from[0]->mailbox; 2469 2484 if($header->from[0]->personal != "") 2470 2485 $from = $header->from[0]->personal; 2471 $ret_msg = $this->decode_string($from) . "--" . $subject . "--". gmdate("d/m/Y",$header ->udate)."--". $this->size_msg($header->Size) ;2486 $ret_msg = $this->decode_string($from) . "--" . $subject . "--". gmdate("d/m/Y",$header ->udate)."--". $this->size_msg($header->Size) ."--". $flag; 2472 2487 return $ret_msg; 2473 2488 }
Note: See TracChangeset
for help on using the changeset viewer.