HSAdmin Backend Domains, E-Mail, Datenbanken
Peter Hormanns
2012-01-09 d8b9d2f62f38568afb9dcec98c93671bf0154170
fix #81 (untested)
3 files modified
18 ■■■■■ changed files
hsarback/src/de/hsadmin/core/model/SecureDefaultModuleImpl.java 9 ●●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/email/EMailAddress.java 3 ●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/mods/email/EMailAddressProcessorFactory.java 6 ●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/core/model/SecureDefaultModuleImpl.java
@@ -44,11 +44,12 @@
        if (!transaction.getLoginUser().hasHostmasterRole()
                && (filterAnnot = getSecurityFilterAnnotation(entityClass)) != null) {
            String securityCondition = filterAnnot.value();
            if (condition != null && condition.length() > 0)
                condition = "(" + condition + ")" + " AND ( "
                        + securityCondition + ")";
            else
            if (condition != null && condition.length() > 0) {
                condition = "(" + condition + ")" + " AND ( " + securityCondition + ")";
            }
            else {
                condition = securityCondition;
            }
        }
        // do query
hsarback/src/de/hsadmin/mods/email/EMailAddress.java
@@ -158,7 +158,8 @@
     */
    @Transient
    public String getFullDomain() {
        return (getSubdomain() == null ? "" : (getSubdomain() + "."))
        String sub = getSubdomain();
        return (sub == null || sub.length() == 0 ? "" : (sub + "."))
                + getDomain().getName();
    }
hsarback/src/de/hsadmin/mods/email/EMailAddressProcessorFactory.java
@@ -49,12 +49,12 @@
        int emailAddressCount = emailAddressCount(em, email);
        if (emailAddressCount == 0) {
            // remove the domain from virtual.db
            String fullDomain = email.getFullDomain();
            cp.appendProcessor( 
                    new ShellProcessor( "postmap -d '" + email.getFullDomain() + "' /etc/postfix/virtual" ) );
                    new ShellProcessor( "postmap -d '" + fullDomain + "' /etc/postfix/virtual" ) );
            WaitingTasksProcessor waitingTasksProcessor = new WaitingTasksProcessor(cp);
            String domName = email.getDomain().getName();
            for (String queueName : new String[] { "mail1", "mail2", "mail3" }) {
                waitingTasksProcessor.appendProcessor(queueName, createMailinDeleteProcessor(domName), queueName + ".hostsharing.net");
                waitingTasksProcessor.appendProcessor(queueName, createMailinDeleteProcessor(fullDomain), queueName + ".hostsharing.net");
            }
            return waitingTasksProcessor;
        } else {