/[smecontribs]/rpms/smeserver-mod_dav/contribs7/smeserver-mod_dav-0.1-ImplementDAVForIbays.patch
ViewVC logotype

Diff of /rpms/smeserver-mod_dav/contribs7/smeserver-mod_dav-0.1-ImplementDAVForIbays.patch

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

Revision 1.2 by snetram, Sun Mar 23 14:36:02 2008 UTC Revision 1.3 by snetram, Sun Mar 23 16:28:10 2008 UTC
# Line 2  Line 2 
2  +++ smeserver-mod_dav-0.1/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/95Addmod_dav2ibays       2008-03-23 14:29:45.000000000 +0100  +++ smeserver-mod_dav-0.1/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/95Addmod_dav2ibays       2008-03-23 14:29:45.000000000 +0100
3  @@ -0,0 +1,64 @@  @@ -0,0 +1,64 @@
4  +{  +{
5  + use esmith::AccountsDB;  +    use esmith::AccountsDB;
6  + my $adb = esmith::AccountsDB->open_ro();  +    my $adb = esmith::AccountsDB->open_ro();
7  + $OUT = "";  +    $OUT = "";
8  + foreach my $ibay ($adb->ibays)  +    foreach my $ibay ($adb->ibays)
 + {  
 +  my %properties = $ibay->props;  
 +  my $key = $ibay->key;  
 +  if ($properties{'ModDav'})  
 +  {  
 +   if ($properties{'ModDav'} eq 'enabled')  
 +   {  
 +    $OUT .= "\n<Directory /home/e-smith/files/ibays/$key/html>\n";  
 +    $OUT .= " # Turn DAV on for this directory tree\n";  
 +    $OUT .= " DAV On\n";  
 +    $OUT .= " AllowOverride None\n";  
 +    $OUT .= " Options +Indexes \n";  
 +    $OUT .= " # Allow fancy indexing by columns and download by clicking icon\n";  
 +    $OUT .= " IndexOptions FancyIndexing IconsAreLinks\n";  
 +    if ($properties{'Group'})  
9  +    {  +    {
10  +     $OUT .= " AuthType Basic\n";  +        my %properties = $ibay->props;
11  +     $OUT .= " AuthExternal pwauth\n";  +        my $key = $ibay->key;
12  +     # Save groupname and find it in the group list  +        if ($properties{'ModDav'})
13  +     $iBayGroup = $properties{'Group'};  +        {
14  +     foreach my $group ($adb->groups)  +            if ($properties{'ModDav'} eq 'enabled')
15  +     {  +            {
16  +      my %groupprops = $group->props;  +                $OUT .= "\n<Directory /home/e-smith/files/ibays/$key/html>\n\n";
17  +      my $grpkey = $group->key;  +                $OUT .= "    # Enable DAV access for this directory tree\n";
18  +      if ($grpkey eq $iBayGroup)  +                $OUT .= "    DAV On\n\n";
19  +      {  +                $OUT .= "    AllowOverride None\n";
20  +       # we have the group that owns the DAV iBay  +                $OUT .= "    Options +Indexes \n\n";
21  +       # If there are members of the group validate on them,  +                $OUT .= "    # Allow fancy indexing by columns and download by clicking icon\n";
22  +       # otherwise on the ibayname  +                $OUT .= "    IndexOptions FancyIndexing IconsAreLinks\n\n";
23  +       if ($groupprops{'Members'})  +                if ($properties{'Group'})
24  +       {  +                {
25  +        # need to break user list on commas then output each one...  +                    $OUT .= "    AuthType Basic\n";
26  +        my @values = split(',',$groupprops{'Members'});  +                    $OUT .= "    AuthExternal pwauth\n\n";
27  +        $OUT .= " # Replace ibay name with any valid group member to validate\n";  +                    # Save groupname and find it in the group list
28  +        $OUT .= " Require user ";  +                    $$iBayGroup = $properties{'Group'};
29  +        foreach my $val (@values) {  +                    foreach my $group ($adb->groups)
30  +         $OUT .= $val . " ";  +                    {
31    +                        my %groupprops = $group->props;
32    +                        my $grpkey = $group->key;
33    +                        if ($grpkey eq $iBayGroup)
34    +                        {
35    +                            # we have the group that owns the DAV iBay
36    +                            # If there are members of the group validate on them,
37    +                            # otherwise on the ibayname
38    +                            if ($groupprops{'Members'})
39    +                            {
40    +                                # need to break user list on commas then output each one...
41    +                                my @values = split(',',$groupprops{'Members'});
42    +                                $OUT .= "    # Replace ibay name with any valid group member to validate\n";
43    +                                $OUT .= "    Require user ";
44    +                                foreach my $val (@values) {
45    +                                    $OUT .= $val . " ";
46    +                                }
47    +                                $OUT .= "\n\n";
48    +                            }
49    +                            else
50    +                            {
51    +                                # No group members so use ibay name for validation
52    +                                $OUT .= "    # use ibay name to validate\n";
53    +                                $OUT .= "    Require user " . $key . "\n\n";
54    +                            }
55    +                        }
56    +                    }
57    +                }
58    +                # Ensure only valid users get to do stuff...
59    +                $OUT .= "    <Limit GET PUT POST DELETE PROPFIND PROPPATCH MKCOL COPY MOVE LOCK UNLOCK>\n\n";
60    +                $OUT .= "        Allow from all\n";
61    +                $OUT .= "        Require valid-user\n\n";
62    +                $OUT .= "    </Limit>\n\n";
63    +                $OUT .= "</Directory>\n";
64    +            }
65  +        }  +        }
 +        $OUT .= "\n";  
 +       }  
 +       else  
 +       {  
 +        # No group members so use ibay name for validation  
 +        $OUT .= " # use ibay name to validate\n";  
 +        $OUT .= " Require user " . $key . "\n";  
 +       }  
 +      }  
 +     }  
66  +    }  +    }
 +    # Ensure only valid users get to do stuff...  
 +    $OUT .= " <Limit GET PUT POST DELETE PROPFIND PROPPATCH MKCOL COPY MOVE LOCK UNLOCK>\n";  
 +    $OUT .= " allow from all\n";  
 +    $OUT .= " Require valid-user\n";  
 +    $OUT .= " </Limit>\n";  
 +    $OUT .= "</Directory>\n";  
 +   }  
 +  }  
 + }  
67  +}  +}
68  --- smeserver-mod_dav-0.1/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/35DavLock.ImplementDAVForIbays   2008-03-23 14:28:37.000000000 +0100  --- smeserver-mod_dav-0.1/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/35DavLock.ImplementDAVForIbays   2008-03-23 14:28:37.000000000 +0100
69  +++ smeserver-mod_dav-0.1/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/35DavLock        2008-03-23 14:27:39.000000000 +0100  +++ smeserver-mod_dav-0.1/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/35DavLock        2008-03-23 14:27:39.000000000 +0100
70  @@ -0,0 +1 @@  @@ -0,0 +2 @@
71  +DAVLockDB /var/run/davLocks/DAVLock  +DAVLockDB /var/run/davLocks/DAVLock
72  \ No newline at end of file  +
73  --- smeserver-mod_dav-0.1/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/20LoadModule80mod_dav.ImplementDAVForIbays       2006-05-29 16:59:55.000000000 +0200  --- smeserver-mod_dav-0.1/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/20LoadModule80mod_dav.ImplementDAVForIbays       2006-05-29 16:59:55.000000000 +0200
74  +++ smeserver-mod_dav-0.1/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/20LoadModule80mod_dav    2008-03-23 14:26:18.000000000 +0100  +++ smeserver-mod_dav-0.1/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/20LoadModule80mod_dav    2008-03-23 14:26:18.000000000 +0100
75  @@ -3,6 +3,7 @@  @@ -3,6 +3,7 @@


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

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