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