diff --git a/etc/WebGUI.conf.original b/etc/WebGUI.conf.original index ecb42db34..6cc8cad3f 100644 --- a/etc/WebGUI.conf.original +++ b/etc/WebGUI.conf.original @@ -5,4 +5,5 @@ logfile = /data/webgui.log extras = /extras uploadsURL = /uploads uploadsPath = /data/WebGUI/www/uploads +#skipHourly = #scripturl = / diff --git a/lib/Data/Config.pm b/lib/Data/Config.pm index 576f44c36..cdd949adb 100644 --- a/lib/Data/Config.pm +++ b/lib/Data/Config.pm @@ -486,8 +486,8 @@ sub param { ## get the value of the desired parameters for my $arg (@{$args->{'get'}}) { - carp("[$CLASS] Parameter '$arg' does not exist ") and next - if not exists $self->{'param'}{_case_($self, $arg)}; + #carp("[$CLASS] Parameter '$arg' does not exist ") and + next if not exists $self->{'param'}{_case_($self, $arg)}; push @retlist, $self->{'param'}{_case_($self, $arg)} } @@ -582,8 +582,8 @@ sub delete { my $self = shift; for my $param (@_) { - carp("[$CLASS] Parameter '$param' does not exist ") and next - if not exists $self->{'param'}{_case_($self, $param)}; + #carp("[$CLASS] Parameter '$param' does not exist ") and + next if not exists $self->{'param'}{_case_($self, $param)}; delete $self->{'param'}{_case_($self, $param)} } } diff --git a/sbin/runHourly.pl b/sbin/runHourly.pl index 49b084124..a1ff9524a 100644 --- a/sbin/runHourly.pl +++ b/sbin/runHourly.pl @@ -19,9 +19,10 @@ BEGIN { use DBI; use strict qw(subs vars); use Data::Config; +use WebGUI::Utility; -my (@files, $cmd, $namespace, $i, $file, $slash, $confdir, @plugins, $plugin, $plugdir); +my (@files, $cmd, $namespace, $file, $slash, $confdir, %plugins, $plugdir, $skip); $slash = ($^O =~ /Win/i) ? "\\" : "/"; $confdir = $webguiRoot.$slash."etc".$slash; $plugdir = $webguiRoot.$slash."sbin".$slash."Hourly".$slash; @@ -33,8 +34,7 @@ if (opendir (PLUGDIR,$plugdir)) { $namespace = $1; $cmd = "use Hourly::".$namespace; eval($cmd); - $plugins[$i] = "Hourly::".$namespace."::process"; - $i++; + $plugins{$namespace} = "Hourly::".$namespace."::process"; } } closedir(PLUGDIR); @@ -54,8 +54,13 @@ if (opendir (CONFDIR,$confdir)) { unless (eval {$dbh = DBI->connect($config->param('dsn'),$config->param('dbuser'),$config->param('dbpass'))}) { print "Can't connect to ".$config->param('dsn')." with info provided. Skipping.\n"; } else { - foreach $plugin (@plugins) { - &$plugin($dbh); + foreach $namespace (keys %plugins) { + $skip = $config->param('skipHourly'); + $skip =~ s/ //g; + unless (isIn($namespace, split(/,/,$skip))) { + $cmd = $plugins{$namespace}; + &$cmd($dbh); + } } $dbh->disconnect(); }