dns master is hive

This commit is contained in:
Peter Hormanns 2017-03-31 18:24:05 +02:00
parent 174c0a7706
commit 9db05ea509
2 changed files with 6 additions and 4 deletions

View File

@ -95,7 +95,6 @@ public class DomainModuleImpl extends AbstractModuleImpl {
Domain dom = (Domain) newEntity; Domain dom = (Domain) newEntity;
Date now = new Date(); Date now = new Date();
dom.setSince(now); dom.setSince(now);
dom.setDnsMaster("dns.hostsharing.net");
if (dom.getName() == null || dom.getName().length() == 0) { if (dom.getName() == null || dom.getName().length() == 0) {
throw new HSAdminException("domain name required"); throw new HSAdminException("domain name required");
} }
@ -108,10 +107,13 @@ public class DomainModuleImpl extends AbstractModuleImpl {
userQuery.setParameter("username", admin.getName()); userQuery.setParameter("username", admin.getName());
admin = (UnixUser) userQuery.getSingleResult(); admin = (UnixUser) userQuery.getSingleResult();
//TODO: Needs better implementation //TODO: Needs better implementation
String pacType = admin.getPac().getBasepac().getName(); final Pac pac = admin.getPac();
String pacType = pac.getBasepac().getName();
if (!pacType.equals(BasePacType.PAC_WEB) && !pacType.equals(BasePacType.PAC_DW) && !pacType.equals(BasePacType.PAC_SW)) { if (!pacType.equals(BasePacType.PAC_WEB) && !pacType.equals(BasePacType.PAC_DW) && !pacType.equals(BasePacType.PAC_SW)) {
throw new HSAdminException("not allowed for this packet type"); throw new HSAdminException("not allowed for this packet type");
} }
final String hiveName = pac.getHive().getHiveName();
dom.setDnsMaster(hiveName + ".hostsharing.net");
// Standard domainoptions setzen. TODO: Alle defaults über eigene Klasse aus der Datenbank holen. // Standard domainoptions setzen. TODO: Alle defaults über eigene Klasse aus der Datenbank holen.
UnixUser loginUser = getTransaction().getLoginUser(); UnixUser loginUser = getTransaction().getLoginUser();
if (!loginUser.hasHostmasterRole()) { if (!loginUser.hasHostmasterRole()) {

View File

@ -1,5 +1,5 @@
$TTL 6H $TTL 6H
${dom.name}. IN SOA ${hive.name}.hostsharing.net. hostmaster.hostsharing.net. ( ${dom.name}. IN SOA ${dom.dnsMaster}.hostsharing.net. hostmaster.hostsharing.net. (
${sio} ; serial secs since Jan 1 1970 ${sio} ; serial secs since Jan 1 1970
6H ; refresh (>=10000) 6H ; refresh (>=10000)
1H ; retry (>=1800) 1H ; retry (>=1800)