Skip to content

Commit

Permalink
Fixup userscan detect
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul authored and Paul committed Jul 30, 2020
1 parent ac2cf18 commit bfd5300
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/lib/Maldet.pm
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ sub parse_report {
sub enabled {
my $config = Config::Tiny->new;
$config = Config::Tiny->read( $LMD_CONF );
return "$config->{_}->{scan_user_access}" || '0';
return ($config->{_}->{scan_user_access} eq '"1"') ? 1:0;
}

1;
4 changes: 2 additions & 2 deletions src/lib/WHM/Maldet.pm
Original file line number Diff line number Diff line change
Expand Up @@ -183,14 +183,14 @@ sub load_mdconfig {
sub enable_userscan {
my $config = Config::Tiny->new;
$config = Config::Tiny->read( $LMD_CONF );
$config->{_}->{'scan_user_access'} = 1;
$config->{_}->{'scan_user_access'} = '"1"';
$config->write( $LMD_CONF );
}

sub disable_userscan {
my $config = Config::Tiny->new;
$config = Config::Tiny->read( $LMD_CONF );
$config->{_}->{'scan_user_access'} = 0;
$config->{_}->{'scan_user_access'} = '"0"';
$config->write( $LMD_CONF );
}

Expand Down
2 changes: 1 addition & 1 deletion src/templates/maldet.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Use the panels below to configure LMD.
<input type="submit" class="btn btn-primary" value="Edit Config">
</form>

[% IF mdconfig.scan_user_access == '1' %]
[% IF mdconfig.scan_user_access == '"1"' %]
<form method="POST" action="index.cgi?cgiaction=disableuser">
<input type="submit" class="btn btn-primary" value="Disable Userscan">
</form>
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.3.3
0.3.4

0 comments on commit bfd5300

Please sign in to comment.