1 |
vip-ire |
1.1 |
diff -Nur e-smith-qmail-2.6.0/root/etc/e-smith/events/actions/qmail-update-group e-smith-qmail-2.6.0_bz10386/root/etc/e-smith/events/actions/qmail-update-group |
2 |
|
|
--- e-smith-qmail-2.6.0/root/etc/e-smith/events/actions/qmail-update-group 2017-07-20 17:46:00.285609302 +0200 |
3 |
|
|
+++ e-smith-qmail-2.6.0_bz10386/root/etc/e-smith/events/actions/qmail-update-group 2017-07-20 17:49:57.171541855 +0200 |
4 |
|
|
@@ -33,28 +33,23 @@ |
5 |
|
|
my $event = $ARGV [0] || die "Event name arg missing\n";; |
6 |
|
|
my @groups; |
7 |
|
|
|
8 |
|
|
-if ($ARGV[1]) |
9 |
|
|
-{ |
10 |
|
|
- my $groupName = $ARGV [1]; |
11 |
|
|
- my $g = $a->get($groupName) || |
12 |
|
|
- die "Group $groupName not found in accounts db\n"; |
13 |
|
|
- |
14 |
|
|
- my $type = $g->prop('type'); |
15 |
|
|
- if ($type =~ /^group/) |
16 |
|
|
- { |
17 |
|
|
- @groups = ($g); |
18 |
|
|
- } |
19 |
|
|
- # Is it a user? |
20 |
|
|
- elsif ($type =~ /^user/) |
21 |
|
|
- { |
22 |
|
|
- # That's fine. We were probably just called from the user-delete |
23 |
|
|
- # event, in which case we want to update all of the groups. So, leave |
24 |
|
|
- # the groups array empty. |
25 |
|
|
- @groups = (); |
26 |
|
|
- } |
27 |
|
|
- else |
28 |
|
|
- { |
29 |
|
|
- die "Expected a user or a group. Got neither: $type\n"; |
30 |
|
|
+if (scalar @ARGV) |
31 |
|
|
+{ |
32 |
|
|
+ @groups = map { $a->get($_); } @ARGV; |
33 |
|
|
+ foreach my $g (@groups) |
34 |
|
|
+ { |
35 |
|
|
+ my $type = $g->prop('type'); |
36 |
|
|
+ if ($type =~ /^user/) |
37 |
|
|
+ { |
38 |
|
|
+ # That's fine. We were probably just called from the user-delete |
39 |
|
|
+ # event, in which case we want to update all of the groups. So, leave |
40 |
|
|
+ # the groups array empty. |
41 |
|
|
+ @groups = (); |
42 |
|
|
+ last; |
43 |
|
|
+ } |
44 |
|
|
+ elsif ($type !~ /^group/){ |
45 |
|
|
+ die "Expected a user or a group. Got neither: $type\n"; |
46 |
|
|
+ } |
47 |
|
|
} |
48 |
|
|
} |
49 |
|
|
|