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 | |
86725763 |
17 | /* Path for SquirrelMail required files. */ |
18 | define('SM_PATH','../'); |
19 | |
20 | /* SquirrelMail required files. */ |
08185f2a |
21 | require_once(SM_PATH . 'include/validate.php'); |
86725763 |
22 | require_once(SM_PATH . 'functions/imap.php'); |
23 | require_once(SM_PATH . 'functions/html.php'); |
d3cdb279 |
24 | |
0037f048 |
25 | if ($old == '') { |
26 | displayPageHeader($color, 'None'); |
27 | echo "<html><body bgcolor=$color[4]>"; |
28 | plain_error_message(_("You have not selected a folder to rename. Please do so.")."<BR><A HREF=\"../src/folders.php\">"._("Click here to go back")."</A>.", $color); |
29 | exit; |
30 | } |
31 | |
32 | |
1c52ba77 |
33 | $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0); |
be69e508 |
34 | |
1c52ba77 |
35 | if (substr($old, strlen($old) - strlen($delimiter)) == $delimiter) { |
36 | $isfolder = TRUE; |
37 | $old = substr($old, 0, strlen($old) - 1); |
38 | } else { |
39 | $isfolder = FALSE; |
40 | } |
be69e508 |
41 | |
1c52ba77 |
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'); |
3530b83b |
51 | echo '<br>' . |
52 | html_tag( 'table', '', 'center', '', 'width="95%" cols="1" border="0"' ) . |
53 | html_tag( 'tr', |
54 | html_tag( 'td', '<b>' . _("Rename a folder") . '</b>', 'center', $color[0] ) |
55 | ) . |
56 | html_tag( 'tr' ) . |
57 | html_tag( 'td', '', 'center', $color[4] ) . |
1c52ba77 |
58 | "<FORM ACTION=\"folders_rename_do.php\" METHOD=\"POST\">\n". |
59 | _("New name:"). |
60 | "<br><B>$old_parent $delimiter </B><INPUT TYPE=TEXT SIZE=25 NAME=new_name VALUE=\"$old_name\"><BR>\n"; |
61 | if ( $isfolder ) { |
62 | echo "<INPUT TYPE=HIDDEN NAME=isfolder VALUE=\"true\">"; |
63 | } |
64 | printf("<INPUT TYPE=HIDDEN NAME=orig VALUE=\"%s\">\n", $old); |
65 | printf("<INPUT TYPE=HIDDEN NAME=old_name VALUE=\"%s\">\n", $old_name); |
66 | echo "<INPUT TYPE=SUBMIT VALUE=\""._("Submit")."\">\n". |
3530b83b |
67 | "</FORM><BR></td></tr>". |
68 | "</table>"; |
1c52ba77 |
69 | |
70 | /** Log out this session **/ |
71 | sqimap_logout($imapConnection); |
0037f048 |
72 | ?> |