Index: branches/privdata/assign.html
===================================================================
--- branches/privdata/assign.html	(revision 281)
+++ branches/privdata/assign.html	(revision 282)
@@ -36,5 +36,7 @@
 </tr><tr class="color1">
 <td>Notes:&nbsp;</td><td><textarea name="notes" rows="3" cols="40"></textarea></td>
-</tr><tr class="color2">
+</tr>
+$$PRIVDATA$$
+<tr class="$$BUTTONROWCOLOUR$$">
 <td class="center" colspan="2"><input type="submit" value="  Assign  "></td>
 <input type="hidden" name="action" value="confirm">
Index: branches/privdata/cgi-bin/IPDB.pm
===================================================================
--- branches/privdata/cgi-bin/IPDB.pm	(revision 281)
+++ branches/privdata/cgi-bin/IPDB.pm	(revision 282)
@@ -184,9 +184,9 @@
 # Does all of the magic of actually allocating a netblock
 # Requires database handle, block to allocate, custid, type, city,
-#	description, notes, circuit ID, block to allocate from, 
+#	description, notes, circuit ID, block to allocate from, private data
 # Returns a success code and optional error message.
 sub allocateBlock {
-  my ($dbh,undef,undef,$custid,$type,$city,$desc,$notes,$circid) = @_;
-  
+  my ($dbh,undef,undef,$custid,$type,$city,$desc,$notes,$circid,$privdata) = @_;
+
   my $cidr = new NetAddr::IP $_[1];
   my $alloc_from = new NetAddr::IP $_[2];
@@ -220,5 +220,5 @@
       $sth = $dbh->prepare("update poolips set custid='$custid',".
 	"city='$city',available='n',description='$desc',notes='$notes',".
-	"circuitid='$circid'".
+	"circuitid='$circid',privdata='$privdata'".
 	" where ip='$cidr'");
       $sth->execute;
@@ -263,7 +263,7 @@
 	  }
 	  $sth = $dbh->prepare("insert into allocations".
-		" (cidr,custid,type,city,description,notes,maskbits,circuitid)".
+		" (cidr,custid,type,city,description,notes,maskbits,circuitid,privdata)".
 		" values ('$cidr','$custid','$type','$city','$desc','$notes',".
-		$cidr->masklen.",'$circid')");
+		$cidr->masklen.",'$circid','$privdata')");
 	  $sth->execute;
 
@@ -361,7 +361,7 @@
 	  # Insert the allocations entry
 	  $sth = $dbh->prepare("insert into allocations (cidr,custid,type,city,".
-		"description,notes,maskbits,circuitid)".
+		"description,notes,maskbits,circuitid,privdata)".
 		" values ('$cidr','$custid','$type','$city','$desc','$notes',".
-		$cidr->masklen.",'$circid')");
+		$cidr->masklen.",'$circid','$privdata')");
 	  $sth->execute;
 
Index: branches/privdata/cgi-bin/main.cgi
===================================================================
--- branches/privdata/cgi-bin/main.cgi	(revision 281)
+++ branches/privdata/cgi-bin/main.cgi	(revision 282)
@@ -626,4 +626,19 @@
   }
   $html =~ s|\$\$ALLCITIES\$\$|$cities|g;
+
+  my $i = 0;
+  $i++ if $webvar{fbtype} eq 'y';
+  # Check to see if user is allowed to do anything with sensitive data
+  my $privdata = '';
+  if ($IPDBacl{$authuser} =~ /s/) {
+    $privdata = qq(<tr class="color).($i%2).qq("><td>Restricted data:</td>).
+        qq(<td class=regular><textarea rows="3" cols="64" name="privdata" class="regular">).
+        qq(</textarea></td></tr>\n);
+    $i++;
+  }
+  $html =~ s/\$\$PRIVDATA\$\$/$privdata/g;
+
+  $i = $i % 2;
+  $html =~ s/\$\$BUTTONROWCOLOUR\$\$/color$i/;
 
   print $html;
@@ -789,4 +804,18 @@
   $html =~ s|\$\$ACTION\$\$|insert|g;
 
+  my $i=1;
+  # Check to see if user is allowed to do anything with sensitive data
+  my $privdata = '';
+  if ($IPDBacl{$authuser} =~ /s/) {
+    $privdata = qq(<tr class="color).($i%2).qq("><td>Restricted data:</td>).
+        qq(<td class=regular>$webvar{privdata}).
+	qq(<input type=hidden name=privdata value="$webvar{privdata}"></td></tr>\n);
+    $i++;
+  }
+  $html =~ s/\$\$PRIVDATA\$\$/$privdata/g;
+
+  $i = $i % 2;
+  $html =~ s/\$\$BUTTONROWCOLOUR\$\$/color$i/;
+
   print $html;
 
@@ -803,4 +832,7 @@
   return if !validateInput();
 
+  if (!defined($webvar{privdata})) {
+    $webvar{privdata} = '';
+  }
   # $code is "success" vs "failure", $msg contains OK for a
   # successful netblock allocation, the IP allocated for static
@@ -808,5 +840,5 @@
   my ($code,$msg) = allocateBlock($ip_dbh, $webvar{fullcidr}, $webvar{alloc_from},
 	$webvar{custid}, $webvar{alloctype}, $webvar{city}, $webvar{desc}, $webvar{notes},
-	$webvar{circid});
+	$webvar{circid}, $webvar{privdata});
 
   if ($code eq 'OK') {
@@ -1105,5 +1137,5 @@
   }
 
-  my ($cidr, $custid, $type, $city, $circid, $desc, $notes, $alloctype);
+  my ($cidr, $custid, $type, $city, $circid, $desc, $notes, $alloctype, $privdata);
 
   if ($webvar{alloctype} eq 'rm') {
Index: branches/privdata/confirm.html
===================================================================
--- branches/privdata/confirm.html	(revision 281)
+++ branches/privdata/confirm.html	(revision 282)
@@ -21,8 +21,9 @@
 <td valign="top">Notes:&nbsp</td><td>&nbsp;$$NOTES$$<input type="hidden" name="notes" value="$$NOTES$$"></td>
 </tr>
+$$PRIVDATA$$
 <!-- warn -->
 <input type="hidden" name="alloctype" value="$$ALLOC_TYPE$$">
 <input type="hidden" name="action" value="$$ACTION$$">
-<tr class="color1">
+<tr class="$$BUTTONROWCOLOUR$$">
 <td class="center" colspan="2">
 <input type="button" value="Back" onclick="history.go(-1)"><input type="submit" value="Confirm">
Index: branches/privdata/fb-assign.html
===================================================================
--- branches/privdata/fb-assign.html	(revision 281)
+++ branches/privdata/fb-assign.html	(revision 282)
@@ -22,5 +22,7 @@
 </tr><tr class="color2">
 <td>Notes:&nbsp;</td><td><textarea name="notes" rows="3" cols="40"></textarea></td>
-</tr><tr class="color1">
+</tr>
+$$PRIVDATA$$
+<tr class="$$BUTTONROWCOLOUR$$">
 <td class="center" colspan="2"><input type="submit" value="  Assign  "></td>
 <input type="hidden" name="action" value="confirm">
