-
Notifications
You must be signed in to change notification settings - Fork 3
/
checks-lib.pl
57 lines (48 loc) · 1.05 KB
/
checks-lib.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
require 'jru-lib.pl';
sub check_firewall() {
if(has_command('firewall-cmd')){
return 1;
}
return 0;
}
sub check_info_page_is_enabled(){
my %prop_env;
read_env_file(get_prop_file(), \%prop_env);
if($prop_env{'infoPageIsEnabled'} eq 'true'){
return 1;
}
return 0;
}
sub check_ip_addresses_allowed_is_enabled(){
my %prop_env;
read_env_file(get_prop_file(), \%prop_env);
if($prop_env{'ipAddressesAllowed'} || $prop_env{'ipAddressListAllowed'}){
return 0;
}
return 1;
}
sub check_reports_demo(){
if(-d get_jasper_home().'/reports/demo'){
return 1;
}
return 0;
}
sub check_prop_passwords(){
my $lref = &read_file_lines(get_prop_file(), 1);
my $lnum = 0;
foreach my $line (@$lref){
chomp($line);
#all encrypted passwords start with 1:
if($line =~ /^password=(?!1:)/){
return 1;
}
$lnum++;
}
return 0;
}
sub print_fix_form{
my ($msg, $mode) = @_;
print &ui_form_start("checks.cgi", "post");
print &ui_hidden('mode', $mode);
print &ui_form_end([ [ "", $text{'check_fix_now'}, ' '.$msg ] ]);
}