fix #81 (untested)

This commit is contained in:
Peter Hormanns 2012-01-09 17:50:13 +00:00
parent 145a79710c
commit d8b9d2f62f
3 changed files with 10 additions and 8 deletions

View File

@ -44,11 +44,12 @@ public class SecureDefaultModuleImpl extends AbstractModuleImpl {
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

View File

@ -158,7 +158,8 @@ public class EMailAddress extends AbstractEntity implements Serializable {
*/
@Transient
public String getFullDomain() {
return (getSubdomain() == null ? "" : (getSubdomain() + "."))
String sub = getSubdomain();
return (sub == null || sub.length() == 0 ? "" : (sub + "."))
+ getDomain().getName();
}

View File

@ -49,12 +49,12 @@ public class EMailAddressProcessorFactory implements EntityProcessorFactory {
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 {