Changeset 377 for trunk/dns.cgi


Ignore:
Timestamp:
08/09/12 16:36:01 (12 years ago)
Author:
Kris Deugau
Message:

/trunk

Checkpoint adding locations to UI. See #10.

  • Add location list sort field and order initialization to session setup
  • Fix up a minor copy-paste oversight
  • Fill in location update stubs
  • Add missing logging and code-style bits to addLoc()
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dns.cgi

    r376 r377  
    9696  $session->param('reclistsortby','host');
    9797  $session->param('reclistorder','ASC');
     98  $session->param('loclistsortby','description');
     99  $session->param('loclistorder','ASC');
    98100  $session->param('logsortby','stamp');
    99101  $session->param('logorder','DESC');
     
    13521354
    13531355    my $loc = getLoc($dbh, $webvar{loc});
    1354     $page->param(wastrying      => "adding");
     1356    $page->param(wastrying      => "editing");
    13551357    $page->param(todo           => "Edit location/view");
    13561358    $page->param(locact         => "update");
     
    13631365    changepage(page => "loclist", errmsg => "You are not permitted to edit locations/views", id => $webvar{parentid})
    13641366        unless ($permissions{admin} || $permissions{location_edit});
    1365 ##work
     1367
     1368    my ($code,$msg) = updateLoc($dbh, $webvar{id}, $curgroup, $webvar{locname}, $webvar{comments}, $webvar{iplist});
     1369
     1370    if ($code eq 'OK') {
     1371      changepage(page => "loclist", resultmsg => $msg);
     1372    } else {
     1373      $page->param(failed       => 1);
     1374      $page->param(errmsg       => $msg);
     1375      $page->param(wastrying    => "editing");
     1376      $page->param(todo         => "Edit location/view");
     1377      $page->param(locact       => "update");
     1378      $page->param(id           => $webvar{loc});
     1379      $page->param(locname      => $webvar{locname});
     1380      $page->param(comments     => $webvar{comments});
     1381      $page->param(iplist       => $webvar{iplist});
     1382    }
    13661383  } else {
    13671384    changepage(page => "loclist", errmsg => "You are not permitted to add locations/views", id => $webvar{parentid})
     
    21692186  # Some UI things need to be done to the list
    21702187  foreach my $l (@{$loclist}) {
     2188    $l->{iplist} = "(All IPs)" if !$l->{iplist};
    21712189    $l->{edloc} = ($permissions{admin} || $permissions{loc_edit});
    21722190    $l->{delloc} = ($permissions{admin} || $permissions{loc_delete});
Note: See TracChangeset for help on using the changeset viewer.