From eb9c4b0a800655e75476b9e09c668cc0f8521e50 Mon Sep 17 00:00:00 2001 From: Peter Hormanns Date: Thu, 19 May 2011 15:31:37 +0000 Subject: [PATCH] Fehlerkorrektur --- .../src/de/hsadmin/mods/cust/Customer.java | 2 +- .../hsadmin/mods/cust/CustomerModuleImpl.java | 18 ++++++++++++++---- hsarback/src/de/hsadmin/mods/dom/Domain.java | 2 +- 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 class Customer extends de.hsadmin.core.model.AbstractEntity implements Se } 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 @@ public class CustomerModuleImpl extends AbstractModuleImpl { 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 class Domain extends AbstractEntity { } public static String createQueryFromStringKey(String humanKey) { - return "name = '" + humanKey + "'"; + return "obj.name='" + humanKey + "'"; } @Override