Changeset 244
- Timestamp:
- 04/27/05 17:27:22 (20 years ago)
- Location:
- branches/stable
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/cgi-bin/main.cgi
r242 r244 606 606 qq($master ($data[0]):</div></center><br>\n); 607 607 608 startTable('CIDR allocation','Customer Location','Type','CustID',' Description/Name');608 startTable('CIDR allocation','Customer Location','Type','CustID','SWIPed?','Description/Name'); 609 609 610 610 # Snag the allocations for this block 611 $sth = $ip_dbh->prepare("select cidr,city,type,custid, description".611 $sth = $ip_dbh->prepare("select cidr,city,type,custid,swip,description". 612 612 " from allocations where cidr <<= '$master' order by cidr"); 613 613 $sth->execute(); … … 615 615 my $count=0; 616 616 while (my @data = $sth->fetchrow_array()) { 617 # cidr,city,type,custid, description, as per the SELECT617 # cidr,city,type,custid,swip,description, as per the SELECT 618 618 my $cidr = new NetAddr::IP $data[0]; 619 619 … … 624 624 my @row = ( (($data[2] =~ /^.r$/) ? 'Sub ' : ''). 625 625 qq(<a href="/ip/cgi-bin/main.cgi?action=edit&block=$data[0]">$data[0]</a>), 626 $data[1], $disp_alloctypes{$data[2]}, $data[3], $data[4]); 626 $data[1], $disp_alloctypes{$data[2]}, $data[3], 627 ($data[4] eq 'y' ? 'Yes' : 'No'), $data[5]); 627 628 # If the allocation is a pool, allow listing of the IPs in the pool. 628 629 if ($data[2] =~ /^.[pd]$/) { … … 1114 1115 $sql = "select ip,custid,type,city,circuitid,description,notes from poolips where ip='$webvar{block}'"; 1115 1116 } else { 1116 $sql = "select cidr,custid,type,city,circuitid,description,notes from allocations where cidr='$webvar{block}'"1117 $sql = "select cidr,custid,type,city,circuitid,description,notes,swip from allocations where cidr='$webvar{block}'" 1117 1118 } 1118 1119 … … 1174 1175 } 1175 1176 1177 ## Hack time! SWIP isn't going to stay, so I'm not going to integrate it with ACLs. 1178 if ($data[2] =~ /.i/) { 1179 $html =~ s/\$\$SWIP\$\$/N\/A/; 1180 } else { 1181 my $tmp = (($data[7] eq 'n') ? '<input type=checkbox name=swip>' : 1182 '<input type=checkbox name=swip checked=yes>'); 1183 $html =~ s/\$\$SWIP\$\$/$tmp/; 1184 } 1185 1176 1186 # More ACL trickery - we can live with forms that don't submit, 1177 1187 # but we can't leave the extra table rows there, and we *really* … … 1222 1232 $sql = "update allocations set custid='$webvar{custid}',". 1223 1233 "description='$webvar{desc}',notes='$webvar{notes}',city='$webvar{city}',". 1224 "type='$webvar{alloctype}',circuitid='$webvar{circid}' where cidr='$webvar{block}'"; 1234 "type='$webvar{alloctype}',circuitid='$webvar{circid}',". 1235 "swip='".($webvar{swip} eq 'on' ? 'y' : 'n')."' ". 1236 " where cidr='$webvar{block}'"; 1225 1237 } 1226 1238 # Log the details of the change. … … 1245 1257 my $html = join('', <HTML>); 1246 1258 1259 my $swiptmp = ($webvar{swip} eq 'on' ? 'Yes' : 'No'); 1247 1260 $html =~ s/\$\$BLOCK\$\$/$webvar{block}/g; 1248 1261 $webvar{city} = desanitize($webvar{city}); … … 1251 1264 $html =~ s/\$\$TYPEFULL\$\$/$disp_alloctypes{$webvar{alloctype}}/g; 1252 1265 $html =~ s/\$\$CUSTID\$\$/$webvar{custid}/g; 1266 $html =~ s/\$\$SWIP\$\$/$swiptmp/g; 1253 1267 $webvar{circid} = desanitize($webvar{circid}); 1254 1268 $html =~ s/\$\$CIRCID\$\$/$webvar{circid}/g; -
branches/stable/editDisplay.html
r242 r244 14 14 <tr class="color2"><td class=heading>CustID:</td><td class="regular">$$CUSTID$$</td></tr> 15 15 16 <tr class="color2"><td class=heading>SWIPed?:</td><td class=regular>$$SWIP$$</td></tr> 17 16 18 <tr class="color1"><td class="heading">Circuit ID:</td><td class="regular">$$CIRCID$$</td></tr> 17 19 -
branches/stable/updated.html
r75 r244 6 6 <tr class="color1"><td>Type:</td><td>$$TYPEFULL$$</td></tr> 7 7 <tr class="color2"><td>Customer ID:</td><td>$$CUSTID$$</td></tr> 8 <tr class="color2"><td>SWIPed?:</td><td>$$SWIP$$</td></tr> 8 9 <tr class="color1"><td>Circuit ID:</td><td>$$CIRCID$$</td></tr> 9 10 <tr class="color2"><td valign="top">Description/Name:</td><td>$$DESC$$</td></tr>
Note:
See TracChangeset
for help on using the changeset viewer.