31fe65f496c59176eaf716f323f71d4131e11632
[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, $imapPort, 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 "<BR><BR><BR><CENTER><B>";
41 echo _("Folder Created!");
42 echo "</B><BR><BR>";
43 echo _("The folder has been successfully created.");
44 echo "<BR><A HREF=\"webmail.php?right_frame=folders.php\" TARGET=_top>";
45 echo _("Click here");
46 echo "</A> ";
47 echo _("to continue.");
48 echo "</CENTER>";
49 echo "</BODY></HTML>";
50 // }
51 ?>
52