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