validator/httpd/cgi-bin check,1.432.2.21,1.432.2.22

Update of /sources/public/validator/httpd/cgi-bin
In directory hutz:/tmp/cvs-serv4920/httpd/cgi-bin

Modified Files:
      Tag: validator-0_7-branch
	check 
Log Message:
Plugging the (old, unused? so far) option to enable/disable the soap output
to the actual API. Changing default to enabled in config file, maintainers
wishing to disable can now use the directive in configuration file, and 
validator would then return 503 service not available to output=soap12 requests.




Index: check
===================================================================
RCS file: /sources/public/validator/httpd/cgi-bin/check,v
retrieving revision 1.432.2.21
retrieving revision 1.432.2.22
diff -u -d -r1.432.2.21 -r1.432.2.22
--- check	10 Nov 2006 01:01:28 -0000	1.432.2.21
+++ check	10 Nov 2006 02:51:50 -0000	1.432.2.22
@@ -336,6 +336,13 @@
   loop_context_vars => TRUE,
   cache             => TRUE,
 );
+my $SOAPDIS = HTML::Template->new(
+  filename          => File::Spec->catfile($CFG->{Paths}->{Templates},
+                                          $lang, 'soap_disabled.tmpl'),
+  die_on_bad_params => FALSE,
+  loop_context_vars => TRUE,
+  cache             => TRUE,
+);
 my $EARLT = HTML::Template->new(
   filename          => File::Spec->catfile($CFG->{Paths}->{Templates},
                                           $lang, 'earl_xml.tmpl'),
@@ -836,7 +843,12 @@
 } elsif ($File->{Opt}->{Output} eq 'ucn') {
   $template = $UCNT;
 } elsif ($File->{Opt}->{Output} eq 'soap12') {
-  if ($File->{'Error Flagged'}) {
+  if ($CFG->{'Enable SOAP'} != 1) { # API disabled - ideally this should have been sent before performing validation...
+    print CGI::header(-status => 503, -content_language => "en",
+          -type => "text/html", -charset => "utf-8"
+    );
+    $template = $SOAPDIS;
+  } elsif ($File->{'Error Flagged'}) {
     $template = $SOAPFT;
   } else {
     $template = $SOAPT;

Received on Friday, 10 November 2006 02:52:00 UTC