Commit 8a3914ae authored by Florian Schaal's avatar Florian Schaal

update dns_slave_auto

parent 863be9ff
......@@ -54,7 +54,7 @@ class dns_dns_slave_auto_plugin {
function slave_insert($event_name, $page_form) {
global $app;
$soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = ?", $page_form);
$soa = $app->db->queryOneRecord("SELECT * FROM dns_soa WHERE id = ?", $page_form->id);
$insert_data = array(
'sys_userid' => $soa['sys_userid'],
'sys_groupid' => $soa['sys_groupid'],
......@@ -77,13 +77,15 @@ class dns_dns_slave_auto_plugin {
if($page_form->dataRecord['origin'] != $page_form->oldDataRecord['origin']) {
$slave_zone_recs = $app->db->queryAllRecords("SELECT * FROM dns_slave WHERE origin = ?", $page_form->oldDataRecord['origin']);
if(!$slave_zone_recs) $this->slave_insert($event_name, $page_form);
foreach($slave_zone_recs as $slave_zone) {
$app->db->datalogDelete('dns_slave', 'id', $slave_zone['id']);
$this->slave_insert('', $page_form->dataRecord['id']);
$this->slave_insert($event_name, $page_form);
}
}
if($page_form->dataRecord['active'] != $page_form->oldDataRecord['active']) {
$slave_zone_recs = $app->db->queryAllRecords("SELECT * FROM dns_slave WHERE origin = ?", $page_form->dataRecord['origin']);
if(!$slave_zone_recs) $this->slave_insert('update_insert', $page_form);
foreach($slave_zone_recs as $slave_zone) {
if($page_form->dataRecord['active'] == 'Y') {
$app->db->datalogUpdate('dns_slave', array('active' => 'Y'), 'id', $slave_zone['id']);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment