Revision 5c0c9e67
Von Sven Schöling vor etwa 15 Jahren hinzugefügt
SL/Auth.pm | ||
---|---|---|
11 | 11 |
use Digest::MD5 qw(md5_hex); |
12 | 12 |
use IO::File; |
13 | 13 |
use Time::HiRes qw(gettimeofday); |
14 |
use List::MoreUtils qw(uniq); |
|
14 | 15 |
|
15 | 16 |
use SL::Auth::DB; |
16 | 17 |
use SL::Auth::LDAP; |
... | ... | |
704 | 705 |
$sth = prepare_query($form, $dbh, $query); |
705 | 706 |
|
706 | 707 |
foreach $group (values %{$groups}) { |
707 |
$group->{members} = [];
|
|
708 |
my @members;
|
|
708 | 709 |
|
709 | 710 |
do_statement($form, $sth, $query, $group->{id}); |
710 | 711 |
|
711 | 712 |
while ($row = $sth->fetchrow_hashref()) { |
712 |
push @{$group->{members}}, $row->{user_id};
|
|
713 |
push @members, $row->{user_id};
|
|
713 | 714 |
} |
715 |
$group->{members} = [ uniq @members ]; |
|
714 | 716 |
} |
715 | 717 |
$sth->finish(); |
716 | 718 |
|
... | ... | |
760 | 762 |
$query = qq|INSERT INTO auth.user_group (user_id, group_id) VALUES (?, ?)|; |
761 | 763 |
$sth = prepare_query($form, $dbh, $query); |
762 | 764 |
|
763 |
foreach my $user_id (@{ $group->{members} }) { |
|
765 |
foreach my $user_id (uniq @{ $group->{members} }) {
|
|
764 | 766 |
do_statement($form, $sth, $query, $user_id, $group->{id}); |
765 | 767 |
} |
766 | 768 |
$sth->finish(); |
Auch abrufbar als: Unified diff
Mehrere Sanity Checks um zu verhindern, dass $group->{members} Dublikate enthält.
Hoffentlich Fix für Bug 1057.