Changeset 375 for trunk/dns.cgi


Ignore:
Timestamp:
08/08/12 18:04:47 (12 years ago)
Author:
Kris Deugau
Message:

/trunk

Checkpoint adding locations/views. See #10.

  • Tweak new locations table again with an internal serial for sorting and finding the "highest" previous location
  • Complete "Add location" stub
  • Fill in initial display page for "Edit location"
  • Tweak location add/edit/update template a little, add new comments field to match new field in table
  • Tweak location import so we don't end up with great long space-free fields similar to what can't be avoided with TXT (usually SPF/DomainKeys) records
  • Fill in addLoc() stub
  • Add getLoc()
  • Tweak location export to strip commas and whitespace properly
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dns.cgi

    r374 r375  
    13681368
    13691369  if ($webvar{locact} eq 'new') {
    1370 
     1370    # uuhhmm....
    13711371  } elsif ($webvar{locact} eq 'add') {
    13721372    changepage(page => "loclist", errmsg => "You are not permitted to add locations/views", id => $webvar{parentid})
    13731373        unless ($permissions{admin} || $permissions{location_create});
    13741374
    1375 ##work
    1376     my ($code,$msg) = addLocation($dbh, $webvar{parentid}, $webvar{locname}, $webvar{iplist});
     1375    my ($code,$msg) = addLoc($dbh, $curgroup, $webvar{locname}, $webvar{comments}, $webvar{iplist});
    13771376
    13781377    if ($code eq 'OK' || $code eq 'WARN') {
     
    13881387      $page->param(todo         => "Add location/view");
    13891388      $page->param(locact       => "add");
    1390       $page->param(parentid     => $webvar{parentid});
    13911389      $page->param(id           => $webvar{id});
    1392       fill_recdata();   # populate the form... er, mostly.
     1390      $page->param(locname      => $webvar{locname});
     1391      $page->param(comments     => $webvar{comments});
     1392      $page->param(iplist       => $webvar{iplist});
    13931393    }
    13941394
     
    13961396    changepage(page => "loclist", errmsg => "You are not permitted to edit locations/views", id => $webvar{parentid})
    13971397        unless ($permissions{admin} || $permissions{location_edit});
     1398
     1399    my $loc = getLoc($dbh, $webvar{loc});
     1400    $page->param(wastrying      => "adding");
     1401    $page->param(todo           => "Edit location/view");
     1402    $page->param(locact         => "update");
     1403    $page->param(id             => $webvar{loc});
     1404    $page->param(locname        => $loc->{description});
     1405    $page->param(comments       => $loc->{comments});
     1406    $page->param(iplist         => $loc->{iplist});
     1407
    13981408  } elsif ($webvar{locact} eq 'update') {
    13991409    changepage(page => "loclist", errmsg => "You are not permitted to edit locations/views", id => $webvar{parentid})
    14001410        unless ($permissions{admin} || $permissions{location_edit});
     1411##work
    14011412  } else {
    14021413    changepage(page => "loclist", errmsg => "You are not permitted to add locations/views", id => $webvar{parentid})
     
    14051416    $page->param(todo => "Add location/view");
    14061417    $page->param(locact => "add");
    1407     $page->param(parentid => $webvar{parentid});
    1408 
    14091418    $page->param(locname => ($webvar{locname} ? $webvar{locname} : ''));
    14101419    $page->param(iplist => ($webvar{iplist} ? $webvar{iplist} : ''));
Note: See TracChangeset for help on using the changeset viewer.