Skip to Content.
Sympa Menu

en - RE: [sympa-users] LDAP queries using variable?

Subject: The mailing list for listmasters using Sympa

List archive

Chronological Thread  
  • From: Steve Shipway <address@concealed>
  • To: Dick Visser <address@concealed>
  • Cc: "address@concealed" <address@concealed>
  • Subject: RE: [sympa-users] LDAP queries using variable?
  • Date: Thu, 31 Mar 2016 02:32:29 +0000

> Instead of manually changing that filter for each lists, I wonder if it is
> possible
> to put some sort of variable in the filter?
>
> I read https://www.sympa.org/manual_6.3/ldap?s[]=ldap&s[]=query and
> there is see some stuff being used like this:
>
> filter1 (&(cn=[% param.0 %])(objectClass=group))
>
> But that page talks about include_ldap_2level_query - which I don't use.
>
> I'm looking for a var that will represent the list name.

If this is in the *.incl files in data_sources which are used to include for
list admins (in 6.1) or list members (in 6.2) then you can use [% param.0 %]
for the first parameter passed, and so on. You SHOULD be able to also use [%
list.name %] to insert the list name, and so on, as with the web_tt2 and
mail_tt2 templates, but from looking at the code in both 6.1 and 6.2 I think
that the only vars to be exposed are the passed parameters, not anything from
the list itself.

The code responsible is (I think) List.pm:_load_include_admin_user_file()
which only has
my $vars = {'param' => \@data};
If you change this to be:
my $vars = {'param' => \@data,'listname'=>$name};
then I think it might allow use of [% listname %] in your config, though I
have not tested this.

Steve

Steve Shipway
T: +64 9 3737 599 ext 86487
E: address@concealed

Attachment: smime.p7s
Description: S/MIME cryptographic signature




Archive powered by MHonArc 2.6.19+.

Top of Page