Hi! My question can be easy but i want to have some opinions before making some changes.
the soft i use, when i connect it to my ldap for importing users, use the uid as the userid. But, as our ldap is supann, we would like to use the supannaliaslogin. So, my goal is to add a filter on the function below. actually, the rule is userid mapp to the uid value on the ldap and instead of uid, i would like to use the supannaliaslogin. I would write my $filter = Net::LDAP::Filter->new("$supannaliaslogin_field=$userid") or die "Failed to create new Net::LDAP::Filter"; ? sub search_method { my $db = shift or return; my $userid = shift or return; my $uid_field = $mapping{userid}->{is} or die ldapserver_error("mapping for 'userid'"); my $filter = Net::LDAP::Filter->new("$uid_field=$userid") or die "Failed to create new Net::LDAP::Filter"; my $search = $db->search( base => $base, filter => $filter, # attrs => ['*'], ) or die "LDAP search failed to return object."; my $count = $search->count; if ($search->code > 0) { warn sprintf("LDAP Auth rejected : %s gets %d hits\n", $filter->as_string, $count) . description($search); return 0; } if ($count != 1) { warn sprintf("LDAP Auth rejected : %s gets %d hits\n", $filter->as_string, $count); return 0; } return $search; best, samuel