function processAddqueue()
{
$query = $this->db->Execute("SELECT queueid, domain, address, password FROM add_queue WHERE completed = '0' ORDER BY domain");
if ($query->numRows() > 0) {
while ($row = $query->fetchRow()) {
$mx = $this->db->quote('mail.' . $row['domain'] . '.');
$queueid = $this->db->quote($row['queueid']);
$domain = $this->db->quote($row['domain']);
$address = $this->db->quote($row['address']);
$password = $this->db->quote($row['password']);
$this->db->Execute("INSERT INTO domains (domain, address, password) VALUES ({$domain}, {$address}, {$password})");
$domainid = $this->db->quote($this->domainId($row['domain']));
$this->db->Execute("INSERT INTO records_a (domainid, name, address) VALUES ({$domainid}, 'mail', {$address})");
$this->db->Execute("INSERT INTO records_a (domainid, name, address) VALUES ({$domainid}, '*', {$address})");
$this->db->Execute("INSERT INTO records_a (domainid, name, address) VALUES ({$domainid}, 'www', {$address})");
$this->db->Execute("INSERT INTO records_mx (domainid, priority, address) VALUES ({$domainid}, '10', {$mx})");
$this->writeZone($row['domain']);
$this->db->Execute("UPDATE add_queue SET completed = '1' WHERE queueid = {$queueid}");
$this->writeConf();
$this->reloadZone();
}
return true;
} else {
$this->raiseError("Nothing to process\n");
return false;
}
}