--- smeserver-subversion-1.4/root/etc/e-smith/db/accounts/migrate/migrate/80subversion.ImplementReadWriteAccess 2008-02-22 14:14:59.000000000 +0100 +++ smeserver-subversion-1.4/root/etc/e-smith/db/accounts/migrate/80subversion 2008-02-22 14:23:49.000000000 +0100 @@ -0,0 +1,25 @@ +{ + my @repositories = $DB->get_all_by_prop('type' => 'repository'); + + foreach my $repository ( + (@repositories), + ) + { + + my $key = $repository->key; + + my $rec = $DB->get($key); + + my %properties = $repository->props; + + # Creating new blank entries + $rec->set_prop('UsersRead', ""); + $rec->set_prop('GroupsRead', ""); + + # Migrating existing properties to new ones to keep functionality + $rec->set_prop('UsersWrite', $DB->get_prop_and_delete($key, 'Users') || ""); + $rec->set_prop('GroupsWrite', $DB->get_prop_and_delete($key, 'Groups') || ""); + + } + +} --- 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 +++ smeserver-subversion-1.4/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/28SubversionContent 2008-02-22 14:13:57.000000000 +0100 @@ -117,6 +117,9 @@ } + my $SVNAutoVersioning = $properties{'SVNAutoVersioning'} || 'off'; + my $ModMimeUsePathInfo = $properties{'ModMimeUsePathInfo'} || 'off'; + # Always have a section for a virtualhost at port 80 and only if neccesarry # (when authentification is required and therefore passwords are transmitted) # for a virtualhost at port 443. @@ -130,20 +133,20 @@ my $allowOverride = $properties{'AllowOverride'} || "None"; - my $users; - my @list; + my $usersRead; + my @listRead; - if ($properties{'Groups'}) { + if ($properties{'GroupsRead'}) { - my @groups = split (/,/, $properties{'Groups'}); + my @groupsRead = split (/,/, $properties{'GroupsRead'}); - foreach my $group (@groups) { + foreach my $groupRead (@groupsRead) { - my $members = $db_accounts->get_prop($group, 'Members') || ""; + my $membersRead = $db_accounts->get_prop($groupRead, 'Members') || ""; - if (length($members) > 0) { + if (length($membersRead) > 0) { - push @list, split (/,/, $members); + push @listRead, split (/,/, $membersRead); } @@ -151,24 +154,64 @@ } - if ($properties{'Users'}) { + if ($properties{'UsersRead'}) { - push @list, split (/,/, $properties{'Users'}); + push @listRead, split (/,/, $properties{'UsersRead'}); } - if (@list > 1) { + if (@listRead > 1) { + + @listRead = sort(@listRead); + + } + + my $prevRead = ''; + @listRead = grep($_ ne $prevRead && (($prevRead) = $_), @listRead); + + $usersRead = join(" ", @listRead) || ''; + + undef @listRead; + + my $usersWrite; + my @listWrite; + + if ($properties{'GroupsWrite'}) { + + my @groupsWrite = split (/,/, $properties{'GroupsWrite'}); + + foreach my $groupWrite (@groupsWrite) { + + my $membersWrite = $db_accounts->get_prop($groupWrite, 'Members') || ""; + + if (length($membersWrite) > 0) { + + push @listWrite, split (/,/, $membersWrite); + + } + + } + + } + + if ($properties{'UsersWrite'}) { + + push @listWrite, split (/,/, $properties{'UsersWrite'}); - @list = sort(@list); + } + + if (@listWrite > 1) { + + @listWrite = sort(@listWrite); } - my $prev = ''; - @list = grep($_ ne $prev && (($prev) = $_), @list); + my $prevWrite = ''; + @listWrite = grep($_ ne $prevWrite && (($prevWrite) = $_), @listWrite); - $users = join(" ", @list) || ''; + $usersWrite = join(" ", @listWrite) || ''; - undef @list; + undef @listWrite; # Only when authentification is required or SSL is forced if ( ($pass) || ($forceSSL) ) { @@ -207,9 +250,6 @@ $OUT .= " DAV svn\n"; $OUT .= " SVNPath /home/e-smith/files/repositories/$key\n"; - my $SVNAutoVersioning = $properties{'SVNAutoVersioning'} || 'off'; - my $ModMimeUsePathInfo = $properties{'ModMimeUsePathInfo'} || 'off'; - $OUT .= "\n"; $OUT .= " SVNAutoVersioning $SVNAutoVersioning\n"; $OUT .= " ModMimeUsePathInfo $ModMimeUsePathInfo\n"; @@ -235,9 +275,41 @@ $OUT .= " AuthName \"$properties{'Description'}\"\n"; $OUT .= " AuthType Basic\n"; $OUT .= " AuthExternal pwauth\n"; - $OUT .= " require user $users\n" if ($users); -# $OUT .= " require group $groups\n" if ($groups); - $OUT .= " require valid-user\n" if ( ($users eq '') && ($groups eq '') ); + + + if ($usersRead) { + + $OUT .= " \n"; + $OUT .= " Require user $usersRead\n"; + $OUT .= " \n"; + + } + + if ($groupsRead) { + + $OUT .= " \n"; + $OUT .= " Require group $groupsRead\n"; + $OUT .= " \n"; + + } + + if ($usersWrite) { + + $OUT .= " \n"; + $OUT .= " Require user $usersWrite\n"; + $OUT .= " \n"; + + } + + if ($groupsWrite) { + + $OUT .= " \n"; + $OUT .= " Require group $groupsWrite\n"; + $OUT .= " \n"; + + } + + $OUT .= " require valid-user\n" if ( ($usersRead eq '') && ($groupsRead eq '') && ($usersWrite eq '') && ($groupsWrite eq '') ); $OUT .= " Satisfy $satisfy\n"; }