Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions build_bind.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,21 @@ function build_bind_server_domain_list($options="") {
return(array(3, $self['error'] . "\n"));
}

// For the given server id. find all domains for that server
list($status, $rows, $records) = db_get_records($onadb, 'dns_server_domains', array('host_id' => $shost['id']), '');
// For the given server id. find all domains for that server that need rebuilt
list($status, $rows, $records) = db_get_records($onadb, 'dns_server_domains', array('host_id' => $shost['id'], 'rebuild_flag' => 1), '');

//MP: TODO - for now this just returns a list of all the domains. In the future this could/should just return
// a list of domains that need refreshed. This would imply a version to do ALL and one for just UPDATED domains.
//This just returns a list of domains that need refreshed.
foreach ($records as $sdomain) {
list($status, $rows, $domain) = ona_get_domain_record(array('id' => $sdomain['domain_id']));
$text .= $domain['fqdn'] . "\n";
// TRIGGER: flag the current domain/server as built
list($status, $rows) = db_update_record($onadb, 'dns_server_domains', array('domain_id' => $sdomain['domain_id'], 'host_id' => $shost['id']), array('rebuild_flag' => 0));
if ($status) {
$self['error'] = "ERROR => db_update_record() Unable to update rebuild flags for domain.: {$self['error']}";
printmsg($self['error'],0);
return(array(7, $self['error'] . "\n"));
}

}

// Return the list
Expand All @@ -107,12 +114,6 @@ function build_bind_server_domain_list($options="") {









///////////////////////////////////////////////////////////////////////
// Function: build_bind_conf (string $options='')
//
Expand Down