- Timestamp:
- 03/14/13 17:06:36 (10 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoMail1_2/inc/class.imap_functions.inc.php
r8013 r8014 2638 2638 function ren_mailbox($arr) 2639 2639 { 2640 $namebox = $arr['current']; 2641 $new_box = $arr['rename']; 2640 $namebox = $arr['current']; 2641 $path_delimiter = strrpos($namebox,$this->imap_delimiter)+1; 2642 $base_path = substr($namebox,0,$path_delimiter); 2643 $test = preg_split("/\/|\./",substr($arr['rename'], $path_delimiter)); 2644 $new_box = array_shift($test); 2645 $subfolders = $test; 2642 2646 $imap_server = $_SESSION['phpgw_info']['expressomail']['email_server']['imapServer']; 2643 2647 $mbox_stream = $this->open_mbox(); 2644 2648 //$ren_folder = imap_renamemailbox($mbox_stream,"{".$imap_server."}INBOX.$namebox","{".$imap_server."}INBOX.$new_box"); 2645 2646 2649 $result = "Ok"; 2647 2650 $namebox = mb_convert_encoding($namebox, "UTF7-IMAP","UTF-8"); 2648 $new_box = mb_convert_encoding($ new_box, "UTF7-IMAP","UTF-8");2651 $new_box = mb_convert_encoding($base_path.$new_box, "UTF7-IMAP","UTF-8"); 2649 2652 2650 2653 if(!imap_renamemailbox($mbox_stream,"{".$imap_server."}$namebox","{".$imap_server."}$new_box")) … … 2652 2655 $result = imap_last_error(); 2653 2656 } 2657 /*Cria as subpastas*/ 2658 if ($result == "Ok" && is_array($subfolders)){ 2659 $child = $new_box.$this->imap_delimiter; 2660 $subfolders_count = count($subfolders); 2661 for($i =0; $i < $subfolders_count; ++$i){ 2662 $child .= ($subfolders[$i] ? $subfolders[$i] : $this->functions->getLang("New Folder")); 2663 $namebox = mb_convert_encoding($child, "UTF7-IMAP", "UTF-8"); 2664 $result = "Ok"; 2665 if(!imap_createmailbox($mbox_stream,"{".$imap_server."}$namebox")) 2666 { 2667 $result = imap_last_error(); 2668 } 2669 $child .=$this->imap_delimiter; 2670 } 2671 } 2672 2654 2673 if($mbox_stream) 2655 2674 imap_close($mbox_stream); -
trunk/prototype/modules/mail/js/foldertree.js
r8011 r8014 603 603 /* Verifica se existe caracteres especiais no nome da pasta ou se existe "local_" 604 604 * em parte do nome (palavra reservada para pastas locais) */ 605 if($(this).val().match(/[\ /\`\~\^\<\>\|\\\"\!\@\#\$\%\&\*\+\(\)\[\]\{\}\?;:]/gi) || $(this).val().indexOf("local_") != -1)605 if($(this).val().match(/[\`\~\^\<\>\|\\\"\!\@\#\$\%\&\*\+\(\)\[\]\{\}\?;:]/gi) || $(this).val().indexOf("local_") != -1) 606 606 { 607 607 return write_msg(get_lang("cannot create folder. try other folder name")); 608 608 } 609 var new_name = folder_id.replace(/[a-zA-Z0-9á-úÁ-Ú,= .^\s_-]+$/, $(this).val());609 var new_name = folder_id.replace(/[a-zA-Z0-9á-úÁ-Ú,=^\s_-]+$/, $(this).val()); 610 610 if($('[id="' + new_name + '"]').length) 611 611 {
Note: See TracChangeset
for help on using the changeset viewer.