Index: /branches/stable/cgi-bin/IPDB.pm
===================================================================
--- /branches/stable/cgi-bin/IPDB.pm	(revision 355)
+++ /branches/stable/cgi-bin/IPDB.pm	(revision 356)
@@ -25,5 +25,5 @@
 	%allocated %free %routed %bigfree %IPDBacl
 	&initIPDBGlobals &connectDB &finish &checkDBSanity &allocateBlock &deleteBlock
-	&mailNotify
+	&getBlockData &mailNotify
 	);
 
@@ -33,5 +33,5 @@
 		@masterblocks %allocated %free %routed %bigfree %IPDBacl
 		&initIPDBGlobals &connectDB &finish &checkDBSanity &allocateBlock
-		&deleteBlock &mailNotify
+		&deleteBlock &getBlockData &mailNotify
 		)]
 	);
@@ -668,4 +668,17 @@
 
 
+## IPDB::getBlockData()
+# Return custid, type, city, and description for a block
+sub getBlockData {
+  my $dbh = shift;
+  my $block = shift;
+
+  my $sth = $dbh->prepare("select cidr,custid,type,city,description from searchme".
+	" where cidr='$block'");
+  $sth->execute();
+  return $sth->fetchrow_array();
+} # end getBlockData()
+
+
 ## IPDB::mailNotify()
 # Sends notification mail to recipients regarding an IPDB operation
Index: /branches/stable/cgi-bin/main.cgi
===================================================================
--- /branches/stable/cgi-bin/main.cgi	(revision 355)
+++ /branches/stable/cgi-bin/main.cgi	(revision 356)
@@ -1298,12 +1298,17 @@
   }
 
+  # need to retrieve block data before deleting so we can notify on that
+  my ($cidr,$custid,$type,$city,$description) = getBlockData($ip_dbh, $webvar{block});
+
   my ($code,$msg) = deleteBlock($ip_dbh, $webvar{block}, $webvar{alloctype});
 
   if ($code eq 'OK') {
     print "<div class=heading align=center>Success!  $webvar{block} deallocated.</div>\n";
-    syslog "notice", "$authuser deallocated '$webvar{alloctype}'-type netblock $webvar{block}";
+    syslog "notice", "$authuser deallocated '$webvar{alloctype}'-type netblock $webvar{block}".
+	" $custid, $city, desc='$description'";
     # Notify tech@ when a block/IP is deallocated
     mailNotify('tech@example.com',"REMOVED: $disp_alloctypes{$webvar{alloctype}} $webvar{block}",
-	"$disp_alloctypes{$webvar{alloctype}} $webvar{block} deallocated by $authuser\n");
+	"$disp_alloctypes{$webvar{alloctype}} $webvar{block} deallocated by $authuser\n".
+	"CustID: $custid\nCity: $city\nDescription: $description\n");
   } else {
     if ($webvar{alloctype} =~ /^.i$/) {
