diff --git a/app/devices/app_languages.php b/app/devices/app_languages.php index 41cccf4e2d..56e6af0d3a 100644 --- a/app/devices/app_languages.php +++ b/app/devices/app_languages.php @@ -1402,6 +1402,16 @@ $text['label-device_description']['de-at'] = "Beschreibung"; $text['label-device_description']['ar-eg'] = ""; $text['label-device_description']['he'] = "תאור"; +$text['label-device_status']['en-us'] = "Status"; +$text['label-device_status']['es-cl'] = "Estado"; +$text['label-device_status']['pt-pt'] = "Estado"; +$text['label-device_status']['fr-fr'] = "Statut"; +$text['label-device_status']['pt-br'] = "Estado"; +$text['label-device_status']['pl'] = "Status "; +$text['label-device_status']['sv-se'] = "Status"; +$text['label-device_status']['uk'] = "Стан"; +$text['label-device_status']['de-at'] = "Status"; + $text['label-device']['en-us'] = "Device"; $text['label-device']['es-cl'] = "Dispositivo"; $text['label-device']['pt-pt'] = "Dispositivo"; diff --git a/app/devices/devices.php b/app/devices/devices.php index 5f9a775fc1..067666c90d 100644 --- a/app/devices/devices.php +++ b/app/devices/devices.php @@ -214,6 +214,7 @@ echo th_order_by('device_vendor', $text['label-device_vendor'], $order_by, $order); echo th_order_by('device_template', $text['label-device_template'], $order_by, $order); echo th_order_by('device_enabled', $text['label-device_enabled'], $order_by, $order); + echo th_order_by('device_status', $text['label-device_status'], $order_by, $order); echo th_order_by('device_description', $text['label-device_description'], $order_by, $order); echo "\n"; if (permission_exists('device_add')) { @@ -248,6 +249,7 @@ echo " ".$row['device_vendor']." \n"; echo " ".$row['device_template']." \n"; echo " ".$text['label-'.$row['device_enabled']]." \n"; + echo " ".$row['device_provisioned_on']." - ".$row['device_provisioned_by']." \n"; echo " ".$row['device_description']." \n"; echo " "; if (permission_exists('device_edit')) { diff --git a/app/provision/index.php b/app/provision/index.php index 993e1865d5..00781afed3 100644 --- a/app/provision/index.php +++ b/app/provision/index.php @@ -372,6 +372,21 @@ The file name is fixed to `Account1_Extern.xml`. $prov->file = $file; $file_contents = $prov->render(); +//register that we have seen the device + $sql = "UPDATE v_devices "; + $sql .= "SET device_provisioned_on=:device_provisioned_on, device_provisioned_by=:device_provisioned_by "; + $sql .= "WHERE domain_uuid=:domain_uuid AND device_mac_address=:device_mac "; + $prep_statement = $db->prepare(check_sql($sql)); + if ($prep_statement) { + //use the prepared statement + $prep_statement->bindValue(':domain_uuid', $domain_uuid); + $prep_statement->bindValue(':device_mac', strtolower($mac)); + $prep_statement->bindValue(':device_provisioned_on', date("Y-m-d H:i:s")); + $prep_statement->bindValue(':device_provisioned_by', "HTTP"); + $prep_statement->execute(); + unset($prep_statement); + } + //deliver the customized config over HTTP/HTTPS //need to make sure content-type is correct if ($_REQUEST['content_type'] == 'application/octet-stream') {