Changeset 705 for trunk/cgi-bin/main.cgi
- Timestamp:
- 02/25/15 18:09:13 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cgi-bin/main.cgi
r702 r705 875 875 $utilbar->param(breadcrumb => \@rcrumbs); 876 876 877 # Show link to IP list for pools 878 $page->param(ispool => 1) if $blockinfo->{type} =~ /^.[dp]$/; 879 877 880 # Clean up extra whitespace on alloc type. Mainly a legacy-data cleanup. 878 881 $blockinfo->{type} =~ s/\s//; … … 1092 1095 my $blockinfo = getBlockData($ip_dbh, $webvar{block}); 1093 1096 1097 # Tree navigation 1098 my $crumbs = getBreadCrumbs($ip_dbh, $blockinfo->{parent_id}); 1099 my @rcrumbs = reverse (@$crumbs); 1100 $utilbar->param(breadcrumb => \@rcrumbs); 1101 1094 1102 if ($blockinfo->{type} =~ /^.i$/) { 1095 1103 $page->param(err => "Can't split a single IP allocation"); … … 1110 1118 if ($blockinfo->{type} =~ /^.d$/) { 1111 1119 # Non-PPP pools 1120 $page->param(ispool => 1); 1112 1121 if ($oldmask+2 >= $block->bits) { 1113 1122 $page->param(err => "Can't split a standard netblock pool any further"); … … 1117 1126 $page->param(sp4mask => $oldmask+2) if $oldmask+2 <= $block->bits-2; 1118 1127 } elsif ($blockinfo->{type} =~ /.p/) { 1128 $page->param(ispool => 1); 1119 1129 # Allow splitting PPP pools down to v4 /31 1120 1130 $page->param(sp4mask => $oldmask+2) if $oldmask+2 <= $block->bits-1; … … 1144 1154 my $blockinfo = getBlockData($ip_dbh, $webvar{block}); 1145 1155 1156 # Tree navigation 1157 my $crumbs = getBreadCrumbs($ip_dbh, $blockinfo->{parent_id}); 1158 my @rcrumbs = reverse (@$crumbs); 1159 $utilbar->param(breadcrumb => \@rcrumbs); 1160 1146 1161 if ($blockinfo->{type} =~ /^.i$/) { 1147 1162 $page->param(err => "Can't split a single IP allocation"); … … 1151 1166 if ($webvar{subact} eq 'split') { 1152 1167 $page->param(issplit => 1); 1153 my $binfo = getBlockData($ip_dbh, $webvar{block}); 1154 $page->param(cidr => $binfo->{block}); 1155 my $block = new NetAddr::IP $binfo->{block}; 1168 my $block = new NetAddr::IP $blockinfo->{block}; 1156 1169 my $newblocks = splitBlock($ip_dbh, $webvar{block}, 'b', $webvar{split}); 1157 1170 if ($newblocks) { 1158 1171 $page->param(newblocks => $newblocks); 1159 # and the backlink to the parent container1160 my $pinfo = getBlockData($ip_dbh, $binfo->{parent_id});1161 $page->param(backid => $binfo->{parent_id});1162 $page->param(backblock => $pinfo->{block});1163 1172 } else { 1164 1173 $page->param(err => $IPDB::errstr); 1165 1174 } 1166 1175 1176 } elsif ($webvar{subact} eq 'shrink') { 1177 $page->param(nid => $webvar{block}); 1178 $page->param(newblock => $webvar{shrink}); 1179 my $newfree = shrinkBlock($ip_dbh, $webvar{block}, $webvar{shrink}); 1180 if ($newfree) { 1181 $page->param(newfb => $newfree); 1182 } else { 1183 $page->param(err => $IPDB::errstr); 1184 } 1185 1167 1186 } else { 1168 # Shrink 1169 } 1187 # Your llama is on fire. 1188 $page->param(err => "Missing form field that shouldn't be missing."); 1189 return; 1190 } 1191 1192 # common bits 1193 $page->param(cidr => $blockinfo->{block}); 1194 # and the backlink to the parent container 1195 my $pinfo = getBlockData($ip_dbh, $blockinfo->{parent_id}); 1196 $page->param(backid => $blockinfo->{parent_id}); 1197 $page->param(backblock => $pinfo->{block}); 1170 1198 } # doSplit() 1171 1199
Note:
See TracChangeset
for help on using the changeset viewer.