alsmanager_lib 1.0.58 → 1.0.59

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/modules.js +6 -4
  2. package/package.json +1 -1
package/lib/modules.js CHANGED
@@ -412,22 +412,24 @@ function insertNetwork(db_used, id_device, network_obj) {
412
412
  }
413
413
  function updateNetworkSQLite(id_device, network_obj) {
414
414
  var query = "update device_networks "
415
- query += "set id_device = " + id_device + ", ";
415
+ query += "set ";
416
416
  query += "net_type = '" + network_obj.tipo + "', ";
417
417
  query += "mac_address = '" + network_obj.mac_address + "', ";
418
418
  query += "ipv4_static = '" + network_obj.ipv4_static + "', ";
419
419
  query += "ipv6_static = '" + network_obj.ipv6_static + "' ";
420
- query += "where id = " + network_obj.id;
420
+ query += "where id = " + network_obj.id + " ";
421
+ query += "and id_device = " + id_device;
421
422
  return query;
422
423
  }
423
424
  function updateNetworkMySQL(id_device, network_obj) {
424
425
  var query = "update device_networks "
425
- query += "set id_device = :id_device, ";
426
+ query += "set ";
426
427
  query += "net_type = :tipo, ";
427
428
  query += "mac_address = :mac_address, ";
428
429
  query += "ipv4_static = :ipv4_static, ";
429
430
  query += "ipv6_static = :ipv6_static ";
430
- query += "where id = :id_network";
431
+ query += "where id = :id_network ";
432
+ query += "and id_device = :id_device";
431
433
  return query;
432
434
  }
433
435
  function updateNetwork(db_used, d_device, network_obj) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "alsmanager_lib",
3
- "version": "1.0.58",
3
+ "version": "1.0.59",
4
4
  "description": "Funzioni per ALSManager",
5
5
  "license": "ISC",
6
6
  "author": "Luca Cattani",