Ignore:
Timestamp:
09/17/10 18:49:45 (14 years ago)
Author:
Kris Deugau
Message:

/branches/htmlform

Convert initial DB connection error output to a sane page. Could arguably provide
space for this (and other) errors on all normal pages. (See #3).
This allows us to:

  • Remove editError sub in main.cgi
  • Remove printHeader sub in CommonWeb.pm (see #15, #26)

Removed duplicate "exit if we get this far"
Tweak IPDB::finish so it doesn't spit a fatal error when called with a null database handle

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/htmlform/cgi-bin/CommonWeb.pm

    r450 r479  
    1616$VERSION     = 1.00;
    1717@ISA         = qw(Exporter);
    18 @EXPORT_OK      = qw( &printHeader &printError &printAndExit &desanitize &cleanInput &desanitize);
     18@EXPORT_OK      = qw( &printError &printAndExit &desanitize &cleanInput &desanitize);
    1919
    2020@EXPORT      = (); #export nothing by default
     
    2525                );
    2626
    27 
    28 sub printHeader {
    29   my $title = shift;
    30   print "Content-type: text/html\n\n";
    31 # This doesn't work well.  Must investigate.
    32 #  my $realm = shift;
    33 #  print qq(WWW-Authenticate: Basic realm="$realm"\n) if $realm;
    34   open FILE, "../header.inc"
    35         or carp $!;
    36   my $html = join('',<FILE>);
    37   close FILE;
    38 
    39   $html =~ s/\$\$TITLE\$\$/$title/;
    40 # Necessary for mangling arbitrary bits of the header
    41   my $i=0;
    42   while (defined(my $param = shift)) {
    43     $html =~ s/\$\$EXTRA$i\$\$/$param/g;
    44     $i++;
    45   }
    46   print $html;
    47 }
    4827
    4928sub printError($)
Note: See TracChangeset for help on using the changeset viewer.