HSAdmin Backend Domains, E-Mail, Datenbanken
Peter Hormanns
2012-06-12 9dcae446eebd071af8ab15fec13b30c8fe854d27
fixed #78
1 files modified
8 ■■■■ changed files
hsarback/src/de/hsadmin/core/model/Transaction.java 8 ●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/core/model/Transaction.java
@@ -208,7 +208,7 @@
            return true;        // 2-letter hostmaster
        }
        String hostmasterAccountPrefix = Config.getInstance().getProperty("accountprefix.hostmaster", "hsh01") + "-";
        if (ticketUser != null && ticketUser.startsWith(hostmasterAccountPrefix) && ticketUser.length() == 9) {
        if (ticketUser != null && ticketUser.startsWith(hostmasterAccountPrefix) && ticketUser.length() == 8) {
            return true;        // hsh01 hostmaster
        }
        if (ticketUser != null && ticketUser.length() == 5) {
@@ -218,10 +218,10 @@
            String pacName = unixUser.getPac().getName();
            return ticketUser.equals(pacName);  // pac-admin
        }
        if (ticketUser != null && ticketUser.length() == 3) {
            String memberAccountPrefix = Config.getInstance().getProperty("accountprefix.customer", "hsh00") + "-";
        String memberAccountPrefix = Config.getInstance().getProperty("accountprefix.customer", "hsh00") + "-";
        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", memberAccountPrefix + ticketUser);
            memberQuery.setParameter("membername", ticketUser.length() == 3 ? (memberAccountPrefix + ticketUser) : ticketUser);
            Customer member = (Customer) memberQuery.getSingleResult();
            Set<Pac> pacs = member.getPacs();
            for (Pac p : pacs) {