if any of the standard headers are blank, read_body.php doesn't show
[squirrelmail.git] / src / folders_rename_getname.php
CommitLineData
59177427 1<?php
ef870322 2 /**
3 ** folders_rename_getname.php
4 **
5 ** Copyright (c) 1999-2000 The SquirrelMail development team
6 ** Licensed under the GNU GPL. For full terms see the file COPYING.
7 **
8 ** Gets folder names and enables renaming
9 ** Called from folders.php
10 **/
11
2a32fc83 12 session_start();
13
d068c0ec 14 if (!isset($config_php))
15 include("../config/config.php");
16 if (!isset($strings_php))
17 include("../functions/strings.php");
18 if (!isset($page_header_php))
19 include("../functions/page_header.php");
20 if (!isset($imap_php))
21 include("../functions/imap.php");
be69e508 22
d3cdb279 23 include("../src/load_prefs.php");
24
e1469126 25 $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
be69e508 26
813eba2f 27 $dm = sqimap_get_delimiter($imapConnection);
693ccbc9 28 if (substr($old, strlen($old) - strlen($dm)) == $dm) {
29 $isfolder = true;
30 $old = substr($old, 0, strlen($old) - 1);
31 }
32
d92b6f31 33 if (strpos($old, $dm)) {
34 $old_name = substr($old, strrpos($old, $dm)+1, strlen($old));
35 $old_parent = substr($old, 0, strrpos($old, $dm));
36 } else {
37 $old_name = $old;
38 $old_parent = "";
39 }
be69e508 40
7aaa81fc 41 $old_name = sqStripSlashes($old_name);
d7092926 42
f8f9bed9 43 displayPageHeader($color, "None");
e9f8ea4e 44 echo "<br><TABLE align=center border=0 WIDTH=95% COLS=1>";
aae41ae9 45 echo "<TR><TD BGCOLOR=\"$color[0]\" ALIGN=CENTER><B>";
036a8a9d 46 echo _("Rename a folder");
aae41ae9 47 echo "</B></TD></TR>";
f8f9bed9 48 echo "<TR><TD BGCOLOR=\"$color[4]\" ALIGN=CENTER>";
9f2215a1 49 echo "<FORM ACTION=\"folders_rename_do.php\" METHOD=\"POST\">\n";
036a8a9d 50 echo _("New name:");
51 echo " &nbsp;&nbsp;<INPUT TYPE=TEXT SIZE=25 NAME=new_name VALUE=\"$old_name\"><BR>\n";
693ccbc9 52 if ($isfolder)
53 echo "<INPUT TYPE=HIDDEN NAME=isfolder VALUE=\"true\">";
be69e508 54 echo "<INPUT TYPE=HIDDEN NAME=orig VALUE=\"$old\">";
036a8a9d 55 echo "<INPUT TYPE=SUBMIT VALUE=\"";
56 echo _("Submit");
57 echo "\">\n";
be69e508 58 echo "</FORM><BR></TD></TR>";
59 echo "</TABLE>";
60
61 /** Log out this session **/
813eba2f 62 sqimap_logout($imapConnection);
be69e508 63?>
64
65