mirror of
https://github.com/webmin/webmin.git
synced 2025-07-20 16:48:46 +00:00
23 lines
551 B
Perl
Executable File
23 lines
551 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'}: $!");
|
|
}
|
|
}
|