From: eldy <> Date: Mon, 22 Sep 2003 03:04:56 +0000 (+0000) Subject: webmin: added management of plugins X-Git-Tag: AWSTATS_5_9_BETA~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b2999b7bf4399da7c40d9917ecfed358de1337de;p=thirdparty%2FAWStats.git webmin: added management of plugins --- diff --git a/tools/webmin/awstats/awstats-lib.pl b/tools/webmin/awstats/awstats-lib.pl index 4ce00858..f0581f4f 100644 --- a/tools/webmin/awstats/awstats-lib.pl +++ b/tools/webmin/awstats/awstats-lib.pl @@ -80,14 +80,25 @@ while() { # Now add values for directives that were not present in old config file foreach my $key (keys %$conf) { - if ($key eq 'advanced') { next; } # param to know if plugin setup was loaded - if ($key =~ /^plugin_param_/) { next; } # param of a plugin not an awstats directive - if ($confchanged{$key}) { next; } # awstats directive already changed + if ($key eq 'advanced') { next; } # param to know if plugin setup section was opened + if ($key =~ /^plugin_/) { next; } # field from plugin section, not an awstats directive + if ($confchanged{$key}) { next; } # awstats directive already changed print FILETMP "\n"; print FILETMP "# Param $key added by AWStats Webmin module\n"; print FILETMP "$key=\"$conf->{$key}\"\n"; } +# Now add plugin load that were not already present in old config file +foreach my $key (keys %$conf) { + my $pluginname = $key; + if ($pluginname !~ s/^plugin_//) { next; } # not a plugin load row + if ($pluginname =~ /^param_/) { next; } # not a plugin load row + if ($confchanged{"plugin_$pluginname"}) { next; } # awstats directive or load plugin already changed + print FILETMP "\n"; + print FILETMP "# Plugin load for plugin $pluginname added by AWStats Webmin module\n"; + print FILETMP "LoadPlugin=\"$pluginname".($conf->{"plugin_param_$pluginname"}?" ".$conf->{"plugin_param_$pluginname"}:"")."\"\n"; +} + close(FILE); close(FILETMP);