1 |
--- smeserver-subversion-1.4/root/etc/e-smith/db/accounts/migrate/migrate/80subversion.ImplementReadWriteAccess 2008-02-22 14:14:59.000000000 +0100 |
2 |
+++ smeserver-subversion-1.4/root/etc/e-smith/db/accounts/migrate/80subversion 2008-02-22 14:23:49.000000000 +0100 |
3 |
@@ -0,0 +1,25 @@ |
4 |
+{ |
5 |
+ my @repositories = $DB->get_all_by_prop('type' => 'repository'); |
6 |
+ |
7 |
+ foreach my $repository ( |
8 |
+ (@repositories), |
9 |
+ ) |
10 |
+ { |
11 |
+ |
12 |
+ my $key = $repository->key; |
13 |
+ |
14 |
+ my $rec = $DB->get($key); |
15 |
+ |
16 |
+ my %properties = $repository->props; |
17 |
+ |
18 |
+ # Creating new blank entries |
19 |
+ $rec->set_prop('UsersRead', ""); |
20 |
+ $rec->set_prop('GroupsRead', ""); |
21 |
+ |
22 |
+ # Migrating existing properties to new ones to keep functionality |
23 |
+ $rec->set_prop('UsersWrite', $DB->get_prop_and_delete($key, 'Users') || ""); |
24 |
+ $rec->set_prop('GroupsWrite', $DB->get_prop_and_delete($key, 'Groups') || ""); |
25 |
+ |
26 |
+ } |
27 |
+ |
28 |
+} |
29 |
--- smeserver-subversion-1.4/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/28SubversionContent.ImplementReadWriteAccess 2008-02-22 11:58:54.000000000 +0100 |
30 |
+++ smeserver-subversion-1.4/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/28SubversionContent 2008-02-22 14:13:57.000000000 +0100 |
31 |
@@ -117,6 +117,9 @@ |
32 |
|
33 |
} |
34 |
|
35 |
+ my $SVNAutoVersioning = $properties{'SVNAutoVersioning'} || 'off'; |
36 |
+ my $ModMimeUsePathInfo = $properties{'ModMimeUsePathInfo'} || 'off'; |
37 |
+ |
38 |
# Always have a section for a virtualhost at port 80 and only if neccesarry |
39 |
# (when authentification is required and therefore passwords are transmitted) |
40 |
# for a virtualhost at port 443. |
41 |
@@ -130,20 +133,20 @@ |
42 |
|
43 |
my $allowOverride = $properties{'AllowOverride'} || "None"; |
44 |
|
45 |
- my $users; |
46 |
- my @list; |
47 |
+ my $usersRead; |
48 |
+ my @listRead; |
49 |
|
50 |
- if ($properties{'Groups'}) { |
51 |
+ if ($properties{'GroupsRead'}) { |
52 |
|
53 |
- my @groups = split (/,/, $properties{'Groups'}); |
54 |
+ my @groupsRead = split (/,/, $properties{'GroupsRead'}); |
55 |
|
56 |
- foreach my $group (@groups) { |
57 |
+ foreach my $groupRead (@groupsRead) { |
58 |
|
59 |
- my $members = $db_accounts->get_prop($group, 'Members') || ""; |
60 |
+ my $membersRead = $db_accounts->get_prop($groupRead, 'Members') || ""; |
61 |
|
62 |
- if (length($members) > 0) { |
63 |
+ if (length($membersRead) > 0) { |
64 |
|
65 |
- push @list, split (/,/, $members); |
66 |
+ push @listRead, split (/,/, $membersRead); |
67 |
|
68 |
} |
69 |
|
70 |
@@ -151,24 +154,64 @@ |
71 |
|
72 |
} |
73 |
|
74 |
- if ($properties{'Users'}) { |
75 |
+ if ($properties{'UsersRead'}) { |
76 |
|
77 |
- push @list, split (/,/, $properties{'Users'}); |
78 |
+ push @listRead, split (/,/, $properties{'UsersRead'}); |
79 |
|
80 |
} |
81 |
|
82 |
- if (@list > 1) { |
83 |
+ if (@listRead > 1) { |
84 |
+ |
85 |
+ @listRead = sort(@listRead); |
86 |
+ |
87 |
+ } |
88 |
+ |
89 |
+ my $prevRead = ''; |
90 |
+ @listRead = grep($_ ne $prevRead && (($prevRead) = $_), @listRead); |
91 |
+ |
92 |
+ $usersRead = join(" ", @listRead) || ''; |
93 |
+ |
94 |
+ undef @listRead; |
95 |
+ |
96 |
+ my $usersWrite; |
97 |
+ my @listWrite; |
98 |
+ |
99 |
+ if ($properties{'GroupsWrite'}) { |
100 |
+ |
101 |
+ my @groupsWrite = split (/,/, $properties{'GroupsWrite'}); |
102 |
+ |
103 |
+ foreach my $groupWrite (@groupsWrite) { |
104 |
+ |
105 |
+ my $membersWrite = $db_accounts->get_prop($groupWrite, 'Members') || ""; |
106 |
+ |
107 |
+ if (length($membersWrite) > 0) { |
108 |
+ |
109 |
+ push @listWrite, split (/,/, $membersWrite); |
110 |
+ |
111 |
+ } |
112 |
+ |
113 |
+ } |
114 |
+ |
115 |
+ } |
116 |
+ |
117 |
+ if ($properties{'UsersWrite'}) { |
118 |
+ |
119 |
+ push @listWrite, split (/,/, $properties{'UsersWrite'}); |
120 |
|
121 |
- @list = sort(@list); |
122 |
+ } |
123 |
+ |
124 |
+ if (@listWrite > 1) { |
125 |
+ |
126 |
+ @listWrite = sort(@listWrite); |
127 |
|
128 |
} |
129 |
|
130 |
- my $prev = ''; |
131 |
- @list = grep($_ ne $prev && (($prev) = $_), @list); |
132 |
+ my $prevWrite = ''; |
133 |
+ @listWrite = grep($_ ne $prevWrite && (($prevWrite) = $_), @listWrite); |
134 |
|
135 |
- $users = join(" ", @list) || ''; |
136 |
+ $usersWrite = join(" ", @listWrite) || ''; |
137 |
|
138 |
- undef @list; |
139 |
+ undef @listWrite; |
140 |
|
141 |
# Only when authentification is required or SSL is forced |
142 |
if ( ($pass) || ($forceSSL) ) { |
143 |
@@ -207,9 +250,6 @@ |
144 |
$OUT .= " DAV svn\n"; |
145 |
$OUT .= " SVNPath /home/e-smith/files/repositories/$key\n"; |
146 |
|
147 |
- my $SVNAutoVersioning = $properties{'SVNAutoVersioning'} || 'off'; |
148 |
- my $ModMimeUsePathInfo = $properties{'ModMimeUsePathInfo'} || 'off'; |
149 |
- |
150 |
$OUT .= "\n"; |
151 |
$OUT .= " SVNAutoVersioning $SVNAutoVersioning\n"; |
152 |
$OUT .= " ModMimeUsePathInfo $ModMimeUsePathInfo\n"; |
153 |
@@ -235,9 +275,41 @@ |
154 |
$OUT .= " AuthName \"$properties{'Description'}\"\n"; |
155 |
$OUT .= " AuthType Basic\n"; |
156 |
$OUT .= " AuthExternal pwauth\n"; |
157 |
- $OUT .= " require user $users\n" if ($users); |
158 |
-# $OUT .= " require group $groups\n" if ($groups); |
159 |
- $OUT .= " require valid-user\n" if ( ($users eq '') && ($groups eq '') ); |
160 |
+ |
161 |
+ |
162 |
+ if ($usersRead) { |
163 |
+ |
164 |
+ $OUT .= " <Limit GET PROPFIND OPTIONS REPORT>\n"; |
165 |
+ $OUT .= " Require user $usersRead\n"; |
166 |
+ $OUT .= " </Limit>\n"; |
167 |
+ |
168 |
+ } |
169 |
+ |
170 |
+ if ($groupsRead) { |
171 |
+ |
172 |
+ $OUT .= " <Limit GET PROPFIND OPTIONS REPORT>\n"; |
173 |
+ $OUT .= " Require group $groupsRead\n"; |
174 |
+ $OUT .= " </Limit>\n"; |
175 |
+ |
176 |
+ } |
177 |
+ |
178 |
+ if ($usersWrite) { |
179 |
+ |
180 |
+ $OUT .= " <LimitExcept GET PROPFIND OPTIONS REPORT>\n"; |
181 |
+ $OUT .= " Require user $usersWrite\n"; |
182 |
+ $OUT .= " </LimitExcept>\n"; |
183 |
+ |
184 |
+ } |
185 |
+ |
186 |
+ if ($groupsWrite) { |
187 |
+ |
188 |
+ $OUT .= " <LimitExcept GET PROPFIND OPTIONS REPORT>\n"; |
189 |
+ $OUT .= " Require group $groupsWrite\n"; |
190 |
+ $OUT .= " </LimitExcept>\n"; |
191 |
+ |
192 |
+ } |
193 |
+ |
194 |
+ $OUT .= " require valid-user\n" if ( ($usersRead eq '') && ($groupsRead eq '') && ($usersWrite eq '') && ($groupsWrite eq '') ); |
195 |
$OUT .= " Satisfy $satisfy\n"; |
196 |
|
197 |
} |