From c010faacc164d4f2d31b77ce386ca9d99a3a4ad8 Mon Sep 17 00:00:00 2001
From: Peter Hormanns <peter.hormanns@hostsharing.net>
Date: Thu, 14 Jul 2011 17:38:07 +0200
Subject: [PATCH] create pac-domain

---
 hsarback/src/de/hsadmin/mods/pac/PacModuleImpl.java |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/hsarback/src/de/hsadmin/mods/pac/PacModuleImpl.java b/hsarback/src/de/hsadmin/mods/pac/PacModuleImpl.java
index 84d9c23..7b9d165 100644
--- a/hsarback/src/de/hsadmin/mods/pac/PacModuleImpl.java
+++ b/hsarback/src/de/hsadmin/mods/pac/PacModuleImpl.java
@@ -11,10 +11,12 @@
 import de.hsadmin.core.model.AbstractEntity;
 import de.hsadmin.core.model.AbstractModuleImpl;
 import de.hsadmin.core.model.AuthorisationException;
+import de.hsadmin.core.model.GenericModuleImpl;
 import de.hsadmin.core.model.HSAdminException;
 import de.hsadmin.core.util.TextUtil;
 import de.hsadmin.mods.cust.Contact;
 import de.hsadmin.mods.cust.Customer;
+import de.hsadmin.mods.dom.Domain;
 import de.hsadmin.mods.user.UnixUser;
 
 public class PacModuleImpl extends AbstractModuleImpl {
@@ -98,6 +100,11 @@
 		if (maxUid >= nUID) nUID = maxUid + 1;
 		admin.setUserId(nUID);
 		users.add(admin);
+		GenericModuleImpl helperModule = new GenericModuleImpl(getTransaction());
+		Domain pacDomain = new Domain();
+		pacDomain.setName(pac.getName() + ".hostsharing.net");
+		pacDomain.setUser(admin);
+		helperModule.add(pacDomain);
 		return super.add(newEntity);
 	}
 

--
Gitblit v1.9.1