Changed default value for SpamFilters_YourHop
[squirrelmail.git] / src / folders_create.php
CommitLineData
59177427 1<?php
895905c0 2
ef870322 3 /**
4 ** folders_create.php
5 **
895905c0 6 ** Copyright (c) 1999-2001 The SquirrelMail development team
ef870322 7 ** Licensed under the GNU GPL. For full terms see the file COPYING.
8 **
9487c2ff 9 ** Creates folders on the IMAP server.
ef870322 10 ** Called from folders.php
245a6892 11 **
12 ** $Id$
ef870322 13 **/
14
ff8a98e7 15 require_once('../src/validate.php');
16 require_once('../functions/imap.php');
17 require_once('../functions/display_messages.php');
d3cdb279 18
e1469126 19 $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
525b7ae6 20 global $delimiter;
7ce342dc 21
ecf51658 22 if (strpos($folder_name, "\"") || strpos($folder_name, "\\") ||
525b7ae6 23 strpos($folder_name, "'") || strpos($folder_name, "$delimiter")) {
9487c2ff 24 echo "<html><body bgcolor=$color[4]>";
9f2215a1 25 plain_error_message(_("Illegal folder name. Please select a different name.")."<BR><A HREF=\"../src/folders.php\">"._("Click here to go back")."</A>.", $color);
eabc2883 26 sqimap_logout($imapConnection);
7ce342dc 27 exit;
28 }
29
1863670d 30 if (isset($contain_subs) && $contain_subs == true)
525b7ae6 31 $folder_name = "$folder_name$delimiter";
7ce342dc 32
525b7ae6 33 if ($folder_prefix && (substr($folder_prefix, -1) != $delimiter)) {
34 $folder_prefix = $folder_prefix . $delimiter;
5479d709 35 }
36 if ($folder_prefix && (substr($subfolder, 0, strlen($folder_prefix)) != $folder_prefix)){
37 $subfolder_orig = $subfolder;
38 $subfolder = $folder_prefix . $subfolder;
9988d19e 39 } else {
40 $subfolder_orig = $subfolder;
5479d709 41 }
42
61457e01 43 if (trim($subfolder_orig) == '') {
5479d709 44 sqimap_mailbox_create ($imapConnection, $folder_prefix.$folder_name, "");
d92b6f31 45 } else {
525b7ae6 46 sqimap_mailbox_create ($imapConnection, $subfolder.$delimiter.$folder_name, "");
d92b6f31 47 }
b40316f9 48
1195c340 49 $location = get_location();
50 header ("Location: $location/folders.php?success=create");
51 sqimap_logout($imapConnection);
525b7ae6 52?>