diff -Nur --no-dereference e-smith-ibays-2.6.0.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/90e-smithAccess40ibays e-smith-ibays-2.6.0/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/90e-smithAccess40ibays --- e-smith-ibays-2.6.0.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/90e-smithAccess40ibays 2021-03-09 18:37:10.651000000 -0500 +++ e-smith-ibays-2.6.0/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/90e-smithAccess40ibays 2021-03-10 00:09:29.017000000 -0500 @@ -93,6 +93,9 @@ my $followSymLinks = $properties{'FollowSymLinks'} || "disabled"; my $indexes = $properties{'Indexes'} || "enabled"; my $sslRequireSSL = $properties{'SSLRequireSSL'} || "disabled"; + # here we force SSL if either a password is asked or DAV is enabled + $sslRequireSSL = "enabled" if ($pass == 1); + $sslRequireSSL = "enabled" if ( ($properties{'ModDav'}||'disabled') eq 'enabled'); $OUT .= "\n"; $OUT .= "#------------------------------------------------------------\n"; @@ -103,7 +106,7 @@ $OUT .= "\n"; if ($sslRequireSSL eq 'enabled') { - $OUT .=" SSLRequireSSL\n"; + $OUT .= " SSLRequireSSL\n"; } $OUT .= " Options None\n"; $OUT .= " Options +Indexes\n" if ($indexes eq 'enabled'); @@ -139,6 +142,10 @@ $OUT .= "\n"; $OUT .= "\n"; + if ($sslRequireSSL eq 'enabled') + { + $OUT .= " SSLRequireSSL\n"; + } if ($dynamicContent eq 'enabled') { $OUT .= " Options ExecCGI\n"; @@ -160,6 +167,10 @@ $OUT .= "\n"; $OUT .= "\n"; + if ($sslRequireSSL eq 'enabled') + { + $OUT .= " SSLRequireSSL\n"; + } $OUT .= " AllowOverride None\n"; $OUT .= " order deny,allow\n"; $OUT .= " deny from all\n"; diff -Nur --no-dereference e-smith-ibays-2.6.0.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/20IbayContent e-smith-ibays-2.6.0/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/20IbayContent --- e-smith-ibays-2.6.0.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/20IbayContent 2021-03-09 18:37:10.651000000 -0500 +++ e-smith-ibays-2.6.0/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/20IbayContent 2021-03-10 00:09:29.266000000 -0500 @@ -11,6 +11,10 @@ my $basedir = "/home/e-smith/files/ibays/$ibay"; my $cgiBin = $accounts->get_prop($ibay, "CgiBin") || ""; my $ssl_domain = $accounts->get_prop($ibay, "SSLRequireSSL") || "disabled"; + my $access = $accounts->get_prop($ibay,'PublicAccess') || 'none'; + my $pass = $access =~ /-pw/; + $ssl_domain = "enabled" if $pass; + $ssl_domain = "enabled" if (($accounts->get_prop($ibay, 'ModDav')||'disabled') eq 'enabled'); $OUT .= " DocumentRoot $basedir/html\n"; @@ -51,7 +55,13 @@ $OUT .= " # $key ibay ($name)\n"; $OUT .= "\n"; - if (( $port ne $httpsPort ) && (($ibay->prop('SSLRequireSSL') || 'disabled') eq 'enabled')){ + my $ssl_bay = $ibay->prop('SSLRequireSSL') || 'disabled'; + my $access_bay = $ibay->prop('PublicAccess') || 'none'; + my $pass_bay = $access_bay =~ /-pw/; + $ssl_bay = "enabled" if $pass_bay ; + $ssl_bay = "enabled" if (($ibay->prop('ModDav')||'disabled') eq 'enabled'); + + if (( $port ne $httpsPort ) && ($ssl_bay eq 'enabled')){ my $portspec = ($httpsPort eq 443) ? "" : ":$httpsPort"; $OUT .= " RewriteEngine on\n"; $OUT .= " RewriteRule ^/$key(/.*|\$) https://%{HTTP_HOST}${portspec}/$key\$1 \[L,R\]\n";