Changeset 280 for branches/privdata/cgi-bin/main.cgi
- Timestamp:
- 09/16/05 17:21:57 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/privdata/cgi-bin/main.cgi
r261 r280 904 904 # because I'm lazy, we'll try to make the SELECT's bring out identical)ish) data 905 905 if ($webvar{block} =~ /\/32$/) { 906 $sql = "select ip,custid,type,city,circuitid,description,notes,modifystamp from poolips where ip='$webvar{block}'";906 $sql = "select ip,custid,type,city,circuitid,description,notes,modifystamp,privdata from poolips where ip='$webvar{block}'"; 907 907 } else { 908 $sql = "select cidr,custid,type,city,circuitid,description,notes,modifystamp from allocations where cidr='$webvar{block}'"908 $sql = "select cidr,custid,type,city,circuitid,description,notes,modifystamp,privdata from allocations where cidr='$webvar{block}'" 909 909 } 910 910 … … 971 971 my $i=1; 972 972 973 # Check to see if we can display sensitive data 974 my $privdata = ''; 975 if ($IPDBacl{$authuser} =~ /s/) { 976 $privdata = qq(<tr class="color).($i%2).qq("><td class=heading>Restricted data:</td>). 977 qq(<td class=regular><textarea rows="3" cols="64" name="privdata" class="regular">). 978 qq($data[8]</textarea></td></tr>\n); 979 $i++; 980 } 981 $html =~ s/\$\$PRIVDATA\$\$/$privdata/g; 982 973 983 # More ACL trickery - we can live with forms that don't submit, 974 984 # but we can't leave the extra table rows there, and we *really* … … 976 986 my $updok = ''; 977 987 if ($IPDBacl{$authuser} =~ /c/) { 978 $updok = qq(<tr class="color $i"><td colspan=2><div class="center">).988 $updok = qq(<tr class="color).($i%2).qq("><td colspan=2><div class="center">). 979 989 qq(<input type="submit" value=" Update this block " class="regular">). 980 990 "</div></td></tr></form>\n"; … … 986 996 if ($IPDBacl{$authuser} =~ /d/) { 987 997 $delok = qq(<form method="POST" action="main.cgi"> 988 <tr class="color $i"><td colspan=2 class="regular"><div class=center>998 <tr class="color).($i%2).qq("><td colspan=2 class="regular"><div class=center> 989 999 <input type="hidden" name="action" value="delete"> 990 1000 <input type="hidden" name="block" value="$webvar{block}"> … … 1003 1013 # action=update 1004 1014 sub update { 1015 if ($IPDBacl{$authuser} !~ /c/) { 1016 printError("You shouldn't have been able to get here. Access denied."); 1017 return; 1018 } 1019 1020 # Check to see if we can update restricted data 1021 my $privdata = ''; 1022 if ($IPDBacl{$authuser} =~ /s/) { 1023 $privdata = ",privdata='$webvar{privdata}'"; 1024 } 1005 1025 1006 1026 # Make sure incoming data is in correct format - custID among other things. … … 1013 1033 if (my $pooltype = ($webvar{alloctype} =~ /^(.)i$/) ) { 1014 1034 $sql = "update poolips set custid='$webvar{custid}',notes='$webvar{notes}',". 1015 "circuitid='$webvar{circid}',description='$webvar{desc}',city='$webvar{city}' 1016 " where ip='$webvar{block}'";1035 "circuitid='$webvar{circid}',description='$webvar{desc}',city='$webvar{city}'". 1036 "$privdata where ip='$webvar{block}'"; 1017 1037 } else { 1018 1038 $sql = "update allocations set custid='$webvar{custid}',". 1019 1039 "description='$webvar{desc}',notes='$webvar{notes}',city='$webvar{city}',". 1020 "type='$webvar{alloctype}',circuitid='$webvar{circid}' where cidr='$webvar{block}'"; 1040 "type='$webvar{alloctype}',circuitid='$webvar{circid}'$privdata ". 1041 "where cidr='$webvar{block}'"; 1021 1042 } 1022 1043 # Log the details of the change. … … 1054 1075 $html =~ s/\$\$NOTES\$\$/$webvar{notes}/g; 1055 1076 1077 if ($IPDBacl{$authuser} =~ /s/) { 1078 $privdata = qq(<tr class="color2"><td valign="top">Restricted data:</td>). 1079 qq(<td class="regular">).desanitize($webvar{privdata}).qq(</td></tr>\n); 1080 } 1081 $html =~ s/\$\$PRIVDATA\$\$/$privdata/g; 1082 1056 1083 print $html; 1057 1084
Note:
See TracChangeset
for help on using the changeset viewer.