Changeset 5488 for trunk/expressoMail1_2/inc/class.imap_functions.inc.php
- Timestamp:
- 02/09/12 15:58:57 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoMail1_2/inc/class.imap_functions.inc.php
r5482 r5488 92 92 return $this->mbox; 93 93 } 94 94 95 function move_folder($params){ 96 //preg_match( '/[a-zA-Z0-9]+$/',$params['folder_to_move'], $new_folder); 97 $old_folder = mb_convert_encoding($params['folder_to_move'], 'UTF7-IMAP','UTF-8, ISO-8859-1, UTF7-IMAP'); 98 $new_folder = explode($this->imap_delimiter, $old_folder ); 99 $to_folder = mb_convert_encoding($params['folder_to'], 'UTF7-IMAP','UTF-8, ISO-8859-1, UTF7-IMAP'); 100 $mbox = imap_open('{'.$this->imap_server.":".$this->imap_port.$this->imap_options.'}'.$new_folder[0], $this->username, $this->password); 101 imap_renamemailbox($mbox, '{'.$this->imap_server.":".$this->imap_port.$this->imap_options.'}'.$old_folder, '{'.$this->imap_server.":".$this->imap_port.$this->imap_options.'}'.$to_folder.$this->imap_delimiter.$new_folder[count($new_folder)-1]); 102 //imap_close($mbox); 103 return true; 104 } 105 95 106 function parse_error($error, $field = ''){ 96 107 // This error is returned from Imap. … … 332 343 if( $this->useCache === true ) 333 344 $this->cache->set( 'infoHead://'.$this->username.'://'.$this->mboxFolder.'://'.$msg_number , $return , $this->expirationCache); 334 345 335 346 return $return; 336 347 } … … 2338 2349 { 2339 2350 $namebox = $arr['newp']; 2351 $base_path = $arr['base_path']; 2340 2352 $mbox_stream = $this->open_mbox(); 2341 2353 $imap_server = $_SESSION['phpgw_info']['expressomail']['email_server']['imapServer']; 2342 $namebox = mb_convert_encoding($namebox, "UTF7-IMAP", "UTF-8"); 2343 2344 $result = "Ok"; 2345 if(!imap_createmailbox($mbox_stream,"{".$imap_server."}$namebox")) 2346 { 2347 $result = implode("<br />\n", imap_errors()); 2348 } 2349 2354 $test = explode("/", $namebox); 2355 if(count($test) < 1 || $base_path == null || $base_path == "" || $base_path == 'undefined'){ 2356 if($base_path != null || $base_path != "" || $base_path != 'undefined'){ 2357 $namebox = $base_path.$namebox; 2358 } 2359 $namebox = mb_convert_encoding($namebox, "UTF7-IMAP", "UTF-8"); 2360 $result = "Ok"; 2361 if(!imap_createmailbox($mbox_stream,"{".$imap_server."}".$namebox)) 2362 { 2363 $result = implode("<br />\n", imap_errors()); 2364 } 2365 }else{ 2366 $child = $base_path.$this->imap_delimiter; 2367 for($i =0; $i < count($test); $i++){ 2368 $child .= ($test[$i] ? $test[$i] : $this->functions->getLang("New Folder")); 2369 $namebox = mb_convert_encoding($child, "UTF7-IMAP", "UTF-8"); 2370 $result = "Ok"; 2371 if(!imap_createmailbox($mbox_stream,"{".$imap_server."}$namebox")) 2372 { 2373 $result = implode("<br />\n", imap_errors()); 2374 } 2375 $child .=$this->imap_delimiter; 2376 } 2377 } 2350 2378 if($mbox_stream) 2351 2379 imap_close($mbox_stream); 2352 2353 2380 return $result; 2354 2355 2381 } 2356 2382 … … 4411 4437 foreach($search_criteria as $new_search) 4412 4438 { 4413 4414 4439 $elem = $this->get_info_head_msg($new_search); 4440 $elem['udate'] = gmdate('d/m/Y', $elem['udate'] + $this->functions->CalculateDateOffset()); 4415 4441 $elem['boxname'] = mb_convert_encoding( $name_box, "ISO-8859-1", "UTF7-IMAP" ); 4416 4442 $elem['uid'] = $new_search; … … 4460 4486 $elem = $this->get_info_head_msg( $new_search ); 4461 4487 $elem['udate'] = gmdate('d/m/Y', $elem['udate'] + $this->functions->CalculateDateOffset()); 4462 4488 $elem['boxname'] = mb_convert_encoding( $name_box, "ISO-8859-1", "UTF7-IMAP" ); 4463 4489 $elem['uid'] = $new_search; 4464 4490 /* compare dates in ordering */ … … 4495 4521 $arrayRetorno['data'] = $pageret; 4496 4522 $arrayRetorno['currentTab'] = $params['current_tab']; 4497 4498 4523 return ($pageret) ? $arrayRetorno : 'none'; 4499 4524 }
Note: See TracChangeset
for help on using the changeset viewer.