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 | |
35586184 |
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'); |
d3cdb279 |
33 | |
e1469126 |
34 | $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0); |
be69e508 |
35 | |
525b7ae6 |
36 | global $delimiter; |
37 | if (substr($old, strlen($old) - strlen($delimiter)) == $delimiter) { |
693ccbc9 |
38 | $isfolder = true; |
39 | $old = substr($old, 0, strlen($old) - 1); |
40 | } |
41 | |
525b7ae6 |
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)); |
d92b6f31 |
45 | } else { |
46 | $old_name = $old; |
47 | $old_parent = ""; |
48 | } |
be69e508 |
49 | |
2d367c68 |
50 | displayPageHeader($color, 'None'); |
e9f8ea4e |
51 | echo "<br><TABLE align=center border=0 WIDTH=95% COLS=1>"; |
aae41ae9 |
52 | echo "<TR><TD BGCOLOR=\"$color[0]\" ALIGN=CENTER><B>"; |
036a8a9d |
53 | echo _("Rename a folder"); |
aae41ae9 |
54 | echo "</B></TD></TR>"; |
f8f9bed9 |
55 | echo "<TR><TD BGCOLOR=\"$color[4]\" ALIGN=CENTER>"; |
9f2215a1 |
56 | echo "<FORM ACTION=\"folders_rename_do.php\" METHOD=\"POST\">\n"; |
036a8a9d |
57 | echo _("New name:"); |
5bdd7223 |
58 | echo "<br><B>$old_parent . </B><INPUT TYPE=TEXT SIZE=25 NAME=new_name VALUE=\"$old_name\"><BR>\n"; |
1863670d |
59 | if (isset($isfolder)) |
693ccbc9 |
60 | echo "<INPUT TYPE=HIDDEN NAME=isfolder VALUE=\"true\">"; |
5bdd7223 |
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"; |
be69e508 |
64 | echo "</FORM><BR></TD></TR>"; |
65 | echo "</TABLE>"; |
66 | |
67 | /** Log out this session **/ |
813eba2f |
68 | sqimap_logout($imapConnection); |
525b7ae6 |
69 | ?> |