Solves #588, #587
Does a dynamic lookup on all tables that use device_id or host and deletes entries containing the appropriate device_id.
The fields to lookup for are stored in an array so it can be extended when required for non-standardized tables.
Code was tested against a historically grown setup and removed all traces of the host from the DB.
Future proof db-cleanup on device deletion.
Added Debug-Info if required.
Added nl2br to GUI's output of delete_device
Should we think about adding a more scary warning to the device deletion UI? I can think of scenarios where deleting alerts & event logs immediately might not be the best thing to do, and people should be warned that that's what device deletion does.
@paulgear the data becomes useless as the devices's ID is the only glue. This glue is deleted from the devices-table. The remain is a scattered fragmented table where nobody knows what deviceID was what device and the UI will fail displaying it as well (blank fields)
If one needs the logs, he cannot delete the host but only 'ignore' it.
It's worth making people aware of what is going to happen though, I'll create an issue now.
Issue #600 created