Index: branches/stable/cgi-bin/admin.cgi
===================================================================
--- branches/stable/cgi-bin/admin.cgi	(revision 291)
+++ branches/stable/cgi-bin/admin.cgi	(revision 292)
@@ -197,4 +197,5 @@
 <td class="center" colspan="2"><input type="submit" value="  Assign  "></td>
 <input type="hidden" name="action" value="confirm">
+</form>
 </tr>
 </table>
@@ -210,23 +211,37 @@
     printError("Invalid customer location!  Go back and select customer's location.");
   } else {
-    my ($retcode,$msg) = allocateBlock($ip_dbh, $webvar{cidr}, $webvar{alloc_from},
+    if ($webvar{alloctype} =~ /^.i$/) {
+      $sth = $ip_dbh->prepare("update poolips set available='n', custid='$webvar{custid}', ".
+	"city='$webvar{city}', description='$webvar{desc}', notes='$webvar{notes}' ".
+	"where ip='$webvar{cidr}'");
+      $sth->execute;
+      if ($sth->err) {
+	print "Allocation failed!  DBI said:\n".$sth->errstr."\n";
+        syslog "err", "($authuser) Allocation of '$webvar{cidr}' to '$webvar{custid}' as ".
+		"'$webvar{alloctype}' failed: '".$sth->errstr."'";
+      } else {
+	print "Allocation OK!\n";
+	syslog "notice", "$authuser allocated '$webvar{cidr}' to '$webvar{custid}' as ".
+		"'$webvar{alloctype}'";
+	# Notify tech@example.com
+	mailNotify('tech@example.com',"$disp_alloctypes{$webvar{alloctype}} allocation",
+	  "$disp_alloctypes{$webvar{alloctype}} $msg allocated to customer $webvar{custid}\n".
+	  "Description: $webvar{desc}\n\nAllocated by: $authuser\n");
+      }
+    } else {
+      my ($retcode,$msg) = allocateBlock($ip_dbh, $webvar{cidr}, $webvar{alloc_from},
 	$webvar{custid}, $webvar{alloctype}, $webvar{city}, $webvar{desc}, $webvar{notes},
 	$webvar{circid});
-    if ($retcode eq 'OK') {
-      print "Allocation OK!\n";
-
-      if ($webvar{alloctype} =~ /^.i$/) {
-        # Notify tech@example.com
-        mailNotify('tech@example.com',"$disp_alloctypes{$webvar{alloctype}} allocation",
-          "$disp_alloctypes{$webvar{alloctype}} $msg allocated to customer $webvar{custid}\n".
-          "Description: $webvar{desc}\n\nAllocated by: $authuser\n");
+      if ($retcode eq 'OK') {
+	print "Allocation OK!\n";
+	syslog "notice", "$authuser allocated '$webvar{cidr}' to '$webvar{custid}' as ".
+		"'$webvar{alloctype}'";
+      } else {
+	print "Allocation failed!  IPDB::allocateBlock said:\n$msg\n";
+        syslog "err", "($authuser) Allocation of '$webvar{cidr}' to '$webvar{custid}' as ".
+		"'$webvar{alloctype}' failed: '$msg'";
       }
-      syslog "notice", "$authuser allocated '$webvar{cidr}' to '$webvar{custid}' as ".
-	"'$webvar{alloctype}'";
-    } else {
-      print "Allocation failed!  IPDB::allocateBlock said:\n$msg\n";
-      syslog "err", "($authuser) Allocation of '$webvar{cidr}' to '$webvar{custid}' as ".
-	"'$webvar{alloctype}' failed: '$msg'";
-    }
+    } # static IP vs netblock
+
   } # done city check
 
