Changeset 469
- Timestamp:
- 08/12/10 18:00:54 (14 years ago)
- Location:
- branches/htmlform
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/htmlform/cgi-bin/main.cgi
r468 r469 982 982 ##fixme 983 983 # Needs thinking. Have to allow changes to city to correct errors, no? 984 # Also have areas where a routed block at a POP serves "many" cities/towns/named crossroads 984 985 $html =~ s/\$\$BLOCK\$\$/$webvar{block}/g; 986 987 # cidr,custid,type,city,circuitid,description,notes,modifystamp,privdata,swip 988 989 $page->param(block => $webvar{block}); 990 991 $page->param(custid => $data[1]); 992 $page->param(city => $data[3]); 993 $page->param(circid => $data[4]); 994 $page->param(desc => $data[5]); 995 $page->param(notes => $data[6]); 985 996 986 997 if ($IPDBacl{$authuser} =~ /c/) { 987 998 $html =~ s/\$\$CUSTID\$\$/<input type=text name=custid value="$data[1]" maxlength=15 class="regular">/; 988 989 # Screw it. Changing allocation types gets very ugly VERY quickly- especially990 # with the much longer list of allocation types.991 # We'll just show what type of block it is.992 993 # this has now been Requested, so here goes.994 995 999 ##fixme The check here should be built from the database 1000 # Need to expand to support pool types too 996 1001 if ($data[2] =~ /^.[ne]$/) { 1002 $page->param(changetype => $IPDBacl{$authuser} =~ /c/); 1003 $page->param(alloctype => [ 1004 { selme => ($data[2] eq 'me'), type => "me", disptype => "Dialup netblock" }, 1005 { selme => ($data[2] eq 'de'), type => "de", disptype => "Dynamic DSL netblock" }, 1006 { selme => ($data[2] eq 'ce'), type => "ce", disptype => "Dynamic cable netblock" }, 1007 { selme => ($data[2] eq 'we'), type => "we", disptype => "Dynamic wireless netblock" }, 1008 { selme => ($data[2] eq 'cn'), type => "cn", disptype => "Customer netblock" }, 1009 { selme => ($data[2] eq 'en'), type => "en", disptype => "End-use netblock" }, 1010 { selme => ($data[2] eq 'in'), type => "in", disptype => "Internal netblock" }, 1011 ] 1012 ); 1013 997 1014 # Block that can be changed 998 1015 my $blockoptions = "<select name=alloctype><option". … … 1010 1027 } 1011 1028 ## node hack 1029 ##fixme: this whole hack needs cleanup and generalization for all alloctypes 1012 1030 $sth = $ip_dbh->prepare("SELECT node_id FROM noderef WHERE block='$webvar{block}'"); 1013 1031 $sth->execute; 1014 1032 my ($nodeid) = $sth->fetchrow_array(); 1033 $page->param(havenodeid => $nodeid); 1034 $page->param(typesupportsnodes => ($data[2] eq 'fr' || $data[2] eq 'bi')); 1015 1035 if ($nodeid) { 1016 1036 $sth = $ip_dbh->prepare("SELECT node_id, node_name FROM nodes ORDER BY node_type,node_id"); 1017 1037 $sth->execute() or print "DEBUG: failed retrieval from nodes: ".$sth->errstr,"<br>\n"; 1018 1038 my $nodes = "<select name=node>\n"; 1039 my @nodelist; 1019 1040 while (my ($nid,$nname) = $sth->fetchrow_array()) { 1020 1041 $nodes .= "<option".($nodeid == $nid ? ' selected' : '')." value='$nid'>$nname</option>\n"; 1021 } 1042 my %row = ( 1043 selme => ($nodeid == $nid), 1044 nodeid => $nid, 1045 nodename => $nname, 1046 ); 1047 push (@nodelist, \%row); 1048 } 1049 $page->param(nodelist => \@nodelist); 1022 1050 $nodes .= "</select>\n"; 1023 1051 $html =~ s/\$\$NODE\$\$/$nodes/; … … 1061 1089 } 1062 1090 my ($lastmod,undef) = split /\s+/, $data[7]; 1063 $ html =~ s/\$\$LASTMOD\$\$/$lastmod/g;1091 $page->param(lastmod => $lastmod); 1064 1092 1065 1093 ## Hack time! SWIP isn't going to stay, so I'm not going to integrate it with ACLs. … … 1077 1105 # Check to see if we can display sensitive data 1078 1106 my $privdata = ''; 1107 $page->param(nocling => $IPDBacl{$authuser} =~ /s/); 1108 $page->param(privdata => $data[8]); 1109 1079 1110 if ($IPDBacl{$authuser} =~ /s/) { 1080 1111 $privdata = qq(<tr class="color).($i%2).qq("><td class=heading>Restricted data:</td>). … … 1089 1120 # can't leave the submit buttons there. 1090 1121 my $updok = ''; 1122 $page->param(maychange => $IPDBacl{$authuser} =~ /c/); 1091 1123 if ($IPDBacl{$authuser} =~ /c/) { 1092 1124 $updok = qq(<tr class="color).($i%2).qq("><td colspan=2><div class="center">). … … 1098 1130 1099 1131 my $delok = ''; 1132 $page->param(maydel => $IPDBacl{$authuser} =~ /d/); 1100 1133 if ($IPDBacl{$authuser} =~ /d/) { 1101 1134 $delok = qq(<form method="POST" action="main.cgi"> … … 1109 1142 $html =~ s/\$\$DELOK\$\$/$delok/; 1110 1143 1111 print $html;1144 # print $html; 1112 1145 1113 1146 } # edit() -
branches/htmlform/ipdb.css
r466 r469 96 96 font-family: Verdana, Arial, Helvetica, sans-serif; 97 97 } 98 tr.row0 { 98 /* for reasons of Please The Validation Gods, these may be applied to 99 things that are not technically table rows */ 100 .row0 { 99 101 background-color: #D0E0E0; 100 102 font-family: Verdana, Arial, Helvetica, sans-serif; 101 103 font-size: 90%; 102 104 } 103 tr.row1 {105 .row1 { 104 106 background-color: #A8C4D0; 105 107 font-family: Verdana, Arial, Helvetica, sans-serif;
Note:
See TracChangeset
for help on using the changeset viewer.