From eb9c4b0a800655e75476b9e09c668cc0f8521e50 Mon Sep 17 00:00:00 2001
From: Peter Hormanns <peter.hormanns@hostsharing.net>
Date: Thu, 19 May 2011 17:31:37 +0200
Subject: [PATCH] Fehlerkorrektur

---
 hsarback/src/de/hsadmin/mods/cust/Customer.java           |    2 +-
 hsarback/src/de/hsadmin/mods/dom/Domain.java              |    2 +-
 hsarback/src/de/hsadmin/mods/cust/CustomerModuleImpl.java |   18 ++++++++++++++----
 3 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/hsarback/src/de/hsadmin/mods/cust/Customer.java b/hsarback/src/de/hsadmin/mods/cust/Customer.java
index e3db3c9..3a80385 100644
--- a/hsarback/src/de/hsadmin/mods/cust/Customer.java
+++ b/hsarback/src/de/hsadmin/mods/cust/Customer.java
@@ -95,7 +95,7 @@
 	}
 
 	public static String createQueryFromStringKey(String humanKey) {
-		return "name='" + humanKey + "'";
+		return "obj.name='" + humanKey + "'";
 	}
 
 	@Override
diff --git a/hsarback/src/de/hsadmin/mods/cust/CustomerModuleImpl.java b/hsarback/src/de/hsadmin/mods/cust/CustomerModuleImpl.java
index f77eb92..5c8ad07 100644
--- a/hsarback/src/de/hsadmin/mods/cust/CustomerModuleImpl.java
+++ b/hsarback/src/de/hsadmin/mods/cust/CustomerModuleImpl.java
@@ -1,5 +1,6 @@
 package de.hsadmin.mods.cust;
 
+import java.util.Calendar;
 import java.util.List;
 
 import de.hsadmin.core.model.AbstractEntity;
@@ -59,10 +60,19 @@
 			throw new HSAdminException("role hostmaster required to delete customers");
 		}
 		Customer cust = (Customer) existingEntity;
-		GenericModuleImpl helper = new GenericModuleImpl(getTransaction());
-		AbstractEntity custAccount = helper.findByString(UnixUser.class, cust.getName());
-		helper.delete(custAccount);
-		super.delete(existingEntity);
+//		Diese Zeilen loeschen den hsh00-Mitglieds-Account 
+//		GenericModuleImpl helper = new GenericModuleImpl(getTransaction());
+//		AbstractEntity custAccount = helper.findByString(UnixUser.class, cust.getName());
+//		helper.delete(custAccount);
+		Calendar cal = Calendar.getInstance();
+		cal.setTimeInMillis(System.currentTimeMillis());
+		cal.set(Calendar.MONTH, Calendar.DECEMBER);
+		cal.set(Calendar.DAY_OF_MONTH, 31);
+		cal.set(Calendar.HOUR_OF_DAY, 23);
+		cal.set(Calendar.MINUTE, 59);
+		cal.set(Calendar.SECOND, 59);
+		cust.setMemberUntil(cal.getTime());
+		super.update(existingEntity);
 	}
 
 	private void assertNotNull(String name, String value) throws HSAdminException {
diff --git a/hsarback/src/de/hsadmin/mods/dom/Domain.java b/hsarback/src/de/hsadmin/mods/dom/Domain.java
index 792002e..2e3a4b7 100644
--- a/hsarback/src/de/hsadmin/mods/dom/Domain.java
+++ b/hsarback/src/de/hsadmin/mods/dom/Domain.java
@@ -75,7 +75,7 @@
 	}
 
 	public static String createQueryFromStringKey(String humanKey) {
-		return "name = '" + humanKey + "'";
+		return "obj.name='" + humanKey + "'";
 	}
 
 	@Override

--
Gitblit v1.9.3