don't add delimiter to folder name, when folder with subfolders is
authortokul <tokul@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 5 Aug 2006 10:42:20 +0000 (10:42 +0000)
committertokul <tokul@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 5 Aug 2006 10:42:20 +0000 (10:42 +0000)
created. Use sqimap_mailbox_create() $type option. If suffix is added,
sqimap_mailbox_create() uses incorrect subscription command (#1315912).

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@11472 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/folder_manip.php

index e186ec5a85546f98bac736e546661b5f73897e48..116fe70bc278be74690d5bb3ebc37a1a3d4d237d 100644 (file)
@@ -41,6 +41,12 @@ function folders_checkname($imapConnection, $folder_name, $delimiter)
 
 /**
  * Called from folders.php to create a new folder.
+ * @param stream $imapConnection imap connection resource
+ * @param string $delimiter delimiter
+ * @param string $folder_name create folder name
+ * @param string $subfolder folder that stores new folder
+ * @param boolean $contain_subs
+ * @since 1.5.1
  */
 function folders_create ($imapConnection, $delimiter, $folder_name, $subfolder, $contain_subs)
 {
@@ -51,7 +57,9 @@ function folders_create ($imapConnection, $delimiter, $folder_name, $subfolder,
     $folder_name = imap_utf7_encode_local($folder_name);
 
     if ( ! empty($contain_subs) ) {
-        $folder_name = $folder_name . $delimiter;
+        $folder_type = 'noselect';
+    } else {
+        $folder_type = '';
     }
 
     if ($folder_prefix && (substr($folder_prefix, -1) != $delimiter)) {
@@ -65,9 +73,9 @@ function folders_create ($imapConnection, $delimiter, $folder_name, $subfolder,
     }
 
     if (trim($subfolder_orig) == '') {
-        sqimap_mailbox_create ($imapConnection, $folder_prefix.$folder_name, '');
+        sqimap_mailbox_create ($imapConnection, $folder_prefix.$folder_name, $folder_type);
     } else {
-        sqimap_mailbox_create ($imapConnection, $subfolder.$delimiter.$folder_name, '');
+        sqimap_mailbox_create ($imapConnection, $subfolder.$delimiter.$folder_name, $folder_type);
     }
 
     return;