Ignore:
Timestamp:
09/21/05 14:09:35 (19 years ago)
Author:
Kris Deugau
Message:

/branches/privdata

Add capability to enter priviledged or restricted data
directly for new allocations.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/privdata/cgi-bin/main.cgi

    r280 r282  
    626626  }
    627627  $html =~ s|\$\$ALLCITIES\$\$|$cities|g;
     628
     629  my $i = 0;
     630  $i++ if $webvar{fbtype} eq 'y';
     631  # Check to see if user is allowed to do anything with sensitive data
     632  my $privdata = '';
     633  if ($IPDBacl{$authuser} =~ /s/) {
     634    $privdata = qq(<tr class="color).($i%2).qq("><td>Restricted data:</td>).
     635        qq(<td class=regular><textarea rows="3" cols="64" name="privdata" class="regular">).
     636        qq(</textarea></td></tr>\n);
     637    $i++;
     638  }
     639  $html =~ s/\$\$PRIVDATA\$\$/$privdata/g;
     640
     641  $i = $i % 2;
     642  $html =~ s/\$\$BUTTONROWCOLOUR\$\$/color$i/;
    628643
    629644  print $html;
     
    789804  $html =~ s|\$\$ACTION\$\$|insert|g;
    790805
     806  my $i=1;
     807  # Check to see if user is allowed to do anything with sensitive data
     808  my $privdata = '';
     809  if ($IPDBacl{$authuser} =~ /s/) {
     810    $privdata = qq(<tr class="color).($i%2).qq("><td>Restricted data:</td>).
     811        qq(<td class=regular>$webvar{privdata}).
     812        qq(<input type=hidden name=privdata value="$webvar{privdata}"></td></tr>\n);
     813    $i++;
     814  }
     815  $html =~ s/\$\$PRIVDATA\$\$/$privdata/g;
     816
     817  $i = $i % 2;
     818  $html =~ s/\$\$BUTTONROWCOLOUR\$\$/color$i/;
     819
    791820  print $html;
    792821
     
    803832  return if !validateInput();
    804833
     834  if (!defined($webvar{privdata})) {
     835    $webvar{privdata} = '';
     836  }
    805837  # $code is "success" vs "failure", $msg contains OK for a
    806838  # successful netblock allocation, the IP allocated for static
     
    808840  my ($code,$msg) = allocateBlock($ip_dbh, $webvar{fullcidr}, $webvar{alloc_from},
    809841        $webvar{custid}, $webvar{alloctype}, $webvar{city}, $webvar{desc}, $webvar{notes},
    810         $webvar{circid});
     842        $webvar{circid}, $webvar{privdata});
    811843
    812844  if ($code eq 'OK') {
     
    11051137  }
    11061138
    1107   my ($cidr, $custid, $type, $city, $circid, $desc, $notes, $alloctype);
     1139  my ($cidr, $custid, $type, $city, $circid, $desc, $notes, $alloctype, $privdata);
    11081140
    11091141  if ($webvar{alloctype} eq 'rm') {
Note: See TracChangeset for help on using the changeset viewer.