Changeset 38 for trunk/dns.cgi


Ignore:
Timestamp:
11/20/09 17:32:04 (14 years ago)
Author:
Kris Deugau
Message:

/trunk

checkpoint - big changes!

dns.cgi and DNSDB.pm:

  • all output pages should validate as XHTML 1.0 Strict. For at least another five minutes.
  • add variable to control env dump (which doesn't validate...)
  • fiddle username add to use "uname" as username field, since username seems to cause HTML::Template to barf suddenly... O_o
  • tweak "change current group" form URI for XHTML's idiotic "all ampersands must be exscapededed ALL EVARWERE!!!one11!"
  • check for existence of group, domain, user at beginning of respective add* subs in DNSDB.pm

templates/*:

  • adjust all templates to account for oddities and stupidities of XHTML 1.0. Templates do NOT validate on their own, but the final output should. WTFisms include (but are not limited to):
    • escaped ampersands in links?
    • "<form> can't go here"?
    • <td> can't use nowrap, width?
    • "<fieldset>"?
    • and now that the form fields are enclosed in a fieldset... apparently you can't right-click in "noncontent" space "inside" that element. GRRRRRRR!!!!!
  • CSS now needs work to make things appear properly, due largely to the WTFisms above
  • all this XHTML fixing got me to also normalize and clean up inconsistent usage, general structures, and things that wouldn't even pass HTML 4.0.1 Transitional (I think) - eg missing closing tags on <tr> or <td>
  • delete raw dump of Vega's login page (need to delete a couple others)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dns.cgi

    r37 r38  
    2525
    2626my @debugbits;  # temp, to be spit out near the end of processing
     27my $debugenv = 0;
    2728
    2829# Let's do these templates right...
     
    6869
    6970# default
    70 my $perpage = 15;
    71 #my $perpage = 3;
     71#my $perpage = 15;
     72my $perpage = 3;
    7273my $offset = ($webvar{offset} ? $webvar{offset} : 0);
    7374
     
    481482    $msg = "Passwords don't match";
    482483  } else {
    483     ($code,$msg) = addUser($dbh,$webvar{username}, $webvar{group}, $webvar{pass1},
     484    ($code,$msg) = addUser($dbh,$webvar{uname}, $webvar{group}, $webvar{pass1},
    484485        ($webvar{makeactive} eq 'on' ? 1 : 0), $webvar{accttype},
    485486        $webvar{fname}, $webvar{lname}, $webvar{phone});
     
    490491    changepage(page => "useradmin");
    491492  } else {
    492 # oooh, yeah, this is supposed to be a redirect.  er, maybe.  whee.
    493 #    $page = HTML::Template->new(filename => "$templatedir/newuser.tmpl");
     493# oddity - apparently, xhtml 1.0 strict swallows username as an HTML::Template var.  O_o
    494494    $page->param(add_failed => 1);
    495     $page->param(username => $webvar{username});
     495    $page->param(uname => $webvar{uname});
    496496    $page->param(fname => $webvar{fname});
    497497    $page->param(lname => $webvar{lname});
     
    502502  }
    503503
    504   $page->param(add_failed => 1);
     504#  $page->param(add_failed => 1);
    505505
    506506} elsif ($webvar{page} eq 'deluser') {
     
    654654  # stuff for menu group change.  nb: this is icky.
    655655  fill_grouplist("grouplist");
    656   $page->param(whereami => $ENV{REQUEST_URI});
     656# @#$%@%@#% XHTML - & in a URL must be escaped.  >:(
     657  my $tmp_ruri = $ENV{REQUEST_URI};
     658  $tmp_ruri =~ s/\&([a-z])/\&amp\;$1/g;
     659#  $page->param(whereami => $ENV{REQUEST_URI});
     660  $page->param(whereami => $tmp_ruri);
    657661}
    658662
     
    662666print $page->output;
    663667
    664 print "<div id=debug>webvar keys: <pre>\n";
    665 foreach my $key (keys %webvar) {
    666   print "key: $key\tval: $webvar{$key}\n";
    667 }
    668 print "</pre>\nsession:\n<pre>\n";
    669 my $sesdata = $session->dataref();
    670 foreach my $key (keys %$sesdata) {
    671   print "key: $key\tval: ".$sesdata->{$key}."\n";
    672 }
    673 print "</pre>\nENV:\n<pre>\n";
    674 foreach my $key (keys %ENV) {
    675   print "key: $key\tval: $ENV{$key}\n";
    676 }
    677 print "</pre></div>\n";
     668if ($debugenv) {
     669  print "<div id=\"debug\">webvar keys: <pre>\n";
     670  foreach my $key (keys %webvar) {
     671    print "key: $key\tval: $webvar{$key}\n";
     672  }
     673  print "</pre>\nsession:\n<pre>\n";
     674  my $sesdata = $session->dataref();
     675  foreach my $key (keys %$sesdata) {
     676    print "key: $key\tval: ".$sesdata->{$key}."\n";
     677  }
     678  print "</pre>\nENV:\n<pre>\n";
     679  foreach my $key (keys %ENV) {
     680    print "key: $key\tval: $ENV{$key}\n";
     681  }
     682  print "</pre></div>\n";
     683}
    678684
    679685print $footer->output;
Note: See TracChangeset for help on using the changeset viewer.