Rewrote IMAP functions.
[squirrelmail.git] / src / folders_create.php
CommitLineData
ed4332d1 1<HTML>
b40316f9 2<?
3 include("../config/config.php");
4 include("../functions/strings.php");
5 include("../functions/page_header.php");
6 include("../functions/imap.php");
7ce342dc 7 include("../functions/display_messages.php");
b40316f9 8
d3cdb279 9 include("../src/load_prefs.php");
10
f8f9bed9 11 echo "<BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
7ce342dc 12 displayPageHeader($color, "None");
13
b235d629 14 $imapConnection = loginToImapServer($username, $key, $imapServerAddress, 0);
d92b6f31 15 $dm = findMailboxDelimeter($imapConnection);
7ce342dc 16
17 if (strpos($folder_name, "\"") || strpos($folder_name, ".") ||
18 strpos($folder_name, "/") || strpos($folder_name, "\\") ||
19 strpos($folder_name, "'") || strpos($folder_name, "$dm")) {
036a8a9d 20 plain_error_message(_("Illegal folder name. Please select a different name.<BR><A HREF=\"../src/folders.php\">Click here to go back</A>."), $color);
7ce342dc 21 exit;
22 }
23
24 if ($contain_subs == true)
25 $folder_name = "$folder_name$dm";
26
d92b6f31 27 if (trim($subfolder) == "[ None ]") {
28 createFolder($imapConnection, "$folder_name");
29 } else {
f16d469a 30 createFolder($imapConnection, "$subfolder$dm$folder_name");
d92b6f31 31 }
b40316f9 32 fputs($imapConnection, "1 logout\n");
33
91f999f6 34 echo "<FONT FACE=\"Arial,Helvetica\">";
aff57ea5 35 echo "<BR><BR><BR><CENTER><B>";
36 echo _("Folder Created!");
37 echo "</B><BR><BR>";
38 echo _("The folder has been successfully created.");
bd8bf491 39 echo "<BR><A HREF=\"webmail.php?right_frame=folders.php\" TARGET=_top>";
aff57ea5 40 echo _("Click here");
bd8bf491 41 echo "</A> ";
aff57ea5 42 echo _("to continue.");
43 echo "</CENTER></FONT>";
b40316f9 44?>
ed4332d1 45</BODY></HTML>
b40316f9 46