Changeset 476 for branches/htmlform
- Timestamp:
- 08/25/10 15:16:21 (14 years ago)
- Location:
- branches/htmlform
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/htmlform/cgi-bin/main.cgi
r474 r476 1102 1102 mailNotify($ip_dbh, 's:swi', "SWIPed: $disp_alloctypes{$webvar{alloctype}} $webvar{block}", 1103 1103 "$webvar{block} had SWIP status changed to \"Yes\" by $authuser") if $webvar{swip} eq 'on'; 1104 open (HTML, "../updated.html") 1105 or croak "Could not open updated.html :$!"; 1106 my $html = join('', <HTML>); 1104 1105 ## node hack 1106 if ($webvar{node} && $webvar{node} ne '-') { 1107 $sth = $ip_dbh->prepare("SELECT node_name FROM nodes WHERE node_id=?"); 1108 $sth->execute($webvar{node}); 1109 my ($nodename) = $sth->fetchrow_array(); 1110 $page->param(nodename => $nodename); 1111 } 1112 ## end node hack 1107 1113 1108 1114 # Link back to browse-routed or list-pool page on "Update complete" page. 1109 my $backlink = "/ip/cgi-bin/main.cgi?action=";1110 1115 my $cblock; # to contain the CIDR of the container block we're retrieving. 1111 1116 my $sql; 1112 1117 if (my $pooltype = ($webvar{alloctype} =~ /^(.)i$/) ) { 1118 $page->param(backpool => 1); 1113 1119 $sql = "select pool from poolips where ip='$webvar{block}'"; 1114 $backlink .= "listpool&pool=";1115 1120 } else { 1116 1121 $sql = "select cidr from routed where cidr >>= '$webvar{block}'"; 1117 $backlink .= "showrouted&block=";1118 1122 } 1119 1123 # I define there to be no errors on this operation... so we don't need to check for them. … … 1123 1127 $sth->fetch(); 1124 1128 $sth->finish; 1125 $backlink .= $cblock; 1126 1127 my $swiptmp = ($webvar{swip} eq 'on' ? 'Yes' : 'No'); 1128 $html =~ s/\$\$BLOCK\$\$/$webvar{block}/g; 1129 $webvar{city} = $q->escapeHTML($webvar{city}); 1130 $html =~ s/\$\$CITY\$\$/$webvar{city}/g; 1131 $html =~ s/\$\$ALLOCTYPE\$\$/$webvar{alloctype}/g; 1132 $html =~ s/\$\$TYPEFULL\$\$/$disp_alloctypes{$webvar{alloctype}}/g; 1133 $html =~ s/\$\$CUSTID\$\$/$webvar{custid}/g; 1134 $html =~ s/\$\$SWIP\$\$/$swiptmp/g; 1135 $webvar{circid} = $q->escapeHTML($webvar{circid}); 1136 $html =~ s/\$\$CIRCID\$\$/$webvar{circid}/g; 1137 $webvar{desc} = $q->escapeHTML($webvar{desc}); 1138 $html =~ s/\$\$DESC\$\$/$webvar{desc}/g; 1139 $webvar{notes} = $q->escapeHTML($webvar{notes}); 1140 $html =~ s/\$\$NOTES\$\$/$webvar{notes}/g; 1141 $html =~ s/\$\$BACKLINK\$\$/$backlink/g; 1142 $html =~ s/\$\$BACKBLOCK\$\$/$cblock/g; 1143 1144 if ($IPDBacl{$authuser} =~ /s/) { 1145 $privdata = qq(<tr class="color2"><td valign="top">Restricted data:</td>). 1146 qq(<td class="regular">).$q->escapeHTML($webvar{privdata}).qq(</td></tr>\n); 1147 } 1148 $html =~ s/\$\$PRIVDATA\$\$/$privdata/g; 1149 1150 print $html; 1129 $page->param(backblock => $cblock); 1130 1131 $page->param(cidr => $webvar{block}); 1132 $page->param(city => $webvar{city}); 1133 $page->param(disptype => $disp_alloctypes{$webvar{alloctype}}); 1134 $page->param(custid => $webvar{custid}); 1135 $page->param(swip => $webvar{swip} eq 'on' ? 'Yes' : 'No'); 1136 $page->param(circid => $q->escapeHTML($webvar{circid})); 1137 $page->param(desc => $q->escapeHTML($webvar{desc})); 1138 $page->param(notes => $q->escapeHTML($webvar{notes})); 1139 $webvar{privdata} = ($webvar{privdata} ? $q->escapeHTML($webvar{privdata}) : " "); 1140 $page->param(privdata => $webvar{privdata}) 1141 if $IPDBacl{$authuser} =~ /s/; 1151 1142 1152 1143 } # update() … … 1241 1232 sub finalDelete { 1242 1233 if ($IPDBacl{$authuser} !~ /d/) { 1243 printError("You shouldn't have been able to get here. Access denied.");1234 $page->param(aclerr => 1); 1244 1235 return; 1245 1236 } … … 1250 1241 my ($code,$msg) = deleteBlock($ip_dbh, $webvar{block}, $webvar{alloctype}); 1251 1242 1243 $page->param(block => $webvar{block}); 1252 1244 if ($code eq 'OK') { 1253 print "<div class=heading align=center>Success! $webvar{block} deallocated.</div>\n";1254 1245 syslog "notice", "$authuser deallocated '$webvar{alloctype}'-type netblock $webvar{block}". 1255 1246 " $custid, $city, desc='$description'"; … … 1258 1249 "CustID: $custid\nCity: $city\nDescription: $description\n"); 1259 1250 } else { 1251 $page->param(failmsg => $msg); 1260 1252 if ($webvar{alloctype} =~ /^.i$/) { 1261 1253 syslog "err", "$authuser could not deallocate static IP '$webvar{block}': '$msg'"; 1262 printError("Could not deallocate static IP $webvar{block}: $msg");1263 1254 } else { 1264 1255 syslog "err", "$authuser could not deallocate netblock '$webvar{block}': '$msg'"; 1265 printError("Could not deallocate netblock $webvar{block}: $msg");1256 $page->param(netblock => 1); 1266 1257 } 1267 1258 } -
branches/htmlform/templates/edit.tmpl
r470 r476 51 51 <TMPL_IF typesupportsnodes> 52 52 <TMPL_IF maychange> 53 <select name= demarc><TMPL_UNLESS havenodeid>53 <select name="node"><TMPL_UNLESS havenodeid> 54 54 <option selected="selected">--</option></TMPL_UNLESS> 55 55 <TMPL_LOOP NAME=nodelist> -
branches/htmlform/templates/update.tmpl
r475 r476 19 19 20 20 <tr class="row1"> 21 <td>Demarc/tower:</td> 22 <td><TMPL_IF nodename><TMPL_VAR NAME=nodename><TMPL_ELSE>N/A</TMPL_IF></td> 23 </tr> 24 25 <tr class="row0"> 21 26 <td>Customer ID:</td> 22 27 <td><TMPL_VAR NAME=custid></td> 23 28 </tr> 24 29 25 <tr class="row 0">30 <tr class="row1"> 26 31 <td>SWIPed?:</td> 27 32 <td><TMPL_VAR NAME=swip></td> 28 33 </tr> 29 34 30 <tr class="row 1">35 <tr class="row0"> 31 36 <td>Circuit ID:</td> 32 37 <td><TMPL_VAR NAME=circid></td> 33 38 </tr> 34 39 35 <tr class="row 0">40 <tr class="row1"> 36 41 <td valign="top">Description/Name:</td> 37 42 <td><TMPL_VAR NAME=desc></td> 38 43 </tr> 39 44 40 <tr class="row 1">45 <tr class="row0"> 41 46 <td valign="top">Notes:</td> 42 47 <td><TMPL_VAR NAME=notes></td> … … 44 49 45 50 <TMPL_IF privdata> 46 <tr class=" color1">51 <tr class="row1"> 47 52 <td valign="top">Restricted data:</td> 48 <td><TMPL_VAR NAME=privdata> 49 </td> 53 <td><TMPL_VAR NAME=privdata></td> 50 54 </tr> 51 55 </TMPL_IF> 52 56 53 57 </table> 54 <p> 55 <div name="backlink"> 56 <a href="$$BACKLINK$$">Back to $$BACKBLOCK$$</a> 58 59 <br> 60 <div class="backlink"> 61 <a href="/ip/cgi-bin/main.cgi?action=<TMPL_IF backpool>listpool&pool=<TMPL_ELSE>showrouted&block=</TMPL_IF><TMPL_VAR NAME=backblock>">Back to <TMPL_VAR NAME=backblock></a> 57 62 </div> 58 </p>
Note:
See TracChangeset
for help on using the changeset viewer.