Changeset 149 for branches/sql-cleanup/cgi-bin/main.cgi
- Timestamp:
- 02/03/05 14:23:34 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/sql-cleanup/cgi-bin/main.cgi
r142 r149 354 354 $data[1], $disp_alloctypes{$data[2]}, $data[3], $data[4]); 355 355 # Allow listing of pool if desired/required. 356 if ($data[2] =~ /^ [cdsmw]p$/) {356 if ($data[2] =~ /^.[pd]$/) { 357 357 $row[0] .= ' <a href="/ip/cgi-bin/main.cgi?action=listpool'. 358 358 "&pool=$data[0]\">List IPs</a>"; … … 620 620 $data[3], $disp_alloctypes{$data[2]}, $data[1], $data[4]); 621 621 # If the allocation is a pool, allow listing of the IPs in the pool. 622 if ($data[2] =~ /^ [cdsmw]p$/) {622 if ($data[2] =~ /^.[pd]$/) { 623 623 $row[0] .= ' <a href="/ip/cgi-bin/main.cgi?action=listpool'. 624 624 "&pool=$data[0]\">List IPs</a>"; … … 675 675 my $cidr = new NetAddr::IP $webvar{pool}; 676 676 677 my ($pooltype,$poolcity); 678 677 679 # Snag pool info for heading 678 $sth = $ip_dbh->prepare("select *from allocations where cidr='$cidr'");680 $sth = $ip_dbh->prepare("select type,city from allocations where cidr='$cidr'"); 679 681 $sth->execute; 680 my @data = $sth->fetchrow_array;681 my $type = $data[2]; # We'll need this later.682 $sth->bind_columns(\$pooltype, \$poolcity); 683 $sth->fetch() || carp $sth->errstr; 682 684 683 685 print qq(<center><div class="heading">Listing pool IPs for $cidr<br>\n). 684 qq(($disp_alloctypes{$type} in $data[3])</div></center><br>\n); 685 print qq(<div class="indent"><b>Reserved IPs:</b><br>\n); 686 print qq(<div class="indent"><table><tr class=color1><td>Network IP:</td><td>). 686 qq(($disp_alloctypes{$pooltype} in $poolcity)</div></center><br>\n); 687 # Only display net/gw/bcast if it's a "real" netblock and not a PPP(oE) lunacy 688 if ($pooltype =~ /^.d$/) { 689 print qq(<div class="indent"><b>Reserved IPs:</b><br>\n); 690 print qq(<div class="indent"><table><tr class=color1><td>Network IP:</td><td>). 687 691 $cidr->addr."</td></tr>\n"; 688 $cidr++;689 print "<tr class=color2><td>Gateway:</td><td>".$cidr->addr."</td></tr>\n";690 $cidr--; $cidr--;691 print "<tr class=color1><td>Broadcast:</td><td>".$cidr->addr."</td></tr>\n".692 $cidr++; 693 print "<tr class=color2><td>Gateway:</td><td>".$cidr->addr."</td></tr>\n"; 694 $cidr--; $cidr--; 695 print "<tr class=color1><td>Broadcast:</td><td>".$cidr->addr."</td></tr>\n". 692 696 "<tr><td>Netmask:</td><td>".$cidr->mask."</td></tr>\n". 693 697 "</table></div></div>\n"; 698 } 694 699 695 700 # probably have to add an "edit IP allocation" link here somewhere. … … 973 978 "'$webvar{alloctype}' by $authuser failed: '$msg'"; 974 979 printError("Allocation of $webvar{fullcidr} as $disp_alloctypes{$webvar{alloctype}}". 975 " failed: 980 " failed:<br>\n$msg\n"); 976 981 } 977 982
Note:
See TracChangeset
for help on using the changeset viewer.