Ignore:
Timestamp:
08/17/10 17:42:26 (14 years ago)
Author:
Kris Deugau
Message:

/branches/htmlform

Fix buglet in showmaster.tmpl that prevented block from being
passed on for deletion
Fix formatting buglet in showrouted.tmpl
Convert confirm-delete to template.
See #3.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/htmlform/cgi-bin/main.cgi

    r473 r474  
    11601160  }
    11611161
    1162   #show confirm screen.
    1163   open HTML, "../confirmRemove.html"
    1164         or croak "Could not open confirmRemove.html :$!";
    1165   my $html = join('', <HTML>);
    1166   close HTML;
    1167 
    11681162  # Serves'em right for getting here...
    11691163  if (!defined($webvar{block})) {
     
    11891183    $desc = "N/A";
    11901184    $notes = "N/A";
     1185    $privdata = "N/A";
    11911186
    11921187  } elsif ($webvar{alloctype} eq 'mm') {
     1188
    11931189    $cidr = $webvar{block};
    11941190    $city = "N/A";
     
    11981194    $desc = "N/A";
    11991195    $notes = "N/A";
     1196    $privdata = "N/A";
     1197
    12001198  } elsif ($webvar{alloctype} =~ /^.i$/) { # done with alloctype=[rm]m
    12011199
     
    12221220  } # end cases for different alloctypes
    12231221
    1224   # Munge everything into HTML
    1225   $html =~ s|Please confirm|Please confirm <b>removal</b> of|;
    1226   $html =~ s|\$\$BLOCK\$\$|$cidr|g;
    1227   $html =~ s|\$\$TYPEFULL\$\$|$disp_alloctypes{$alloctype}|g;
    1228   $html =~ s|\$\$ALLOCTYPE\$\$|$alloctype|g;
    1229   $html =~ s|\$\$CITY\$\$|$city|g;
    1230   $html =~ s|\$\$CUSTID\$\$|$custid|g;
    1231   $html =~ s|\$\$CIRCID\$\$|$circid|g;
    1232   $html =~ s|\$\$DESC\$\$|$desc|g;
    1233   $html =~ s|\$\$NOTES\$\$|$notes|g;
    1234 
    1235   $html =~ s|\$\$ACTION\$\$|finaldelete|g;
    1236 
    1237   # Set the warning text.
    1238   if ($alloctype =~ /^.[pd]$/) {
    1239     $html =~ s|<!--warn-->|<tr bgcolor="black"><td colspan="2"><div class="red">Warning: clicking confirm will remove this record entirely.<br>Any IPs allocated from this pool will also be removed!</div></td></tr>|;
    1240   } else {
    1241     $html =~ s|<!--warn-->|<tr bgcolor="black"><td colspan="2"><div class="red">Warning: clicking confirm will remove this record entirely.</div></td></tr>|;
    1242   }
    1243 
    1244   my $i = 1;
    1245   # Check to see if user is allowed to do anything with sensitive data
    1246   if ($IPDBacl{$authuser} =~ /s/) {
    1247     $privdata = qq(<tr class="color).($i%2).qq("><td>Restricted data:</td>).
    1248         qq(<td class=regular>$privdata</td></tr>\n);
    1249     $i++;
    1250   }
    1251   $html =~ s/\$\$PRIVDATA\$\$/$privdata/g;
    1252 
    1253   $i = ++$i % 2;
    1254   $html =~ s/\$\$BUTTONROWCOLOUR\$\$/color$i/;
    1255 
    1256   print $html;
    1257 } # end edit()
     1222  $page->param(block => $cidr);
     1223  $page->param(disptype => $disp_alloctypes{$alloctype});
     1224  $page->param(type => $alloctype);
     1225  $page->param(city => $city);
     1226  $page->param(custid => $custid);
     1227  $page->param(circid => $circid);
     1228  $page->param(desc => $desc);
     1229  $page->param(notes => $notes);
     1230  $privdata = '&nbsp;' if $privdata eq '';
     1231  $page->param(privdata => $privdata) if $IPDBacl{$authuser} =~ /s/;
     1232  $page->param(delpool => $alloctype =~ /^.[pd]$/);
     1233
     1234} # end remove()
    12581235
    12591236
Note: See TracChangeset for help on using the changeset viewer.