* Got bored and copied all the validate.php and define() stuff to 1.1
[squirrelmail.git] / src / folders_rename_getname.php
1 <?php
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 ** $Id$
12 **/
13
14 include('../src/validate.php');
15 include("../functions/strings.php");
16 include("../config/config.php");
17 include("../functions/page_header.php");
18 include("../functions/imap.php");
19 include("../src/load_prefs.php");
20
21 $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
22
23 $dm = sqimap_get_delimiter($imapConnection);
24 if (substr($old, strlen($old) - strlen($dm)) == $dm) {
25 $isfolder = true;
26 $old = substr($old, 0, strlen($old) - 1);
27 }
28
29 if (strpos($old, $dm)) {
30 $old_name = substr($old, strrpos($old, $dm)+1, strlen($old));
31 $old_parent = substr($old, 0, strrpos($old, $dm));
32 } else {
33 $old_name = $old;
34 $old_parent = "";
35 }
36
37 displayPageHeader($color, "None");
38 echo "<br><TABLE align=center border=0 WIDTH=95% COLS=1>";
39 echo "<TR><TD BGCOLOR=\"$color[0]\" ALIGN=CENTER><B>";
40 echo _("Rename a folder");
41 echo "</B></TD></TR>";
42 echo "<TR><TD BGCOLOR=\"$color[4]\" ALIGN=CENTER>";
43 echo "<FORM ACTION=\"folders_rename_do.php\" METHOD=\"POST\">\n";
44 echo _("New name:");
45 echo "<br><B>$old_parent . </B><INPUT TYPE=TEXT SIZE=25 NAME=new_name VALUE=\"$old_name\"><BR>\n";
46 if (isset($isfolder))
47 echo "<INPUT TYPE=HIDDEN NAME=isfolder VALUE=\"true\">";
48 printf("<INPUT TYPE=HIDDEN NAME=orig VALUE=\"%s\">\n", $old);
49 printf("<INPUT TYPE=HIDDEN NAME=old_name VALUE=\"%s\">\n", $old_name);
50 echo "<INPUT TYPE=SUBMIT VALUE=\""._("Submit")."\">\n";
51 echo "</FORM><BR></TD></TR>";
52 echo "</TABLE>";
53
54 /** Log out this session **/
55 sqimap_logout($imapConnection);
56 ?>
57
58