59177427 |
1 | <?php |
895905c0 |
2 | |
35586184 |
3 | /** |
4 | * folders_rename_getname.php |
5 | * |
15e6162e |
6 | * Copyright (c) 1999-2002 The SquirrelMail Project Team |
35586184 |
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 | */ |
ef870322 |
14 | |
1c52ba77 |
15 | global $delimiter; |
35586184 |
16 | |
17 | require_once('../src/validate.php'); |
18 | require_once('../functions/imap.php'); |
d3cdb279 |
19 | |
1c52ba77 |
20 | $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0); |
be69e508 |
21 | |
1c52ba77 |
22 | echo $old; |
be69e508 |
23 | |
1c52ba77 |
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 | } |
be69e508 |
30 | |
1c52ba77 |
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 | ?> |