Private GIT

Skip to content
Snippets Groups Projects
Commit bd0bc685 authored by Daniel's avatar Daniel
Browse files

Force mac address update during status update scan

parent 7ddbfbb8
Branches
Tags
No related merge requests found
......@@ -71,8 +71,8 @@ if (sizeof($all_subnet_hosts)>0) {
// add to alive
$result[$Subnets->transform_address($r['ip'], "decimal")]['code'] = 0;
$result[$Subnets->transform_address($r['ip'], "decimal")]['status'] = "Online";
// update alive time
@$Scan->ping_update_lastseen($result[$Subnets->transform_address($r['ip'], "decimal")]['id']);
// update alive time and mac address
@$Scan->ping_update_lastseen($result[$Subnets->transform_address($r['ip'], "decimal")]['id'], $r['mac']);
}
}
}
......
......@@ -587,11 +587,11 @@ class Scan extends Common_functions {
* @param datetime $datetime
* @return void
*/
public function ping_update_lastseen ($id, $datetime = null) {
public function ping_update_lastseen ($id, $mac = null, $datetime = null) {
# set datetime
$datetime = is_null($datetime) ? date("Y-m-d H:i:s") : $datetime;
# execute
try { $this->Database->updateObject("ipaddresses", array("id"=>$id, "lastSeen"=>$datetime), "id"); }
try { $this->Database->updateObject("ipaddresses", array("id"=>$id, "mac"=>$mac, "lastSeen"=>$datetime), "id"); }
catch (Exception $e) {
!$this->debugging ? : $this->Result->show("danger", $e->getMessage(), false);
# log
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment