HSAdmin Backend Domains, E-Mail, Datenbanken
Peter Hormanns
2011-03-31 875d642f26ff9d0b4aeaf4f7db9db3fbc36b3020
Rollen-spezifische Module
1 files deleted
5 files modified
29 ■■■■ changed files
hsarback/lib/activemq-all-5.4.2.jar patch | view | raw | blame | history
hsarback/src/de/hsadmin/core/util/TextUtil.java 2 ●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/cust/CustomerModuleImpl.java 2 ●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/pac/PacModuleImpl.java 3 ●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/user/UnixUser.java 3 ●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/remote/PacRemote.java 19 ●●●●● patch | view | raw | blame | history
hsarback/lib/activemq-all-5.4.2.jar
Binary files differ
hsarback/src/de/hsadmin/core/util/TextUtil.java
@@ -2,7 +2,7 @@
public class TextUtil {
    public static String replaceUmlauts(String umlautString) {
    public static String replaceUmlautCharacters(String umlautString) {
        StringBuffer buffer = new StringBuffer();
        for (char c : umlautString.toCharArray()) {
            if (    (c >= 'a' && c <= 'z') ||
hsarback/src/de/hsadmin/mods/cust/CustomerModuleImpl.java
@@ -27,7 +27,7 @@
        }
        GenericModuleImpl helperModule = new GenericModuleImpl(getTransaction());
        UnixUser custAccount = new UnixUser();
        custAccount.setComment(TextUtil.replaceUmlauts(custComment));
        custAccount.setComment(TextUtil.replaceUmlautCharacters(custComment));
        custAccount.setName(newCustomer.getName());
        custAccount.setPassword(newCustomer.getPassword());
        custAccount.setShell("/usr/bin/passwd");
hsarback/src/de/hsadmin/mods/pac/PacModuleImpl.java
@@ -11,6 +11,7 @@
import de.hsadmin.core.model.AbstractEntity;
import de.hsadmin.core.model.AbstractModuleImpl;
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.user.UnixUser;
@@ -83,7 +84,7 @@
        pac.setUnixUser(users);
        UnixUser admin = new UnixUser();
        Contact contact = customer.getContractualContact();
        admin.setComment(contact.getFirstName() + " " + contact.getLastName());
        admin.setComment(TextUtil.replaceUmlautCharacters(contact.getFirstName() + " " + contact.getLastName()));
        admin.setHomedir("/home/pacs/" + pac.getName());
        admin.setName(pac.getName());
        admin.setShell("/bin/bash");
hsarback/src/de/hsadmin/mods/user/UnixUser.java
@@ -306,10 +306,9 @@
        String pacName = pac.getName();
        if (!name.equals(pacName) && !name.startsWith(pacName + "-"))
            return false;
        if (super.isWriteAllowedFor(loginUser))
            return true;
        return this == loginUser || loginUser.hasPacAdminRoleFor(getPac());
        return this.getId() == loginUser.getId() || loginUser.hasPacAdminRoleFor(getPac());
    }
    @Override
hsarback/src/de/hsadmin/remote/PacRemote.java
@@ -4,6 +4,7 @@
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Map;
import java.util.Set;
import de.hsadmin.core.model.AbstractEntity;
import de.hsadmin.mods.cust.Customer;
@@ -11,6 +12,7 @@
import de.hsadmin.mods.pac.Hive;
import de.hsadmin.mods.pac.INetAddress;
import de.hsadmin.mods.pac.Pac;
import de.hsadmin.mods.pac.PacComponent;
public class PacRemote extends AbstractRemote {
@@ -25,6 +27,22 @@
        resultMap.put("customer", pac.getCustomer().getName());
        resultMap.put("curinetaddr", pac.getCurINetAddr().getInetAddr());
        resultMap.put("created", df.format(pac.getCreated()));
        resultMap.put("basepac", pac.getBasepac().getName());
        Set<PacComponent> pacComponents = pac.getPacComponents();
        StringBuffer bf = new StringBuffer();
        boolean empty = true;
        for (PacComponent comp : pacComponents) {
            if (comp.getQuantity() > 0) {
                if (!empty) {
                    bf.append("; ");
                }
                bf.append(comp.getBaseComponent().getFeature());
                bf.append("=");
                bf.append(comp.getQuantity());
                empty = false;
            }
        }
        resultMap.put("components", bf.toString());
    }
    @Override
@@ -69,7 +87,6 @@
    @Override
    protected void regularizeKeys(Map<String, String> whereParams) {
        replaceKey(whereParams, "customer", "customer.name");
        replaceKey(whereParams, "basepac", "customer.name");
    }
}