fixed bug: setting spamassassin options fails for user without any SA settings

This commit is contained in:
lars 2006-01-29 19:38:07 +00:00
parent 385f0cc3ad
commit de44f72081
1 changed files with 11 additions and 6 deletions

View File

@ -342,12 +342,17 @@ sub update_filter_options {
return (0==1);
}
$result = $ldap->modify($user_dn, delete => ['spamassassin'] );
if ($result->is_error) {
warn $result->error_text;
$warning = 'UpdateFilterOptions';
$ldap->unbind;
return (1==0);
{
my @spam_options = &get_ldap_values('spamassassin');
if ($#spam_options > 0) {
$result = $ldap->modify($user_dn, delete => ['spamassassin'] );
if ($result->is_error) {
warn $result->error_text;
$warning = 'UpdateFilterOptions';
$ldap->unbind;
return (1==0);
}
}
}
{