1
0

adding command test in apiserver\nsome debugging\nfree sms now running fine

This commit is contained in:
2022-07-10 19:33:19 +02:00
parent 97f8050d29
commit 555abb7c88
14 changed files with 182 additions and 66 deletions

View File

@ -1,4 +1,6 @@
<?php
require_once "events.php";
class alerte_intrusion extends hook
{
public $hookName = "alerte_intrusion";
@ -26,24 +28,30 @@ class alerte_intrusion extends hook
}
}
public function test()
public function testPortes()
{
global $indexDevices;
logger(DEBUG, _("Function alerte_intrusion->testPorte"), __FILE__ . ":" . __LINE__);
$msg = "";
foreach ($this->devicelist as $device => $property)
{
if($indexDevices[$device]->properties[$property] != false)
{
$msg .= $indexDevices->friendlyName . " is open" . EOL;
$msg .= $indexDevices[$device]->friendlyName . " is open" . EOL;
}
}
if ($msg != "")
if (!empty($msg))
{
logger(ALERT, $msg, __FILE__ . ":" . __LINE__);
}
return nl2br($msg);
}
}
$hooks["alerte_intrusion"] = new alerte_intrusion();
logger(DEBUG, _("Initializing event"), __FILE__ . ":" . __LINE__);
$function = array($hooks["alerte_intrusion"], "testPortes");
setRecurrentEvent($function, 0, 0, 0, 0, 0, 0, 21, 0, 0, 1, 0, 0, 0);
?>