diff --git a/hsarback/database/data.sql b/hsarback/database/data.sql index 22438f2..9372b06 100644 --- a/hsarback/database/data.sql +++ b/hsarback/database/data.sql @@ -155,6 +155,6 @@ INSERT INTO unixuser (name, comment, shell, homedir, locked, packet_id, userid) -- table: domain_option -- INSERT INTO domain_option (domain_option_name) - VALUES ('graylisting'); + VALUES ('greylisting'); INSERT INTO domain_option (domain_option_name) VALUES ('htdocsfallback'); diff --git a/hsarback/src/de/hsadmin/mods/dom/DomainModuleImpl.java b/hsarback/src/de/hsadmin/mods/dom/DomainModuleImpl.java index 18ba7f6..49e9a5d 100644 --- a/hsarback/src/de/hsadmin/mods/dom/DomainModuleImpl.java +++ b/hsarback/src/de/hsadmin/mods/dom/DomainModuleImpl.java @@ -159,9 +159,6 @@ public class DomainModuleImpl extends AbstractModuleImpl { DomainOption.class.getAnnotation(javax.persistence.Entity.class).name() + " opt WHERE opt.name=:optName"); Set domainOptions = updatedDom.getDomainOptions(); -// if (domainOptions == null) { -// updatedDom.setDomainOptions(oldDom.getDomainOptions()); -// } for (DomainOption opt : domainOptions) { q.setParameter("optName", opt.getName()); List list = q.getResultList(); diff --git a/hsarback/src/de/hsadmin/remote/DomainRemote.java b/hsarback/src/de/hsadmin/remote/DomainRemote.java index f432859..c09f45c 100644 --- a/hsarback/src/de/hsadmin/remote/DomainRemote.java +++ b/hsarback/src/de/hsadmin/remote/DomainRemote.java @@ -43,8 +43,11 @@ public class DomainRemote extends AbstractRemote { } List domainOptionsList = new ArrayList(); resultMap.put("domainoptions", domainOptionsList); - for (DomainOption opt : dom.getDomainOptions()) { - domainOptionsList.add(opt.getName()); + Set domainOptions = dom.getDomainOptions(); + if (domainOptions != null) { + for (DomainOption opt : domainOptions) { + domainOptionsList.add(opt.getName()); + } } } diff --git a/hsarback/test/de/hsadmin/remote/DomainTest.java b/hsarback/test/de/hsadmin/remote/DomainTest.java index 60f489c..57fe078 100644 --- a/hsarback/test/de/hsadmin/remote/DomainTest.java +++ b/hsarback/test/de/hsadmin/remote/DomainTest.java @@ -155,7 +155,7 @@ public class DomainTest { Map setParams = new HashMap(); Map whereParams = new HashMap(); List optionslist = new ArrayList(); - optionslist.add("graylisting"); + optionslist.add("greylisting"); setParams.put("domainoptions", optionslist); whereParams.put("name", "example01.org"); Object[] params = new Object[] { user, @@ -177,7 +177,7 @@ public class DomainTest { Map whereParams = new HashMap(); List optionslist = new ArrayList(); optionslist.add("htdocsfallback"); - optionslist.add("graylisting"); + optionslist.add("greylisting"); setParams.put("domainoptions", optionslist); whereParams.put("name", "example01.org"); Object[] params = new Object[] { user, @@ -244,7 +244,7 @@ public class DomainTest { Object[] result = (Object[]) execute; assertEquals(result.length, 1); assertTrue(result[0] instanceof Map); - Map domainMap = (Map) result[0]; + Map domainMap = (Map) result[0]; assertNotNull(domainMap); Object[] optsList = (Object[])domainMap.get("domainoptions"); if (optsList == null) {