Ignore:
Timestamp:
11/12/04 12:37:17 (20 years ago)
Author:
Kris Deugau
Message:

/branches/stable

Backported bugfixes and changes from /trunk r60:63

File:
1 edited

Legend:

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

    r56 r64  
    119119    $sth = $ip_dbh->prepare("insert into masterblocks values ('$webvar{cidr}')");
    120120    $sth->execute;
    121 # Don't need this with RaiseError, but leave it for now.
    122 #    croak $sth->errstr if ($sth->errstr());
    123121
    124122# Unrouted blocks aren't associated with a city (yet).  We don't rely on this
     
    129127        $cidr->masklen.",'<NULL>','n')");
    130128    $sth->execute;
    131 # Don't need this with RaiseError, but leave it for now.
    132 #    croak $sth->errstr if ($sth->errstr());
    133129
    134130    # If we get here, everything is happy.  Commit changes.
     
    361357    # Fix up types from pools (which are single-char)
    362358    # Fixing the database would be...  painful.  :(
    363     if ($data[2] =~ /^[cdsm]$/) {
     359    if ($data[2] =~ /^[sdcmw]$/) {
    364360      $data[2] .= 'i';
    365361    }
     
    819815#  + Different flavours of netblock
    820816
    821   if ($webvar{alloctype} =~ /^[cdsm]i$/) {
     817  if ($webvar{alloctype} =~ /^[scdmw]i$/) {
    822818    my ($base,undef) = split //, $webvar{alloctype};    # split into individual chars
    823819    my $sql;
     
    999995# Allow transactions, and make errors much easier to catch.
    1000996# 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.
    10041001
    10051002    if ($webvar{fullcidr} eq $webvar{alloc_from}) {
     
    11341131    syslog "notice", "$full_alloc_types{$webvar{alloctype}} '$webvar{fullcidr}' successfully initialized by $authuser";
    11351132
    1136     # Turn off transactions and exception-on-error'ing
    1137     $ip_dbh->{AutoCommit} = 0;
    1138     $ip_dbh->{RaiseError} = 1;
    1139 
    11401133    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>);
    11411134
Note: See TracChangeset for help on using the changeset viewer.