From 325ae31e08b8aca7b1d32d975439c142fd866341 Mon Sep 17 00:00:00 2001
From: Purodha <bli00@hostsharing.net>
Date: Tue, 02 Apr 2013 17:55:04 +0200
Subject: [PATCH] Accept member accounts of more than 3 characters length in "run as" command.

---
 hsarback/src/de/hsadmin/core/model/Transaction.java |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/hsarback/src/de/hsadmin/core/model/Transaction.java b/hsarback/src/de/hsadmin/core/model/Transaction.java
index 5f52a79..317f3ed 100644
--- a/hsarback/src/de/hsadmin/core/model/Transaction.java
+++ b/hsarback/src/de/hsadmin/core/model/Transaction.java
@@ -205,7 +205,7 @@
 			return ticketUser.equals(pacName);  // pac-admin
 		}
 		String memberAccountPrefix = Config.getInstance().getProperty("accountprefix.customer", "hsh00") + "-";
-		if (ticketUser != null && (ticketUser.length() == 3 || (ticketUser.length() == 9 && ticketUser.startsWith(memberAccountPrefix)))) {
+		if (ticketUser != null && (ticketUser.length() == 3 || (ticketUser.length() >= 9 && ticketUser.startsWith(memberAccountPrefix)))) {
 			Query memberQuery = getEntityManager().createQuery("SELECT c FROM Customers c WHERE c.name = :membername");
 			memberQuery.setParameter("membername", ticketUser.length() == 3 ? (memberAccountPrefix + ticketUser) : ticketUser);
 			Customer member = (Customer) memberQuery.getSingleResult();

--
Gitblit v1.9.0-SNAPSHOT