1 |
--- smeserver-sarg-2.2.1/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/90e-smithAccess20sarg.validuser2 2006-10-17 22:12:45.000000000 +1000 |
2 |
+++ smeserver-sarg-2.2.1/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/90e-smithAccess20sarg 2009-09-18 20:17:18.000000000 +1000 |
3 |
@@ -1,35 +1,53 @@ |
4 |
{ |
5 |
-my $externalSSLAccess = ''; |
6 |
-my $validFrom = db_get_prop($confref, "httpd-admin", "ValidFrom") || 'none'; |
7 |
+ my $externalSSLAccess = ''; |
8 |
+ my $validFrom = db_get_prop($confref, "httpd-admin", "ValidFrom") || 'none'; |
9 |
|
10 |
-$validFrom =~ s/,/ /g; |
11 |
-$validFrom =~ s:/255.255.255.255::g; |
12 |
+ $validFrom =~ s/,/ /g; |
13 |
+ $validFrom =~ s:/255.255.255.255::g; |
14 |
|
15 |
-unless ($validFrom eq 'none') |
16 |
-{ |
17 |
-$externalSSLAccess = $validFrom; |
18 |
-} |
19 |
+ unless ($validFrom eq 'none') |
20 |
+ { |
21 |
+ $externalSSLAccess = $validFrom; |
22 |
+ } |
23 |
+ |
24 |
+ use esmith::AccountsDB; |
25 |
+ my $adb = esmith::AccountsDB->open_ro(); |
26 |
+ my $sargusers = ""; |
27 |
+ |
28 |
+ foreach my $user ($adb->users) |
29 |
+ { |
30 |
+ my %properties = $user->props; |
31 |
+ my $key = $user->key; |
32 |
+ |
33 |
+ if ($properties{'AdminPanels'}) |
34 |
+ { |
35 |
+ if ($properties{'AdminPanels'} =~ /sarg/) |
36 |
+ { |
37 |
+ $sargusers = "$sargusers $key"; |
38 |
+ } |
39 |
+ } |
40 |
+ } |
41 |
|
42 |
$OUT .= <<HERE; |
43 |
-#----------------------------------------------------------------------------- |
44 |
-# SARG generated squid access log reports web repository |
45 |
-#----------------------------------------------------------------------------- |
46 |
- |
47 |
-Alias /squid /var/www/sarg |
48 |
-<Directory /var/www/sarg> |
49 |
-AllowOverride None |
50 |
-Options +Indexes |
51 |
-order deny,allow |
52 |
-deny from all |
53 |
-allow from $localAccess $externalSSLAccess |
54 |
-AuthName "SME Server Manager" |
55 |
-AuthType Basic |
56 |
-AuthExternal pwauth |
57 |
-require user admin |
58 |
-</Directory> |
59 |
- |
60 |
-#----------------------------------------------------------------------------- |
61 |
-# End of SARG generated squid access log reports web repository |
62 |
-#----------------------------------------------------------------------------- |
63 |
+ #----------------------------------------------------------------------------- |
64 |
+ # SARG generated squid access log reports web repository |
65 |
+ #----------------------------------------------------------------------------- |
66 |
+ |
67 |
+ Alias /squid /var/www/sarg |
68 |
+ <Directory /var/www/sarg> |
69 |
+ AllowOverride None |
70 |
+ Options +Indexes |
71 |
+ order deny,allow |
72 |
+ deny from all |
73 |
+ allow from $localAccess $externalSSLAccess |
74 |
+ AuthName "SME Server Manager" |
75 |
+ AuthType Basic |
76 |
+ AuthExternal pwauth |
77 |
+ require user admin $sargusers |
78 |
+ </Directory> |
79 |
+ |
80 |
+ #----------------------------------------------------------------------------- |
81 |
+ # End of SARG generated squid access log reports web repository |
82 |
+ #----------------------------------------------------------------------------- |
83 |
HERE |
84 |
} |