Cleaning and bug-fix. Added base uri to read mail.
[squirrelmail.git] / src / folders_rename_getname.php
1 <?php
2
3 /**
4 * folders_rename_getname.php
5 *
6 * Copyright (c) 1999-2002 The SquirrelMail Project Team
7 * Licensed under the GNU GPL. For full terms see the file COPYING.
8 *
9 * Gets folder names and enables renaming
10 * Called from folders.php
11 *
12 * $Id$
13 */
14
15 /*****************************************************************/
16 /*** THIS FILE NEEDS TO HAVE ITS FORMATTING FIXED!!! ***/
17 /*** PLEASE DO SO AND REMOVE THIS COMMENT SECTION. ***/
18 /*** + Base level indent should begin at left margin, as ***/
19 /*** the require_once below looks. ***/
20 /*** + All identation should consist of four space blocks ***/
21 /*** + Tab characters are evil. ***/
22 /*** + all comments should use "slash-star ... star-slash" ***/
23 /*** style -- no pound characters, no slash-slash style ***/
24 /*** + FLOW CONTROL STATEMENTS (if, while, etc) SHOULD ***/
25 /*** ALWAYS USE { AND } CHARACTERS!!! ***/
26 /*** + Please use ' instead of ", when possible. Note " ***/
27 /*** should always be used in _( ) function calls. ***/
28 /*** Thank you for your help making the SM code more readable. ***/
29 /*****************************************************************/
30
31 require_once('../src/validate.php');
32 require_once('../functions/imap.php');
33
34 $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0);
35
36 global $delimiter;
37 if (substr($old, strlen($old) - strlen($delimiter)) == $delimiter) {
38 $isfolder = true;
39 $old = substr($old, 0, strlen($old) - 1);
40 }
41
42 if (strpos($old, $delimiter)) {
43 $old_name = substr($old, strrpos($old, $delimiter)+1, strlen($old));
44 $old_parent = substr($old, 0, strrpos($old, $delimiter));
45 } else {
46 $old_name = $old;
47 $old_parent = "";
48 }
49
50 displayPageHeader($color, 'None');
51 echo "<br><TABLE align=center border=0 WIDTH=\"95%\" COLS=1>";
52 echo "<TR><TD BGCOLOR=\"$color[0]\" ALIGN=CENTER><B>";
53 echo _("Rename a folder");
54 echo "</B></TD></TR>";
55 echo "<TR><TD BGCOLOR=\"$color[4]\" ALIGN=CENTER>";
56 echo "<FORM ACTION=\"folders_rename_do.php\" METHOD=\"POST\">\n";
57 echo _("New name:");
58 echo "<br><B>$old_parent . </B><INPUT TYPE=TEXT SIZE=25 NAME=new_name VALUE=\"$old_name\"><BR>\n";
59 if (isset($isfolder))
60 echo "<INPUT TYPE=HIDDEN NAME=isfolder VALUE=\"true\">";
61 printf("<INPUT TYPE=HIDDEN NAME=orig VALUE=\"%s\">\n", $old);
62 printf("<INPUT TYPE=HIDDEN NAME=old_name VALUE=\"%s\">\n", $old_name);
63 echo "<INPUT TYPE=SUBMIT VALUE=\""._("Submit")."\">\n";
64 echo "</FORM><BR></TD></TR>";
65 echo "</TABLE>";
66
67 /** Log out this session **/
68 sqimap_logout($imapConnection);
69 ?>