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;