Fix creating a mailbox.
authorMichael M Slusarz <slusarz@curecanti.org>
Wed, 10 Dec 2008 01:25:45 +0000 (18:25 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Wed, 10 Dec 2008 01:27:34 +0000 (18:27 -0700)
CreateSubfolder does not exist as an action so remove it.

imp/imp-dimp.php

index fe2afbf..6a0ae57 100644 (file)
@@ -174,29 +174,25 @@ $result = false;
 
 /* We know we are going to be exclusively dealing with this mailbox, so
  * select it on the IMAP server (saves some STATUS calls). */
-if ($folder && !$imp_search->isSearchMbox($folder)) {
+if ($folder &&
+    ($action != 'CreateFolder') &&
+    !$imp_search->isSearchMbox($folder)) {
     $imp_imap->ob->openMailbox($folder);
 }
 
 switch ($action) {
 case 'CreateFolder':
-case 'CreateSubfolder':
     if (empty($folder)) {
         break;
     }
 
-    $parent = Util::getPost('parent');
-    if (($action == 'CreateSubfolder') && !$parent) {
-        break;
-    }
-
     $imptree = &IMP_IMAP_Tree::singleton();
     $imptree->eltDiffStart();
 
     $imp_folder = &IMP_Folder::singleton();
 
     $new = String::convertCharset($folder, NLS::getCharset(), 'UTF7-IMAP');
-    $new = $imptree->createMailboxName($parent, $new);
+    $new = $imptree->createMailboxName(Util::getPost('parent'), $new);
     if (is_a($new, 'PEAR_Error')) {
         $notification->push($new, 'horde.error');
         $result = false;