Changeset 38 for trunk/DNSDB.pm


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/DNSDB.pm

    r37 r38  
    175175  return ('FAIL',"Need domain status") if !defined($state);
    176176
     177  my $sth = $dbh->prepare("SELECT domain_id FROM domains WHERE domain=?");
    177178  my $dom_id;
     179
     180# quick check to start to see if we've already got one
     181  $sth->execute($domain);
     182  ($dom_id) = $sth->fetchrow_array;
     183
     184  return ('FAIL', "Domain already exists") if $dom_id;
    178185
    179186  # Allow transactions, and raise an exception on errors so we can catch it later.
     
    292299  local $dbh->{RaiseError} = 1;
    293300
     301  my $sth = $dbh->prepare("SELECT group_id FROM groups WHERE group_name=?");
     302  my $group_id;
     303
     304# quick check to start to see if we've already got one
     305  $sth->execute($groupname);
     306  ($group_id) = $sth->fetchrow_array;
     307
     308  return ('FAIL', "Group already exists") if $group_id;
     309
    294310  # Wrap all the SQL in a transaction
    295311  eval {
    296     my $sth = $dbh->prepare("INSERT INTO groups (parent_group_id,group_name) VALUES (?,?)");
     312    $sth = $dbh->prepare("INSERT INTO groups (parent_group_id,group_name) VALUES (?,?)");
    297313    $sth->execute($pargroup,$groupname);
    298314
     
    454470  my $phone = shift || '';      # not going format-check
    455471
     472  my $sth = $dbh->prepare("SELECT user_id FROM users WHERE username=?");
    456473  my $user_id;
     474
     475# quick check to start to see if we've already got one
     476  $sth->execute($username);
     477  ($user_id) = $sth->fetchrow_array;
     478
     479  return ('FAIL', "User already exists") if $user_id;
    457480
    458481  # Allow transactions, and raise an exception on errors so we can catch it later.
Note: See TracChangeset for help on using the changeset viewer.