X-Git-Url: http://git.rot13.org/?p=BackupPC.git;a=blobdiff_plain;f=cgi-bin%2FBackupPC_Admin;h=32293dfaf5ca0f38146a29b6427d5af940460979;hp=8dc2091b774b8f4b3466057d01e3113c609c16ae;hb=2460880d23902e74d5d8541f9c2fbb9538eaf4cb;hpb=a7e968ce327855f2ba2624ca8517069a936c9b5b diff --git a/cgi-bin/BackupPC_Admin b/cgi-bin/BackupPC_Admin index 8dc2091..32293df 100755 --- a/cgi-bin/BackupPC_Admin +++ b/cgi-bin/BackupPC_Admin @@ -1,4 +1,4 @@ -#!/bin/perl -T +#!/bin/perl #============================================================= -*-perl-*-w # # BackupPC_Admin: Apache/CGI interface for BackupPC. @@ -39,7 +39,7 @@ # #======================================================================== # -# Version 2.1.0_CVS, released 3 Jul 2003. +# Version 2.1.0_CVS, released 8 Feb 2004. # # See http://backuppc.sourceforge.net. # @@ -90,6 +90,19 @@ $In{action} ||= "hostInfo" if ( defined($In{host}) ); $In{action} = "summary" if ( !defined($ActionDispatch{$In{action}}) && !CheckPermission()); $In{action} = "generalInfo" if ( !defined($ActionDispatch{$In{action}}) ); my $action = $ActionDispatch{$In{action}}; + +# +# For some reason under mod_perl, the use lib above is unreliable, +# and sometimes the module below cannot be found. Explicitly push +# the directory onto INC if it is missing. This is an ugly hack; +# need to figure out what's really going on... +# +my $installDir = '/usr/local/BackupPC/lib'; +push(@INC, $installDir) if ( !grep($_ eq $installDir, @INC) ); + +# +# Load the relevant action script and run it +# require "BackupPC/CGI/$action.pm" if ( !defined($BackupPC::CGI::{"${action}::"}) ); $BackupPC::CGI::{"${action}::"}{action}();