Changeset 418 for trunk/cgi-bin/admin.cgi
- Timestamp:
- 07/02/10 17:11:30 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cgi-bin/admin.cgi
r417 r418 309 309 <form action=admin.cgi method=POST> 310 310 <table border=1><tr> 311 <input type=hidden name=action value=newcust> 311 <input type=hidden name=action value=edcust> 312 <input type=hidden name=newcust value=1> 312 313 <td>CustID:</td><td><input name=custid></td> 313 < td>Name:</td><td><input name=name></td></tr>314 <tr><td>Street:</td><td><input name=street></td></tr> 314 <!-- <td>Name:</td><td><input name=name></td></tr> 315 <tr><td>Street:</td><td><input name=street></td></tr> --> 315 316 <!-- <td>Street2:</td><td><input name=street2></td> --> 316 < tr><td>City:</td><td><input name=city></td>317 <!-- <tr><td>City:</td><td><input name=city></td> 317 318 <td>Province: (2-letter code)</td><td><input name=province value=ON length=2 size=2></td></tr> 318 319 <tr><td>Country: (2-letter code)</td><td><input name=country value=CA length=2 size=2></td> 319 320 <td>Postal/ZIP Code:</td><td><input name=pocode></td></tr> 320 <tr><td>Phone:</td><td><input name=phone></td> 321 <tr><td>Phone:</td><td><input name=phone></td> --> 321 322 <!-- <td>Default rDNS:</td><td><input name=def_rdns></td></tr> 322 323 <td>Description:</td><td><input name=description></td> --> 324 <!-- </tr> 325 <tr> 323 326 <td>ARIN Handles:</td><td> 324 327 Tech: <input name=tech_handle value="VH25-ORG-ARIN"><br> … … 326 329 Admin: <input name=admin_handle><br> 327 330 Note: Only tech is required at the moment. 328 </td></tr> 329 <tr><td colspan=4 align=center><input type=submit value="Add"></td></tr> 331 </td> 332 <td>"Special":</td><td><textarea name=special rows=4 cols=40></textarea></td> 333 </tr> --> 334 <td align=center><input type=submit value="Go to edit page for this custid"></td></tr> 330 335 </form></table> 331 336 ); … … 373 378 } # bad custid 374 379 } elsif ($webvar{action} eq 'edcust') { 380 if ($webvar{newcust}) { 381 print "got here?\n"; 382 $sth = $ip_dbh->prepare("INSERT INTO customers (custid) VALUES (?)"); 383 $sth->execute($webvar{custid}); 384 } 375 385 $sth = $ip_dbh->prepare("select custid,name,street,city,province,". 376 386 "country,pocode,phone,tech_handle,abuse_handle,admin_handle ". … … 384 394 <td>CustID:</td><td>$custid<input type=hidden name=custid value=$custid></td> 385 395 <td>Name:</td><td><input name=name value="$name"></td></tr> 386 <tr><td>Street:</td><td><input name=street value="$street"></td> </tr>396 <tr><td>Street:</td><td><input name=street value="$street"></td> 387 397 <!-- <td>Street2:</td><td><input name=street2></td> --> 388 <t r><td>City:</td><td><input name=city value="$city"></td>389 <t d>Province: (2-letter code)</td><td><input name=province value="$prov" length=2 size=2></td></tr>390 <t r><td>Country: (2-letter code)</td><td><input name=country value="$country" length=2 size=2></td>391 <t d>Postal/ZIP Code:</td><td><input name=pocode value="$pocode"></td></tr>392 <t r><td>Phone:</td><td><input name=phone value="$pocode"></td>398 <td>City:</td><td><input name=city value="$city"></td></tr> 399 <tr><td>Province/State: (2-letter code)</td><td><input name=province value="$prov" length=2 size=2></td> 400 <td>Country: (2-letter code)</td><td><input name=country value="$country" length=2 size=2></td></tr> 401 <tr><td>Postal/ZIP Code:</td><td><input name=pocode value="$pocode"></td> 402 <td>Phone:</td><td><input name=phone value="$pocode"></td></tr> 393 403 <!-- <td>Default rDNS:</td><td><input name=def_rdns></td></tr> 394 404 <td>Description:</td><td><input name=description></td> --> 395 <t d>ARIN Handles:</td><td>405 <tr><td>Contacts/ARIN Handles:</td><td> 396 406 Tech: <input name=tech_handle value="$tech"><br> 397 407 Abuse: <input name=abuse_handle value="$abuse"><br> 398 408 Admin: <input name=admin_handle value="$admin"><br> 399 409 Note: Only tech is required at the moment. 400 </td></tr> 410 </td> 411 <td>"Special":</td><td><textarea name=special rows=4 cols=40></textarea></td> 412 </tr> 401 413 <tr><td colspan=4 align=center><input type=submit value="Update"></td></tr> 402 414 </form></table> 415 <div style="margin-left:5px"> 416 <h3>Explanation for "Special" field:</h3> 417 This is the field I've mangled into providing a custom WHOIS netname identifier for blocks tagged "SWIP". 418 It may be removed later, more likely migrated elsewhere. 419 <p>It's formatted like this, one line for each custom net name: 420 <pre>NetName[CIDR block]: NET-NAME</pre> 421 Example: 422 <pre>NetName209.91.133.0/24: CYBERSUDBURY-1</pre> 423 Note: 424 <ul style="margin-top: 0px;"> 425 <li>Spacing is important - there should only be ONE space, in between the colon and the net name. 426 <li>The CIDR block name nust include all four octets - no short forms are accepted. 427 <li>Net names must be all uppercase, and consist only of A-Z, 0-9, and - (same as for SWIPed net names). 428 </ul> 429 </div> 403 430 ); 404 431 405 432 } elsif ($webvar{action} eq 'updcust') { 406 print "Updated $webvar{custid}\n"; 433 $sth = $ip_dbh->prepare("UPDATE customers SET". 434 " name=?, street=?, city=?, province=?, country=?, pocode=?,". 435 " phone=?, tech_handle=?, abuse_handle=?, admin_handle=?, special=?". 436 " WHERE custid=?"); 437 $sth->execute($webvar{name}, $webvar{street}, $webvar{city}, $webvar{province}, 438 $webvar{country}, $webvar{pocode}, $webvar{phone}, $webvar{tech_handle}, 439 $webvar{abuse_handle}, $webvar{admin_handle}, $webvar{special}, $webvar{custid}); 440 print "Updated $webvar{custid}<br>\n". 441 qq(<table border=1> 442 <tr><td>CustID:</td><td>$webvar{custid}</td></tr> 443 <tr><td>Name:</td><td>$webvar{name}</td></tr> 444 <tr><td>Street:</td><td>$webvar{street}</td></tr> 445 <tr><td>City:</td><td>$webvar{city}</td></tr> 446 <tr><td>Province/State:</td><td>$webvar{province}</td></tr> 447 <tr><td>Country:</td><td>$webvar{country}</td></tr> 448 <tr><td>Postal/ZIP Code:</td><td>$webvar{pocode}</td></tr> 449 <tr><td>Phone:</td><td>$webvar{phone}</td></tr> 450 <!-- <td>Default rDNS:</td><td>$webvar{def_rdns}</td></tr> --> 451 <tr><td>Contacts/ARIN Handles:</td><td> 452 Tech: $webvar{tech_handle}<br> 453 Abuse: $webvar{abuse_handle}<br> 454 Admin: $webvar{admin_handle}<br> 455 </td></tr> 456 <tr><td>"Special":</td><td><textarea name=special rows=4 cols=40>$webvar{special}</textarea></td></tr> 457 </table> 458 <a href="admin.cgi?action=listcust">Back</a> to rWHOIS customer list<br>\n); 459 407 460 } elsif ($webvar{action} eq 'showpools') { 408 461 print "IP Pools currently allocated:\n".
Note:
See TracChangeset
for help on using the changeset viewer.