@@ -52,8 +52,9 @@ discard block |
||
52 | 52 | // set address types array |
53 | 53 | $Tools->get_addresses_types (); |
54 | 54 | // change scan type? |
55 | -if(@$config['ping_check_method']) |
|
56 | -$Scan->reset_scan_method ($config['ping_check_method']); |
|
55 | +if(@$config['ping_check_method']) { |
|
56 | + $Scan->reset_scan_method ($config['ping_check_method']); |
|
57 | +} |
|
57 | 58 | |
58 | 59 | // set ping statuses |
59 | 60 | $statuses = explode(";", $Scan->settings->pingStatus); |
@@ -96,7 +97,7 @@ discard block |
||
96 | 97 | |
97 | 98 | $subnet_addresses = $Addresses->fetch_subnet_addresses ($s->id); |
98 | 99 | //set array for fping |
99 | - if($Scan->icmp_type=="fping") { |
|
100 | + if($Scan->icmp_type=="fping") { |
|
100 | 101 | $subnets[] = array( |
101 | 102 | "id" =>$s->id, |
102 | 103 | "cidr" =>$Subnets->transform_to_dotted($s->subnet)."/".$s->mask, |
@@ -110,7 +111,7 @@ discard block |
||
110 | 111 | //ignore excludePing |
111 | 112 | if($a->excludePing!=1) { |
112 | 113 | //create different array for fping |
113 | - if($Scan->icmp_type=="fping") { |
|
114 | + if($Scan->icmp_type=="fping") { |
|
114 | 115 | $addresses2[$s->id][$a->id] = array( |
115 | 116 | "id" =>$a->id, |
116 | 117 | "ip_addr" =>$a->ip_addr, |
@@ -335,7 +336,7 @@ discard block |
||
335 | 336 | // now offline, and diff > offline period, do checks |
336 | 337 | elseif($change['lastSeenNew']==NULL && $deviceDiff >= (int) $statuses[1]) { |
337 | 338 | // if not already reported |
338 | - if ($deviceDiff <= ((int) $statuses[1] + $agentDiff)) { |
|
339 | + if ($deviceDiff <= ((int) $statuses[1] + $agentDiff)) { |
|
339 | 340 | $address_change[$k]['oldStatus'] = 0; |
340 | 341 | $address_change[$k]['newStatus'] = 2; |
341 | 342 | // update tag if not already offline |
@@ -457,7 +458,8 @@ discard block |
||
457 | 458 | //ago |
458 | 459 | if(is_null($change['lastSeen']) || $change['lastSeen']=="1970-01-01 00:00:01" || $change['lastSeen']=="0000-00-00 00:00:00") { |
459 | 460 | $ago = "never"; |
460 | - } else { |
|
461 | + } |
|
462 | + else { |
|
461 | 463 | $timeDiff = $now - strtotime($change['lastSeen']); |
462 | 464 | |
463 | 465 | // reformat |
@@ -69,7 +69,8 @@ discard block |
||
69 | 69 | require_once( dirname(__FILE__).'/../PHPMailer/src/SMTP.php'); |
70 | 70 | |
71 | 71 | $this->Php_mailer = new PHPMailer\PHPMailer\PHPMailer(); |
72 | - } else { |
|
72 | + } |
|
73 | + else { |
|
73 | 74 | throw new Exception(_('PHPMailer submodule is missing.')); |
74 | 75 | } |
75 | 76 | |
@@ -120,7 +121,8 @@ discard block |
||
120 | 121 | $this->Php_mailer->SMTPAuth = true; |
121 | 122 | $this->Php_mailer->Username = $this->mail_settings->muser; |
122 | 123 | $this->Php_mailer->Password = $this->mail_settings->mpass; |
123 | - } else { |
|
124 | + } |
|
125 | + else { |
|
124 | 126 | $this->Php_mailer->SMTPAuth = false; |
125 | 127 | } |
126 | 128 | } |