Changeset 380 for trunk/cgi-bin/main.cgi
- Timestamp:
- 01/22/08 16:11:01 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cgi-bin/main.cgi
r371 r380 400 400 $sth->execute(); 401 401 402 # hack hack hack 403 # set up to flag swip=y records if they don't actually have supporting data in the customers table 404 my $custsth = $ip_dbh->prepare("select count(*) from customers where custid=?"); 405 402 406 my $count=0; 403 407 while (my @data = $sth->fetchrow_array()) { … … 408 412 # $data[2] =~ s/\s+//g; 409 413 414 $custsth->execute($data[3]); 415 my ($ncust) = $custsth->fetchrow_array(); 416 410 417 # Prefix subblocks with "Sub " 411 418 my @row = ( (($data[2] =~ /^.r$/) ? 'Sub ' : ''). 412 419 qq(<a href="/ip/cgi-bin/main.cgi?action=edit&block=$data[0]">$data[0]</a>), 413 420 $data[1], $disp_alloctypes{$data[2]}, $data[3], 414 ($data[4] eq 'y' ? 'Yes': 'No'), $data[5]);421 ($data[4] eq 'y' ? ($ncust == 0 ? 'Yes<small>*</small>' : 'Yes') : 'No'), $data[5]); 415 422 # If the allocation is a pool, allow listing of the IPs in the pool. 416 423 if ($data[2] =~ /^.[pd]$/) { … … 841 848 print qq(<div class="center"><div class="heading">The IP $msg has been allocated to customer $webvar{custid}</div>). 842 849 ( ($webvar{alloctype} eq 'di' && $webvar{billinguser}) ? 843 qq(<div><a href="https://billing.example.com/ extserv.pl?).850 qq(<div><a href="https://billing.example.com/radius.pl?). 844 851 "action=new_radius_user&custid=$webvar{custid}&userid=$webvar{billinguser}". 845 852 qq(&ipdb=1&ip=$msg">Add this IP to RADIUS user table</a></div>) … … 854 861 "sucessfully added as: $disp_alloctypes{$webvar{alloctype}}</div>". 855 862 ( ($webvar{alloctype} eq 'pr' && $webvar{billinguser}) ? 856 qq(<div><a href="https://billing.example.com/ extserv.pl?).863 qq(<div><a href="https://billing.example.com/radius.pl?). 857 864 "action=new_radius_user&custid=$webvar{custid}&userid=$webvar{billinguser}". 858 865 "&route_subnet=".$netblock->addr."&subnet_slash=".$netblock->masklen. … … 1120 1127 my $html = join('', <HTML>); 1121 1128 1129 # Link back to browse-routed or list-pool page on "Update complete" page. 1130 my $backlink = "/ip/cgi-bin/main.cgi?action="; 1131 my $cblock; # to contain the CIDR of the container block we're retrieving. 1132 my $sql; 1133 if (my $pooltype = ($webvar{alloctype} =~ /^(.)i$/) ) { 1134 $sql = "select pool from poolips where ip='$webvar{block}'"; 1135 $backlink .= "listpool&pool="; 1136 } else { 1137 $sql = "select cidr from routed where cidr >>= '$webvar{block}'"; 1138 $backlink .= "showrouted&block="; 1139 } 1140 # I define there to be no errors on this operation... so we don't need to check for them. 1141 $sth = $ip_dbh->prepare($sql); 1142 $sth->execute; 1143 $sth->bind_columns(\$cblock); 1144 $sth->fetch(); 1145 $sth->finish; 1146 $backlink .= $cblock; 1147 1122 1148 my $swiptmp = ($webvar{swip} eq 'on' ? 'Yes' : 'No'); 1123 1149 $html =~ s/\$\$BLOCK\$\$/$webvar{block}/g; … … 1134 1160 $webvar{notes} = desanitize($webvar{notes}); 1135 1161 $html =~ s/\$\$NOTES\$\$/$webvar{notes}/g; 1162 $html =~ s/\$\$BACKLINK\$\$/$backlink/g; 1163 $html =~ s/\$\$BACKBLOCK\$\$/$cblock/g; 1136 1164 1137 1165 if ($IPDBacl{$authuser} =~ /s/) {
Note:
See TracChangeset
for help on using the changeset viewer.