From 9188fd5e4238605b23cd49e30b9458051505762d Mon Sep 17 00:00:00 2001 From: Peter Hormanns Date: Wed, 4 Jan 2012 14:46:45 +0000 Subject: [PATCH] subdomains to pacdomain are not allowed --- hsarback/src/de/hsadmin/mods/dom/DomainModuleImpl.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hsarback/src/de/hsadmin/mods/dom/DomainModuleImpl.java b/hsarback/src/de/hsadmin/mods/dom/DomainModuleImpl.java index ba4d456..e1e6df9 100644 --- a/hsarback/src/de/hsadmin/mods/dom/DomainModuleImpl.java +++ b/hsarback/src/de/hsadmin/mods/dom/DomainModuleImpl.java @@ -108,6 +108,9 @@ public class DomainModuleImpl extends AbstractModuleImpl { List resultList = domainQuery.getResultList(); if (resultList.size() > 0) { Domain superDom = (Domain) resultList.get(0); + if (superDom.isPacDomain()) { + throw new HSAdminException("subdomains to pacdomain " + superDom.getName() + " are not allowed"); + } if (loginUser.hasPacAdminRoleFor(superDom.getUser().getPac())) { break; // same pac } @@ -118,7 +121,7 @@ public class DomainModuleImpl extends AbstractModuleImpl { if (dnsCheck.checkDomain(dom.getName())) { break; } else { - throw new HSAdminException("domain " + dom.getName() + " is not delegated to " + dom.getDnsMaster()); + throw new AuthorisationException(loginUser, "add", dom); } } }