From b7b633bf1974c9f58139873a2693d1c16ecf1dfb Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Sat, 14 Aug 2010 09:27:31 -0500 Subject: [PATCH] update fixWgaccess.pl for WebGUI 8 --- sbin/fixWgaccess.pl | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/sbin/fixWgaccess.pl b/sbin/fixWgaccess.pl index bc1930f42..53d2bfb6d 100644 --- a/sbin/fixWgaccess.pl +++ b/sbin/fixWgaccess.pl @@ -10,19 +10,18 @@ # http://www.plainblack.com info@plainblack.com #------------------------------------------------------------------- -$|++; # disable output buffering -our ($webguiRoot, $configFile, $help, $man); - -BEGIN { - $webguiRoot = ".."; - unshift (@INC, $webguiRoot."/lib"); -} - use strict; -use Pod::Usage; use Getopt::Long; +use Pod::Usage; +use WebGUI::Paths -inc; use WebGUI::Session; +my $configFile; +my $help; +my $man; + +$| = 1; # No buffering + # Get parameters here, including $help GetOptions( 'configFile=s' => \$configFile, @@ -34,7 +33,7 @@ pod2usage( verbose => 1 ) if $help; pod2usage( verbose => 2 ) if $man; pod2usage( msg => "Must specify a config file!" ) unless $configFile; -my $session = start( $webguiRoot, $configFile ); +my $session = start( $configFile ); use WebGUI::Asset::File; my $iter = WebGUI::Asset::File->getIsa($session); @@ -56,9 +55,8 @@ finish($session); #---------------------------------------------------------------------------- sub start { - my $webguiRoot = shift; my $configFile = shift; - my $session = WebGUI::Session->open($webguiRoot,$configFile); + my $session = WebGUI::Session->open($configFile); $session->user({userId=>3}); return $session;