/[smecontribs]/rpms/smeserver-subversion/contribs7/smeserver-subversion-1.4-AddHooksToUSerAndGroupDeleteEvents.patch
ViewVC logotype

Annotation of /rpms/smeserver-subversion/contribs7/smeserver-subversion-1.4-AddHooksToUSerAndGroupDeleteEvents.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (hide annotations) (download)
Sat Mar 1 21:01:45 2008 UTC (16 years, 8 months ago) by snetram
Branch: MAIN
CVS Tags: smeserver-subversion-1_4-8_el4_sme, smeserver-subversion-1_4-24_el4_sme, smeserver-subversion-1_4-25_el4_sme, smeserver-subversion-1_4-30_el4_sme, smeserver-subversion-1_4-14_el4_sme, smeserver-subversion-1_4-17_el4_sme, smeserver-subversion-1_4-13_el4_sme, smeserver-subversion-1_4-29_el4_sme, smeserver-subversion-1_4-34_el4_sme, smeserver-subversion-1_4-21_el4_sme, smeserver-subversion-1_4-31_el4_sme, smeserver-subversion-1_4-12_el4_sme, smeserver-subversion-1_4-35_el4_sme, smeserver-subversion-1_4-33_el4_sme, smeserver-subversion-1_4-6_el4_sme, smeserver-subversion-1_4-20_el4_sme, smeserver-subversion-1_4-18_el4_sme, smeserver-subversion-1_4-28_el4_sme, smeserver-subversion-1_4-11_el4_sme, smeserver-subversion-1_4-10_el4_sme, smeserver-subversion-1_4-23_el4_sme, smeserver-subversion-1_4-27_el4_sme, smeserver-subversion-1_4-32_el4_sme, smeserver-subversion-1_4-22_el4_sme, smeserver-subversion-1_4-26_el4_sme, smeserver-subversion-1_4-16_el4_sme, smeserver-subversion-1_4-15_el4_sme
Changes since 1.1: +6 -4 lines
* Sat Mar 01 2008 Jonathan Martens <smeserver-contribs@snetram.nl>
- 1.4-6
- Full access for groups does not work [SME: 3998]
- group-delete hook is preventing groups from being deleted [SME: 3999]
- Fix migrate script to not overwrite users/groups access privileges
  on updates [SME: 4003]

1 snetram 1.1 --- smeserver-subversion-1.4/root/etc/e-smith/events/actions/subversion-delete-from-access-list.AddHooksToUSerAndGroupDeleteEvents 2008-02-25 22:28:36.000000000 +0100
2     +++ smeserver-subversion-1.4/root/etc/e-smith/events/actions/subversion-delete-from-access-list 2008-02-25 22:27:32.000000000 +0100
3 snetram 1.2 @@ -0,0 +1,58 @@
4 snetram 1.1 +#!/usr/bin/perl -w
5     +
6     +package esmith;
7     +
8     +use strict;
9     +use Errno;
10     +use esmith::util;
11     +
12     +my $event = $ARGV [0];
13     +my $item = $ARGV [1];
14     +
15     +#------------------------------------------------------------
16     +# Delete the user from subversion repositories
17     +#------------------------------------------------------------
18     +
19 snetram 1.2 +die "Username argument missing." unless defined ($item);
20     +
21     +my @entries = qw();
22 snetram 1.1 +
23     +if ($event eq 'user-delete') {
24     +
25 snetram 1.2 + @entries = qw(UsersWrite UsersRead);
26 snetram 1.1 +
27     +} elsif ($event eq 'group-delete') {
28     +
29 snetram 1.2 + @entries = qw(GroupsWrite GroupsRead);
30 snetram 1.1 +
31     +} else {
32     +
33     + die "Invalid event: $event";
34     +
35     +}
36     +
37     +use esmith::AccountsDB;
38     +
39     +my $db_accounts = esmith::AccountsDB->open_ro() or
40     + die "Couldn't open AccountsDB\n";
41     +
42     +my @repositories = $db_accounts->get_all_by_prop('type' => 'repository');
43     +
44     +REPOSITORY: foreach my $repository (
45     + (@repositories),
46     +)
47     +{
48     + my $repository_rec = $db_accounts->get($repository) || next REPOSITORY;
49     +
50     + foreach my $entry (@entries) {
51     +
52     + my $members = $repository_rec->prop($entry);
53     + my @members = split (/,/, $members);
54     + @members = grep (!/^$item$/, @members);
55     + $repository_rec->set_prop($entry, join(',', @members));
56     +
57     + }
58     +
59     +}
60     +
61     +exit(0);

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed