mirror of
https://github.com/webmin/webmin.git
synced 2026-05-06 15:20:29 +01:00
29 lines
546 B
Perl
Executable File
29 lines
546 B
Perl
Executable File
#!/usr/local/bin/perl
|
|
|
|
require './filemin-lib.pl';
|
|
&ReadParse();
|
|
|
|
if (!$in{'name'}) {
|
|
&redirect("index.cgi?path=".&urlize($path));
|
|
}
|
|
|
|
get_paths();
|
|
if (-e "$cwd/$in{'name'}") {
|
|
print_errors("$in{'name'} $text{'error_exists'}");
|
|
}
|
|
else {
|
|
if (!can_move("$cwd/$in{'file'}", $cwd)) {
|
|
print_errors(
|
|
"$in{'file'} - $text{'error_move'}");
|
|
}
|
|
elsif (&rename_file($cwd.'/'.$in{'file'},
|
|
$cwd.'/'.$in{'name'})) {
|
|
&redirect("index.cgi?path=".
|
|
&urlize($path));
|
|
}
|
|
else {
|
|
print_errors(
|
|
"$text{'error_rename'} $in{'file'}: $!");
|
|
}
|
|
}
|