Changeset 834


Ignore:
Timestamp:
03/19/10 03:27:54 (14 years ago)
Author:
nanardon
Message:
  • allow to several filters to build list, filters are merged, eg:

filter1=foo=bar
filter2=baz=tux
will perform seearch users having foo atributes set to bar, than adding user having baz set to tux (like OR).
Any keywords begining by 'filter' can be used

Location:
LATMOS-Accounts
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • LATMOS-Accounts/bin/la-sync-list

    r793 r834  
    6363        $content{$_} = 1; 
    6464    } 
    65     foreach my $id (sort $labase->search_objects( 
    66             $listcfg->val($list, 'objects', 'user'), 
    67             $listcfg->val($list, 'filter'), 
    68         )) { 
     65    my %ids; 
     66    foreach my $param ($listcfg->Parameters($list)) { 
     67        $param =~ /^filter/ or next; 
     68 
     69        foreach my $id (sort $labase->search_objects( 
     70                $listcfg->val($list, 'objects', 'user'), 
     71                $listcfg->val($list, $param),)) { 
     72            $ids{$id} = 1; 
     73        } 
     74    } 
     75    foreach my $id (sort keys %ids) { 
    6976        if (!$cache{$otype}{$fmt}{$id}) { 
    7077            my $obj = $labase->get_object( 
  • LATMOS-Accounts/sample/list.cfg

    r793 r834  
    2424filter=company=LATMOS 
    2525filter=mail=* 
     26filter2=company~Novimet 
     27filter2=contratType=heberges 
     28filter2=mail=* 
    2629 
    2730[sitevlb] 
Note: See TracChangeset for help on using the changeset viewer.