diff --git a/root/etc/e-smith/templates/etc/ejabberd/ejabberd.cfg/55AuthConf b/root/etc/e-smith/templates/etc/ejabberd/ejabberd.cfg/55AuthConf index 0fff76b..c081087 100644 --- a/root/etc/e-smith/templates/etc/ejabberd/ejabberd.cfg/55AuthConf +++ b/root/etc/e-smith/templates/etc/ejabberd/ejabberd.cfg/55AuthConf @@ -17,16 +17,16 @@ HERE # (Only available on iPasserelle) our @groups = split(/[;,]/, ($ejabberd{'AllowedGroups'} || '')); -my $filter = ''; +our $groupFilter = ''; if (scalar(@groups) == 1){ - $filter = "(posixMemberOf=$groups[0])"; + $groupFilter = "(posixMemberOf=$groups[0])"; } elsif (scalar(@groups) gt 1){ - $filter = '(|'; - $filter .= "(posixMemberOf=$_)" foreach (@groups); - $filter .= ')'; + $groupFilter = '(|'; + $groupFilter .= "(posixMemberOf=$_)" foreach (@groups); + $groupFilter .= ')'; } -$OUT .= ($filter eq '') ? '' : '{ldap_filter, "' . $filter . '"}.'; +$OUT .= ($groupFilter eq '') ? '' : '{ldap_filter, "' . $groupFilter . '"}.'; } diff --git a/root/etc/e-smith/templates/etc/ejabberd/ejabberd.cfg/86ModuleVcardLDAP b/root/etc/e-smith/templates/etc/ejabberd/ejabberd.cfg/86ModuleVcardLDAP index 5b272c9..c341a6f 100644 --- a/root/etc/e-smith/templates/etc/ejabberd/ejabberd.cfg/86ModuleVcardLDAP +++ b/root/etc/e-smith/templates/etc/ejabberd/ejabberd.cfg/86ModuleVcardLDAP @@ -1,9 +1,17 @@ { +my $filter = ''; +if (scalar(@groups) ge 1){ + $filter = "(&(objectClass=inetOrgPerson)$groupFilter)"; +} +else{ + $filter = "(objectClass=inetOrgPerson)"; +} + $OUT .=<<"HERE"; ,{mod_vcard_ldap, [ {ldap_base, "ou=Users,$base"}, - {ldap_filter, "(objectClass=inetOrgPerson)"}, + {ldap_filter, "$filter"}, {ldap_vcard_map, %% vcard patterns [{"NICKNAME", "%u", []}, % just use user's part of JID as his nickname