{
# gwsetup ( verify settings!)
  my $status = $gwsetup{'status'} || 'disabled';
 
  if ($status eq 'enabled') 
  {
    $OUT .="#-------------------------------------------------\n";
    $OUT .="# gwsetup settings from smeserver-gwsetup\n";
    $OUT .="#-------------------------------------------------\n";
    $OUT .="\n";

  $OUT .= qq(
<LocationMatch ^/(gwsetup|gwd)>
    SSLRequireSSL
    order deny,allow
    deny from all
  );

  my $access = ($gwsetup{'access'} || 'private');
    if ("$access" eq "private")
    {
      $OUT .= "    allow from $localAccess $externalSSLAccess";
    }
    elsif ("$access" eq "public")
    {
      $OUT .= "    allow from all";
    }
  $OUT .= qq(
    AuthName "gwsetup"
    AuthType Basic
    AuthBasicProvider external
    AuthExternal pwauth
    require user admin
</LocationMatch>
  );
  }
  else 
  {
  $OUT .= "# gwsetup is disabled";
  }
}
