Changeset 189
- Timestamp:
- 03/08/05 17:37:46 (20 years ago)
- Location:
- trunk/cgi-bin
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cgi-bin/IPDB.pm
r187 r189 332 332 $sth->execute; 333 333 334 } else { # done with alloctype == r r334 } else { # done with alloctype == rm 335 335 336 336 # Insert the new freeblocks entries … … 339 339 $sth = $dbh->prepare("insert into freeblocks (cidr,maskbits,city,routed)". 340 340 " values (?, ?, (select city from routed where cidr >>= '$cidr'),'". 341 (($type =~ /^(.)r$/) ? '$1': 'y')."')");341 (($type =~ /^(.)r$/) ? "$1" : 'y')."')"); 342 342 foreach my $block (@newfreeblocks) { 343 343 $sth->execute("$block", $block->masklen); … … 370 370 } 371 371 372 } # done with netblock alloctype != r r372 } # done with netblock alloctype != rm 373 373 374 374 $dbh->commit; … … 577 577 " values ('$cidr',".$cidr->masklen. 578 578 ",(select city from routed where cidr >>= '$cidr'),'". 579 (($type =~ /^(.)r$/) ? '$1': 'y')."')");579 (($type =~ /^(.)r$/) ? "$1" : 'y')."')"); 580 580 } 581 581 $sth->execute; -
trunk/cgi-bin/ipdb.psql
r187 r189 120 120 GRANT ALL on "cities" to "ipdb"; 121 121 122 -- 123 -- Selected TOC Entries: 124 -- 125 \connect - ipdb 126 127 -- 128 -- TOC Entry ID 2 (OID 92809) 129 -- 130 -- Name: alloctypes Type: TABLE Owner: ipdb 131 -- 132 133 CREATE TABLE "alloctypes" ( 134 "type" character(2) DEFAULT '' NOT NULL, 135 "listname" character varying(40) DEFAULT '', 136 "dispname" character varying(40) DEFAULT '', 137 "listorder" integer DEFAULT 0, 138 "def_custid" character varying(16) DEFAULT '', 139 Constraint "alloctypes_pkey" Primary Key ("type") 140 ); 141 142 -- 143 -- TOC Entry ID 3 (OID 92809) 144 -- 145 -- Name: alloctypes Type: ACL Owner: 146 -- 147 148 REVOKE ALL on "alloctypes" from PUBLIC; 149 GRANT ALL on "alloctypes" to "kdeugau"; 150 GRANT ALL on "alloctypes" to "ipdb"; 151 152 -- 153 -- Data for TOC Entry ID 4 (OID 92809) 154 -- 155 -- Name: alloctypes Type: TABLE DATA Owner: ipdb 156 -- 157 158 122 159 COPY "alloctypes" FROM stdin; 123 160 cd Static Pool - Cable Cable pool 41 CBL-BUS … … 125 162 mp Static Pool - Dialup Static dialup pool 43 DIAL-BUS 126 163 wp Static Pool - Wireless Static wireless pool 44 WL-BUS 127 ce Dynamic cable block Dynamic cable block 103 CBL-RES128 de Dynamic DSL block Dynamic DSL block 102 DSL-RES129 me Dialup netblock Dialup netblock 101 DIAL-RES130 we Dynamic WiFi block Dynamic WiFi block 104 WL-RES131 164 mm Master block Master block 999 6750400 132 rm Routing Routed netblock 500 6750400133 165 in Internal netblock Internal netblock 990 6750400 134 en End-use netblock End-use netblock 100 6750400135 166 sd Static Pool - Servers Server pool 40 6750400 136 167 cn Customer netblock Customer netblock 0 … … 143 174 wr Internal WAN block Internal WAN block 201 6750400 144 175 pc Reserve for dynamic-route DSL netblocks Dynamic-route netblocks 202 6750400 176 en End-use netblock End-use netblock 100 6750400 177 me Dialup netblock Dialup netblock 101 DIAL-RES 178 de Dynamic DSL block Dynamic DSL block 102 DSL-RES 179 ce Dynamic cable block Dynamic cable block 103 CBL-RES 180 we Dynamic WiFi block Dynamic WiFi block 104 WL-RES 181 rm Routing Routed netblock 500 6750400 145 182 pr Dynamic-route DSL netblock Dynamic-route DSL 203 146 183 \. -
trunk/cgi-bin/main.cgi
r187 r189 890 890 $sql = "select cidr from freeblocks where city='$city' and maskbits<=$webvar{maskbits}". 891 891 " and cidr <<= '$webvar{allocfrom}' and routed='". 892 (($webvar{alloctype} =~ /^(.)r$/) ? '$1' : 'y')."' order by cidr,maskbits desc";892 (($webvar{alloctype} =~ /^(.)r$/) ? "$1" : 'y')."' order by maskbits desc,cidr"; 893 893 } else { 894 894 $sql = "select cidr from freeblocks where city='$city' and maskbits<=$webvar{maskbits}". 895 " and routed='".(($webvar{alloctype} =~ /^(.)r$/) ? '$1': 'y').896 "' order by cidr,maskbits desc";895 " and routed='".(($webvar{alloctype} =~ /^(.)r$/) ? "$1" : 'y'). 896 "' order by maskbits desc,cidr"; 897 897 } 898 898 } … … 976 976 } else { 977 977 print qq(<div class="center"><div class="heading">The block $webvar{fullcidr} was ). 978 "sucessfully added as type '$webvar{alloctype}' ". 979 "($disp_alloctypes{$webvar{alloctype}})</div></div>"; 978 "sucessfully added as: $disp_alloctypes{$webvar{alloctype}}</div></div>"; 980 979 } 981 980 syslog "notice", "$authuser allocated '$webvar{fullcidr}' to '$webvar{custid}' as ". … … 984 983 syslog "err", "Allocation of '$webvar{fullcidr}' to '$webvar{custid}' as ". 985 984 "'$webvar{alloctype}' by $authuser failed: '$msg'"; 986 printError("Allocation of $webvar{fullcidr} as $disp_alloctypes{$webvar{alloctype}}".985 printError("Allocation of $webvar{fullcidr} as '$disp_alloctypes{$webvar{alloctype}}'". 987 986 " failed:<br>\n$msg\n"); 988 987 } … … 1232 1231 $desc = "N/A"; 1233 1232 $notes = "N/A"; 1234 } elsif ($webvar{alloctype} =~ /^.i$/) { # done with alloctype= rr1233 } elsif ($webvar{alloctype} =~ /^.i$/) { # done with alloctype=[rm]m 1235 1234 1236 1235 # Unassigning a static IP
Note:
See TracChangeset
for help on using the changeset viewer.