Changes for 2.1.3:
[BackupPC.git] / cgi-bin / BackupPC_Admin
index 8dc2091..8dbcadf 100755 (executable)
@@ -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.3, released 21 Jan 2007.
 #
 # See http://backuppc.sourceforge.net.
 #
@@ -49,7 +49,7 @@ use strict;
 no  utf8;
 use CGI;
 use CGI::Carp qw(fatalsToBrowser);
-use lib "/usr/local/BackupPC/lib";
+use lib "/usr/local/BackupPC2.1.0/lib";
 
 use BackupPC::Lib;
 use BackupPC::CGI::Lib qw(:all);
@@ -86,10 +86,21 @@ my %ActionDispatch = (
 # Set default actions, then call sub handler
 #
 $In{action} ||= "hostInfo"    if ( defined($In{host}) );
-## rk default non admin users to pc summary for their hosts
-$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/BackupPC2.1.0/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}();