Merge utf7_decode_local and utf7_encode_local into one file.
[squirrelmail.git] / src / folders_rename_getname.php
CommitLineData
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
86725763 15/* Path for SquirrelMail required files. */
16define('SM_PATH','../');
17
18/* SquirrelMail required files. */
08185f2a 19require_once(SM_PATH . 'include/validate.php');
86725763 20require_once(SM_PATH . 'functions/html.php');
483ddadc 21require_once(SM_PATH . 'functions/display_messages.php');
d3cdb279 22
a32985a5 23/* get globals we may need */
24
25$username = $_SESSION['username'];
26$key = $_COOKIE['key'];
27$delimiter = $_SESSION['delimiter'];
28$onetimepad = $_SESSION['onetimepad'];
29
30$old = $_POST['old'];
31
32/* end of get globals */
33
0037f048 34if ($old == '') {
35 displayPageHeader($color, 'None');
b7f83b61 36
37 plain_error_message(_("You have not selected a folder to rename. Please do so.").
38 '<BR><A HREF="../src/folders.php">'._("Click here to go back").'</A>.', $color);
0037f048 39 exit;
40}
41
1c52ba77 42if (substr($old, strlen($old) - strlen($delimiter)) == $delimiter) {
43 $isfolder = TRUE;
44 $old = substr($old, 0, strlen($old) - 1);
45} else {
46 $isfolder = FALSE;
47}
be69e508 48
1c52ba77 49if (strpos($old, $delimiter)) {
50 $old_name = substr($old, strrpos($old, $delimiter)+1, strlen($old));
51 $old_parent = substr($old, 0, strrpos($old, $delimiter));
52} else {
53 $old_name = $old;
54 $old_parent = '';
55}
56
57displayPageHeader($color, 'None');
3530b83b 58echo '<br>' .
b7f83b61 59 html_tag( 'table', '', 'center', '', 'width="95%" border="0"' ) .
3530b83b 60 html_tag( 'tr',
61 html_tag( 'td', '<b>' . _("Rename a folder") . '</b>', 'center', $color[0] )
62 ) .
63 html_tag( 'tr' ) .
64 html_tag( 'td', '', 'center', $color[4] ) .
b7f83b61 65 '<FORM ACTION="folders_rename_do.php" METHOD="POST">'.
1c52ba77 66 _("New name:").
67 "<br><B>$old_parent $delimiter </B><INPUT TYPE=TEXT SIZE=25 NAME=new_name VALUE=\"$old_name\"><BR>\n";
68if ( $isfolder ) {
b7f83b61 69 echo '<INPUT TYPE=HIDDEN NAME="isfolder" VALUE="true">';
1c52ba77 70}
b7f83b61 71printf("<INPUT TYPE=HIDDEN NAME=\"orig\" VALUE=\"%s\">\n", $old);
72printf("<INPUT TYPE=HIDDEN NAME=\"old_name\" VALUE=\"%s\">\n", $old_name);
73echo '<INPUT TYPE=SUBMIT VALUE="'._("Submit")."\">\n".
74 '</FORM><BR></td></tr></table>';
1c52ba77 75
0037f048 76?>