Changeset 866
- Timestamp:
- 05/02/16 17:59:07 (9 years ago)
- Location:
- trunk/cgi-bin
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cgi-bin/IPDB.pm
r862 r866 1216 1216 my $dbh = shift; 1217 1217 my $pool = shift; 1218 my $incdesc = shift; 1219 $incdesc = 1 if !defined($incdesc); # extra flag to include description and "deleteme" flag 1218 1220 1219 1221 my $sth = $dbh->prepare("SELECT ip,custid,available,description,type,id". … … 1226 1228 custid => $custid, 1227 1229 available => $available, 1228 desc => $desc,1229 delme => $available eq 'n',1230 1230 parent => $pool, 1231 1231 id => $id, 1232 1232 ); 1233 if ($incdesc) { 1234 $row{desc} = $desc; 1235 $row{delme} = ($available eq 'n'); 1236 } 1233 1237 push @poolips, \%row; 1234 1238 } -
trunk/cgi-bin/ipdb-rpc.cgi
r852 r866 199 199 sub rpc_listAllocations {} 200 200 sub rpc_listFree {} 201 sub rpc_listPool {} 201 202 203 sub rpc_listPool { 204 my %args = @_; 205 206 _commoncheck(\%args, 'y'); 207 208 $args{include_desc} = 0 if !$args{include_desc}; 209 210 # convert passed pool from CIDR to an ID, maybe 211 if ($args{pool} !~ /^\d+$/) { 212 die "Invalid pool argument" if $args{pool} !~ m{^\d+\.\d+\.\d+\.\d+/\d+$}; 213 die "VRF is required\n" if !$args{vrf}; # VRF name may not be empty 214 ($pid) = $ip_dbh->selectrow_array("SELECT a.id FROM allocations a JOIN allocations m ON a.master_id=m.id". 215 " WHERE a.cidr = ? AND m.vrf = ?", undef, $args{pool}, $args{vrf}); 216 } 217 218 return listPool($ip_dbh, $pid, $args{include_desc}); 219 } # rpc_listPool() 220 221 202 222 sub rpc_getMasterList {} 203 223 sub rpc_getTypeList {} … … 291 311 _commoncheck(\%args, 'y'); 292 312 293 _validateInput(\%args); 313 if (!$args{block}) { 314 $args{block} = $args{cidr} if $args{cidr}; 315 die "Block/IP is required\n" if !$args{block}; 316 } 294 317 295 318 if ($args{block} =~ m{^(?:\d+\.){3}\d+(?:/32)?$}) { -
trunk/cgi-bin/main.cgi
r855 r866 474 474 $page->param(maydel => $IPDBacl{$authuser} =~ /d/); 475 475 476 my $plist = listPool($ip_dbh, $webvar{pool} );476 my $plist = listPool($ip_dbh, $webvar{pool}, 1); 477 477 $page->param(poolips => $plist); 478 478 } # end showPool … … 1111 1111 my $revlist = getRevID($ip_dbh, user => $authuser, cidr => $blockinfo->{block}, 1112 1112 location => $blockinfo->{location}); 1113 $page->param(revlist => $revlist) ;1113 $page->param(revlist => $revlist) if $revlist; 1114 1114 1115 1115 my $cached;
Note:
See TracChangeset
for help on using the changeset viewer.