Changeset 449 for branches/htmlform/cgi-bin
- Timestamp:
- 07/27/10 17:06:18 (14 years ago)
- Location:
- branches/htmlform/cgi-bin
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/htmlform/cgi-bin/CommonWeb.pm
r447 r449 16 16 $VERSION = 1.00; 17 17 @ISA = qw(Exporter); 18 @EXPORT_OK = qw( &printFooter&printHeader &printError &printAndExit &desanitize &cleanInput &desanitize);18 @EXPORT_OK = qw( &printHeader &printError &printAndExit &desanitize &cleanInput &desanitize); 19 19 20 20 @EXPORT = (); #export nothing by default 21 %EXPORT_TAGS = ( ALL => [qw( &print Footer &printHeader &printError21 %EXPORT_TAGS = ( ALL => [qw( &printHeader &printError 22 22 &printAndExit &desanitize &cleanInput )], 23 lean => [qw( &print Footer &printHeader &printError23 lean => [qw( &printHeader &printError 24 24 &printAndExit &cleanInput )] 25 25 ); … … 47 47 } 48 48 49 sub printFooter50 {51 open FILE, "../footer.inc"52 or croak $!;53 while (<FILE>)54 {55 print;56 }57 close FILE;58 }59 60 49 sub printError($) 61 50 { … … 76 65 </center> 77 66 ); 78 print Footer();67 print "<br>would print footer but already dun gone and shot($self->foot)\n"; 79 68 exit(0); 80 69 } -
branches/htmlform/cgi-bin/IPDB.pm
r448 r449 121 121 $IPDBacl{$data[0]} = $data[1]; 122 122 } 123 124 ##fixme: initialize HTML::Template env var for template path 125 # something like $self->path().'/templates' ? 126 # $ENV{HTML_TEMPLATE_ROOT} = 'foo/bar'; 123 127 124 128 return (1,"OK"); -
branches/htmlform/cgi-bin/admin.cgi
r447 r449 16 16 use CGI::Carp qw(fatalsToBrowser); 17 17 use CGI::Simple; 18 use HTML::Template; 18 19 use DBI; 19 20 use CommonWeb qw(:ALL); … … 51 52 } 52 53 initIPDBGlobals($ip_dbh); 54 55 ##fixme - need to autofill this somehow 56 $ENV{HTML_TEMPLATE_ROOT} = '/home/kdeugau/dev/ipdb/trunk/templates'; 53 57 54 58 if ($IPDBacl{$authuser} !~ /A/) { … … 660 664 print qq(<hr><a href="/ip/">Back</a> to main interface</a>\n); 661 665 662 printFooter; 666 # We print the footer here, so we don't have to do it elsewhere. 667 my $footer = HTML::Template->new(filename => "footer.tmpl"); 668 # we're already in the admin tools, no need to provide a bottom link. maybe. 669 #$footer->param(adminlink => ($IPDBacl{$authuser} =~ /A/)); 670 671 print $footer->output; 663 672 664 673 $ip_dbh->disconnect; -
branches/htmlform/cgi-bin/main.cgi
r448 r449 13 13 use CGI::Carp qw(fatalsToBrowser); 14 14 use CGI::Simple; 15 use HTML::Template; 15 16 use DBI; 16 17 use CommonWeb qw(:ALL); … … 49 50 } 50 51 initIPDBGlobals($ip_dbh); 52 53 # Set up some globals 54 ##fixme - need to autofill this somehow 55 $ENV{HTML_TEMPLATE_ROOT} = '/home/kdeugau/dev/ipdb/trunk/templates'; 51 56 52 57 # Headerize! Make sure we replace the $$EXTRA0$$ bit as needed. … … 173 178 finish($ip_dbh); 174 179 175 print qq(<div align=right style="position: absolute; right: 30px;">).176 qq(<a href="/ip/cgi-bin/admin.cgi">Admin tools</a></div><br>\n)177 if $IPDBacl{$authuser} =~ /A/;180 #print qq(<div align=right style="position: absolute; right: 30px;">). 181 # qq(<a href="/ip/cgi-bin/admin.cgi">Admin tools</a></div><br>\n) 182 # if $IPDBacl{$authuser} =~ /A/; 178 183 179 184 # We print the footer here, so we don't have to do it elsewhere. 180 printFooter; 185 my $footer = HTML::Template->new(filename => "footer.tmpl"); 186 # include the admin tools link in the output? 187 $footer->param(adminlink => ($IPDBacl{$authuser} =~ /A/)); 188 189 print $footer->output; 190 181 191 # Just in case something waaaayyy down isn't in place 182 192 # properly... we exit explicitly. … … 1181 1191 # Relatively simple SQL transaction here. 1182 1192 my $sql; 1183 ##fixme: SQL parameters (#34)1184 # need to make sure we log roughly the same info1185 1193 if (my $pooltype = ($webvar{alloctype} =~ /^(.)i$/) ) { 1186 1194 $sql = "update poolips set custid='$webvar{custid}',notes='$webvar{notes}',". … … 1413 1421 1414 1422 1423 # going, going, gone... this sub to be removed Any Day Real Soon Now(TM) 1415 1424 sub exitError { 1416 1425 my $errStr = $_[0]; … … 1420 1429 </center> 1421 1430 ); 1422 printFooter(); 1431 1432 # We print the footer here, so we don't have to do it elsewhere. 1433 my $footer = HTML::Template->new(filename => "footer.tmpl"); 1434 # include the admin tools link in the output? 1435 $footer->param(adminlink => ($IPDBacl{$authuser} =~ /A/)); 1436 1437 print $footer->output; 1438 1423 1439 exit; 1424 1440 } # errorExit -
branches/htmlform/cgi-bin/search.cgi
r447 r449 15 15 use CGI::Carp qw(fatalsToBrowser); 16 16 use CGI::Simple; 17 use HTML::Template; 17 18 use DBI; 18 19 use CommonWeb qw(:ALL); … … 53 54 # Global variables 54 55 my $RESULTS_PER_PAGE = 25; 56 ##fixme - need to autofill this somehow 57 $ENV{HTML_TEMPLATE_ROOT} = '/home/kdeugau/dev/ipdb/trunk/templates'; 55 58 56 59 # Set up the CGI object... … … 298 301 # Shut down and clean up. 299 302 finish($ip_dbh); 300 printFooter; 303 304 # We print the footer here, so we don't have to do it elsewhere. 305 my $footer = HTML::Template->new(filename => "footer.tmpl"); 306 # include the admin tools link in the output? 307 $footer->param(adminlink => ($IPDBacl{$authuser} =~ /A/)); 308 309 print $footer->output; 310 301 311 # We shouldn't need to directly execute any code below here; it's all subroutines. 302 312 exit 0;
Note:
See TracChangeset
for help on using the changeset viewer.