- my $uselist = new File::UseList(listfile => $config{'uselist_file'},
- lockfile => $config{'lock_file'},
- timeout => $config{'lock_timeout'});
+ my $uselist = new File::UseList(listfile => $config->{'uselist_file'},
+ lockfile => $config->{'lock_file'},
+ timeout => $config->{'lock_timeout'});
- $uselist->lock or abort("Locking of $config{'uselist_file'} failed. Try it again in a moment. If the problem persists, ask someone to recreate the lock file ($config{'lock_file'}).");
+ $uselist->lock or abort($config->{'errors'}->{'lock_failed'},undef,{USELIST => $uselist->{'listfile'}, LOCK_FILE => $uselist->{'lockfile'}});
$uselist->load;
$uselist->load;
- # Create a hash with data submitted by user
- # (the CGI and the File::UseList object will also be included)
+ # Create a hash containing data submitted by the user
+ # (some other necessary information are also included)
my %data = (physical => $physical,
virtual => $virtual,
new_physical => $new_physical,
new_virtual => $new_virtual,
uselist => $uselist,
my %data = (physical => $physical,
virtual => $virtual,
new_physical => $new_physical,
new_virtual => $new_virtual,
uselist => $uselist,
- cgi => $cgi);
+ cgi => $cgi,
+ version => $VERSION,
+ configfile => CONFIGFILE);
+
+ # Execute the command...
+
+ my $output = exec_command($command,\%data,$config);
- my $output = exec_command($command,\%data,\%config); # Execute the command...
+ # ... unlock the list with files in use and show the output of the command
- $uselist->unlock; # ... unlock the list with files in use...
- print $$output; # ... and print the output of the command
+ $uselist->unlock or abort($config->{'errors'}->{'unlock_failed'},undef,{USELIST => $uselist->{'listfile'}, LOCK_FILE => $uselist->{'lockfile'}});
+ print $$output;
}
else
{
}
else
{
- abort("Accessing files and directories above the virtual root directory is forbidden.");