Changeset 64 for branches/stable/cgi-bin/main.cgi
- Timestamp:
- 11/12/04 12:37:17 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/cgi-bin/main.cgi
r56 r64 119 119 $sth = $ip_dbh->prepare("insert into masterblocks values ('$webvar{cidr}')"); 120 120 $sth->execute; 121 # Don't need this with RaiseError, but leave it for now.122 # croak $sth->errstr if ($sth->errstr());123 121 124 122 # Unrouted blocks aren't associated with a city (yet). We don't rely on this … … 129 127 $cidr->masklen.",'<NULL>','n')"); 130 128 $sth->execute; 131 # Don't need this with RaiseError, but leave it for now.132 # croak $sth->errstr if ($sth->errstr());133 129 134 130 # If we get here, everything is happy. Commit changes. … … 361 357 # Fix up types from pools (which are single-char) 362 358 # Fixing the database would be... painful. :( 363 if ($data[2] =~ /^[ cdsm]$/) {359 if ($data[2] =~ /^[sdcmw]$/) { 364 360 $data[2] .= 'i'; 365 361 } … … 819 815 # + Different flavours of netblock 820 816 821 if ($webvar{alloctype} =~ /^[ cdsm]i$/) {817 if ($webvar{alloctype} =~ /^[scdmw]i$/) { 822 818 my ($base,undef) = split //, $webvar{alloctype}; # split into individual chars 823 819 my $sql; … … 999 995 # Allow transactions, and make errors much easier to catch. 1000 996 # Much as I would like to error-track specifically on each ->execute, 1001 # that's a LOT of code. :/ 1002 $ip_dbh->{AutoCommit} = 0; 1003 $ip_dbh->{RaiseError} = 1; 997 # that's a LOT of code, and some SQL blocks MUST be atomic at a 998 # multi-statement level. :/ 999 local $ip_dbh->{AutoCommit} = 0; # These need to be local so we don't 1000 local $ip_dbh->{RaiseError} = 1; # step on our toes by accident. 1004 1001 1005 1002 if ($webvar{fullcidr} eq $webvar{alloc_from}) { … … 1134 1131 syslog "notice", "$full_alloc_types{$webvar{alloctype}} '$webvar{fullcidr}' successfully initialized by $authuser"; 1135 1132 1136 # Turn off transactions and exception-on-error'ing1137 $ip_dbh->{AutoCommit} = 0;1138 $ip_dbh->{RaiseError} = 1;1139 1140 1133 print qq(<div class="center"><div class="heading">The block $webvar{fullcidr} was sucessfully added as type '$webvar{alloctype}' ($full_alloc_types{$webvar{alloctype}})</div></div>); 1141 1134
Note:
See TracChangeset
for help on using the changeset viewer.