There is one small modification that I would recommend. Instead of calling:
$app->db->query("UPDATE SET WHERE id = $id");
$app->db->datalogUpdate('dns_rr', "data = '$ip'", 'id', $id);
This will update the data in the dns_rr table and additionally create a record in the sys_datalog table which is read by the server process. This does not bring you any benefit at the moment, but your code will later benefit when:
- Other DNS plugins are available e.g. support for bind.
- If plugins at the server have to be called when a dns record changes. Without using the datalogUpdate function, your manual change would be simply ignored by all server related code.
- There is a history and undo function planned for the interface to track user interactions and to make it possible to revert changes. Without using this update function, your changes will not be tracked.