X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Ffolders_create.php;h=607bbac71d2e006b93cef0e72f42f84e83a8813b;hb=709a1a6d2b6881c1e57e542579436a8f9a909ac3;hp=5958303c65218e8d497ca2beb8df337a5fd79fcf;hpb=b6def0e7aaf44c772c1db0f2e6d1223c4e3332b0;p=squirrelmail.git diff --git a/src/folders_create.php b/src/folders_create.php index 5958303c..607bbac7 100644 --- a/src/folders_create.php +++ b/src/folders_create.php @@ -1,54 +1,52 @@ -Click here to go back."), $color); + print ""; + plain_error_message(_("Illegal folder name. Please select a different name.")."
"._("Click here to go back").".", $color); + sqimap_logout($imapConnection); exit; } - if ($contain_subs == true) + if (isset($contain_subs) && $contain_subs == true) $folder_name = "$folder_name$dm"; - if (trim($subfolder) == "[ None ]") { - sqimap_mailbox_create ($imapConnection, $folder_name, ""); + if ($folder_prefix && (substr($folder_prefix, -1) != $dm)) { + $folder_prefix = $folder_prefix . $dm; + } + if ($folder_prefix && (substr($subfolder, 0, strlen($folder_prefix)) != $folder_prefix)){ + $subfolder_orig = $subfolder; + $subfolder = $folder_prefix . $subfolder; + } else { + $subfolder_orig = $subfolder; + } + + if (trim($subfolder_orig) == '') { + sqimap_mailbox_create ($imapConnection, $folder_prefix.$folder_name, ""); } else { sqimap_mailbox_create ($imapConnection, $subfolder.$dm.$folder_name, ""); } - fputs($imapConnection, "1 logout\n"); - -// if ($auto_forward == true) { -// header ("Location: webmail.php?right_frame=folders.php"); -// } else { - echo "\n"; - displayPageHeader($color, "None"); - echo ""; - echo "


"; - echo _("Folder Created!"); - echo "

"; - echo _("The folder has been successfully created."); - echo "
"; - echo _("Click here"); - echo " "; - echo _("to continue."); - echo "
"; - echo ""; -// } + + $location = get_location(); + header ("Location: $location/folders.php?success=create"); + sqimap_logout($imapConnection); ?>