adding command test in apiserver\nsome debugging\nfree sms now running fine
This commit is contained in:
@ -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);
|
||||
|
||||
?>
|
||||
|
Reference in New Issue
Block a user