Skip to content

Commit

Permalink
Pass total into constructor properly
Browse files Browse the repository at this point in the history
  • Loading branch information
swelljoe committed Jul 28, 2017
1 parent e5fdeb8 commit 3315e17
Show file tree
Hide file tree
Showing 31 changed files with 61 additions and 61 deletions.
4 changes: 2 additions & 2 deletions lib/Virtualmin/Config.pm
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ sub run {

my @plugins = $self->_gather_plugins();
@plugins = $self->_order_plugins(@plugins);
my $total = $#plugins;
my $total = scalar @plugins;
$log->info("Total plugins to be run: $total");
for (@plugins) {
my $pkg = "Virtualmin::Config::Plugin::$_";
load $pkg || die "Loading Plugin failed: $_";
my $plugin = $pkg->new({$total => $total});
my $plugin = $pkg->new({total => $total});
$plugin->actions();
if ($self->{test} && $plugin->can('tests')) {
$plugin->tests();
Expand Down
2 changes: 1 addition & 1 deletion lib/Virtualmin/Config/Plugin/AWStats.pm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ our (%gconfig, %miniserv);
our $trust_unknown_referers = 1;

sub new {
my $class = shift;
my ($class, %args) = @_;

# inherit from Plugin
my $self = $class->SUPER::new(name => 'AWStats', depends => ['Apache']);
Expand Down
4 changes: 2 additions & 2 deletions lib/Virtualmin/Config/Plugin/Apache.pm
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ our $trust_unknown_referers = 1;
my $log = Log::Log4perl->get_logger("virtualmin-config-system");

sub new {
my $class = shift;
my ($class, %args) = @_;

# inherit from Plugin
my $self = $class->SUPER::new(name => 'Apache');
my $self = $class->SUPER::new(name => 'Apache', %args);

return $self;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Virtualmin/Config/Plugin/Bind.pm
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ our (%gconfig, %miniserv);
our $trust_unknown_referers = 1;

sub new {
my $class = shift;
my ($class, %args) = @_;

# inherit from Plugin
my $self = $class->SUPER::new(name => 'Bind');
my $self = $class->SUPER::new(name => 'Bind', %args);

return $self;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Virtualmin/Config/Plugin/ClamAV.pm
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ our (%gconfig, %miniserv);
our $trust_unknown_referers = 1;

sub new {
my $class = shift;
my ($class, %args) = @_;

# inherit from Plugin
my $self = $class->SUPER::new(name => 'ClamAV');
my $self = $class->SUPER::new(name => 'ClamAV', %args);

return $self;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Virtualmin/Config/Plugin/Dovecot.pm
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ our (%gconfig, %miniserv);
our $trust_unknown_referers = 1;

sub new {
my $class = shift;
my ($class, %args) = @_;

# inherit from Plugin
my $self = $class->SUPER::new(name => 'Dovecot');
my $self = $class->SUPER::new(name => 'Dovecot', %args);

return $self;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Virtualmin/Config/Plugin/Fail2ban.pm
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ our (%gconfig, %miniserv);
our $trust_unknown_referers = 1;

sub new {
my $class = shift;
my ($class, %args) = @_;

# inherit from Plugin
my $self = $class->SUPER::new(name => 'Fail2ban', depends => ['Firewall']);
my $self = $class->SUPER::new(name => 'Fail2ban', depends => ['Firewall'], %args);

return $self;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Virtualmin/Config/Plugin/Fail2banFirewalld.pm
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ our (%gconfig, %miniserv);
our $trust_unknown_referers = 1;

sub new {
my $class = shift;
my ($class, %args) = @_;

# inherit from Plugin
my $self = $class->SUPER::new(name => 'Fail2banFirewalld', depends => ['Firewalld']);
my $self = $class->SUPER::new(name => 'Fail2banFirewalld', depends => ['Firewalld'], %args);

return $self;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Virtualmin/Config/Plugin/Firewall.pm
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ our $trust_unknown_referers = 1;
my $log = Log::Log4perl->get_logger("virtualmin-config-system");

sub new {
my $class = shift;
my ($class, %args) = @_;

# inherit from Plugin
my $self = $class->SUPER::new(name => 'Firewall');
my $self = $class->SUPER::new(name => 'Firewall', %args);

return $self;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Virtualmin/Config/Plugin/Firewalld.pm
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ our (%gconfig, %miniserv);
our $trust_unknown_referers = 1;

sub new {
my $class = shift;
my ($class, %args) = @_;

# inherit from Plugin
my $self = $class->SUPER::new(name => 'Firewalld');
my $self = $class->SUPER::new(name => 'Firewalld', %args);

return $self;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Virtualmin/Config/Plugin/MySQL.pm
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ our (%gconfig, %miniserv);
our $trust_unknown_referers = 1;

sub new {
my $class = shift;
my ($class, %args) = @_;

# inherit from Plugin
my $self = $class->SUPER::new(name => 'MySQL');
my $self = $class->SUPER::new(name => 'MySQL', %args);

return $self;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Virtualmin/Config/Plugin/NTP.pm
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ use Time::HiRes qw( sleep );
my $log = Log::Log4perl->get_logger("virtualmin-config-system");

sub new {
my $class = shift;
my ($class, %args) = @_;

# inherit from Plugin
my $self = $class->SUPER::new(name => 'NTP');
my $self = $class->SUPER::new(name => 'NTP', %args);

return $self;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Virtualmin/Config/Plugin/Net.pm
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ our (%gconfig, %miniserv);
our $trust_unknown_referers = 1;

sub new {
my $class = shift;
my ($class, %args) = @_;

# inherit from Plugin
my $self = $class->SUPER::new(name => 'Net');
my $self = $class->SUPER::new(name => 'Net', %args);

return $self;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Virtualmin/Config/Plugin/Nginx.pm
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ our (%gconfig, %miniserv);
our $trust_unknown_referers = 1;

sub new {
my $class = shift;
my ($class, %args) = @_;

# inherit from Plugin
my $self = $class->SUPER::new(name => 'Nginx');
my $self = $class->SUPER::new(name => 'Nginx', %args);

return $self;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Virtualmin/Config/Plugin/Postfix.pm
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ our $trust_unknown_referers = 1;
my $log = Log::Log4perl->get_logger("virtualmin-config-system");

sub new {
my $class = shift;
my ($class, %args) = @_;

# inherit from Plugin
my $self = $class->SUPER::new(name => 'Postfix', depends => ['Net']);
my $self = $class->SUPER::new(name => 'Postfix', depends => ['Net'], %args);

return $self;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Virtualmin/Config/Plugin/PostgreSQL.pm
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ our (%gconfig, %miniserv);
our $trust_unknown_referers = 1;

sub new {
my $class = shift;
my ($class, %args) = @_;

# inherit from Plugin
my $self = $class->SUPER::new(name => 'PostgreSQL');
my $self = $class->SUPER::new(name => 'PostgreSQL', %args);

return $self;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Virtualmin/Config/Plugin/ProFTPd.pm
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ our $trust_unknown_referers = 1;
my $log = Log::Log4perl->get_logger("virtualmin-config-system");

sub new {
my $class = shift;
my ($class, %args) = @_;

# inherit from Plugin
my $self = $class->SUPER::new(name => 'ProFTPd');
my $self = $class->SUPER::new(name => 'ProFTPd', %args);

return $self;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Virtualmin/Config/Plugin/Procmail.pm
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ our (%gconfig, %miniserv);
our $trust_unknown_referers = 1;

sub new {
my $class = shift;
my ($class, %args) = @_;

# inherit from Plugin
my $self = $class->SUPER::new(name => 'Procmail');
my $self = $class->SUPER::new(name => 'Procmail', %args);

return $self;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Virtualmin/Config/Plugin/Quotas.pm
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ our (%gconfig, %miniserv);
our $trust_unknown_referers = 1;

sub new {
my $class = shift;
my ($class, %args) = @_;

# inherit from Plugin
my $self = $class->SUPER::new(name => 'Quotas');
my $self = $class->SUPER::new(name => 'Quotas', %args);

return $self;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Virtualmin/Config/Plugin/SASL.pm
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ our (%gconfig, %miniserv);
our $trust_unknown_referers = 1;

sub new {
my $class = shift;
my ($class, %args) = @_;

# inherit from Plugin
my $self = $class->SUPER::new(name => 'SASL');
my $self = $class->SUPER::new(name => 'SASL', %args);

return $self;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Virtualmin/Config/Plugin/SELinux.pm
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ our (%gconfig, %miniserv);
our $trust_unknown_referers = 1;

sub new {
my $class = shift;
my ($class, %args) = @_;

# inherit from Plugin
my $self = $class->SUPER::new(name => 'SELinux');
my $self = $class->SUPER::new(name => 'SELinux', %args);

return $self;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Virtualmin/Config/Plugin/Shells.pm
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ our (%gconfig, %miniserv);
our $trust_unknown_referers = 1;

sub new {
my $class = shift;
my ($class, %args) = @_;

# inherit from Plugin
my $self = $class->SUPER::new(name => 'Shells');
my $self = $class->SUPER::new(name => 'Shells', %args);

return $self;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Virtualmin/Config/Plugin/SpamAssassin.pm
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ our (%gconfig, %miniserv);
our $trust_unknown_referers = 1;

sub new {
my $class = shift;
my ($class, %args) = @_;

# inherit from Plugin
my $self = $class->SUPER::new(name => 'SpamAssassin');
my $self = $class->SUPER::new(name => 'SpamAssassin', %args);

return $self;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Virtualmin/Config/Plugin/Status.pm
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ our (%gconfig, %miniserv);
our $trust_unknown_referers = 1;

sub new {
my $class = shift;
my ($class, %args) = @_;

# inherit from Plugin
my $self = $class->SUPER::new(name => 'Status');
my $self = $class->SUPER::new(name => 'Status', %args);

return $self;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Virtualmin/Config/Plugin/Test.pm
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ use parent 'Virtualmin::Config::Plugin';
use Log::Log4perl;

sub new {
my $class = shift;
my ($class, %args) = @_;

# inherit from Plugin
my $self = $class->SUPER::new(name => 'Test');
my $self = $class->SUPER::new(name => 'Test', %args);
return $self;
}

Expand Down
4 changes: 2 additions & 2 deletions lib/Virtualmin/Config/Plugin/Test2.pm
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ use 5.010;
use parent qw(Virtualmin::Config::Plugin);

sub new {
my $class = shift;
my ($class, %args) = @_;

# inherit from Plugin
my $self = $class->SUPER::new(name => 'Test2', depends => ['Test']);
my $self = $class->SUPER::new(name => 'Test2', depends => ['Test'], %args);

return $self;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Virtualmin/Config/Plugin/Upgrade.pm
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ our (%gconfig, %miniserv);
our $trust_unknown_referers = 1;

sub new {
my $class = shift;
my ($class, %args) = @_;

# inherit from Plugin
my $self = $class->SUPER::new(name => 'Upgrade');
my $self = $class->SUPER::new(name => 'Upgrade', %args);

return $self;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Virtualmin/Config/Plugin/Usermin.pm
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ our (%gconfig, %uconfig, %uminiserv);
our $trust_unknown_referers = 1;

sub new {
my $class = shift;
my ($class, %args) = @_;

# inherit from Plugin
my $self = $class->SUPER::new(name => 'Usermin');
my $self = $class->SUPER::new(name => 'Usermin', %args);

return $self;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Virtualmin/Config/Plugin/Virtualmin.pm
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ our (%gconfig, %miniserv);
our $trust_unknown_referers = 1;

sub new {
my $class = shift;
my ($class, %args) = @_;

# inherit from Plugin
my $self = $class->SUPER::new(name => 'Virtualmin', depends => ['Usermin']);
my $self = $class->SUPER::new(name => 'Virtualmin', depends => ['Usermin'], %args);

return $self;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Virtualmin/Config/Plugin/Webalizer.pm
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ our (%gconfig, %miniserv);
our $trust_unknown_referers = 1;

sub new {
my $class = shift;
my ($class, %args) = @_;

# inherit from Plugin
my $self = $class->SUPER::new(name => 'Webalizer');
my $self = $class->SUPER::new(name => 'Webalizer', %args);

return $self;
}
Expand Down
Loading

0 comments on commit 3315e17

Please sign in to comment.