4e42dd14a39e7a764864ca4d2883ceae96aa2daf
[squirrelmail.git] / src / folders_create.php
1 <?
2 if (!isset($config_php))
3 include("../config/config.php");
4 if (!isset($strings_php))
5 include("../functions/strings.php");
6 if (!isset($page_header_php))
7 include("../functions/page_header.php");
8 if (!isset($imap_php))
9 include("../functions/imap.php");
10 if (!isset($display_messages_php))
11 include("../functions/display_messages.php");
12
13 include("../src/load_prefs.php");
14
15 $imapConnection = sqimap_login($username, $key, $imapServerAddress, 0);
16 $dm = sqimap_get_delimiter($imapConnection);
17
18 if (strpos($folder_name, "\"") || strpos($folder_name, ".") ||
19 strpos($folder_name, "/") || strpos($folder_name, "\\") ||
20 strpos($folder_name, "'") || strpos($folder_name, "$dm")) {
21 plain_error_message(_("Illegal folder name. Please select a different name.<BR><A HREF=\"../src/folders.php\">Click here to go back</A>."), $color);
22 exit;
23 }
24
25 if ($contain_subs == true)
26 $folder_name = "$folder_name$dm";
27
28 if (trim($subfolder) == "[ None ]") {
29 sqimap_mailbox_create ($imapConnection, $folder_name, "");
30 } else {
31 sqimap_mailbox_create ($imapConnection, $subfolder.$dm.$folder_name, "");
32 }
33 fputs($imapConnection, "1 logout\n");
34
35 // if ($auto_forward == true) {
36 // header ("Location: webmail.php?right_frame=folders.php");
37 // } else {
38 echo "<html><BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
39 displayPageHeader($color, "None");
40 echo "<FONT FACE=\"Arial,Helvetica\">";
41 echo "<BR><BR><BR><CENTER><B>";
42 echo _("Folder Created!");
43 echo "</B><BR><BR>";
44 echo _("The folder has been successfully created.");
45 echo "<BR><A HREF=\"webmail.php?right_frame=folders.php\" TARGET=_top>";
46 echo _("Click here");
47 echo "</A> ";
48 echo _("to continue.");
49 echo "</CENTER></FONT>";
50 echo "</BODY></HTML>";
51 // }
52 ?>
53