Changeset 166 for trunk/cgi-bin/main.cgi


Ignore:
Timestamp:
02/22/05 12:23:36 (20 years ago)
Author:
Kris Deugau
Message:

/trunk

Merged bugfixes from /branches/stable r162-165.

NB: r163 did not apply completely cleanly due to differences

in custID checks. This is NOT critical as the devel tree
has had BGW crosslink code deliberately left out.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/cgi-bin/main.cgi

    r161 r166  
    799799    if ($base =~ /^[ds]$/) {
    800800      $sql = "select * from poolips where available='y' and".
    801         " ptype='$base' and (city='Sudbury' or city='North Bay')";
     801        " type='$webvar{alloctype}' and (city='Sudbury' or city='North Bay')";
    802802    } else {
    803803      $sql = "select * from poolips where available='y' and".
    804         " ptype='$base' and city='$webvar{pop}'";
     804        " type='$webvar{alloctype}' and city='$webvar{pop}'";
    805805    }
    806806
     
    10401040  # because I'm lazy, we'll try to make the SELECT's bring out identical)ish) data
    10411041  if ($webvar{block} =~ /\/32$/) {
    1042     $sql = "select ip,custid,ptype,city,circuitid,description,notes from poolips where ip='$webvar{block}'";
     1042    $sql = "select ip,custid,type,city,circuitid,description,notes from poolips where ip='$webvar{block}'";
    10431043  } else {
    10441044    $sql = "select cidr,custid,type,city,circuitid,description,notes from allocations where cidr='$webvar{block}'"
     
    11341134  };
    11351135  if ($@) {
    1136     carp "Transaction aborted because $@";
     1136    my $msg = $@;
     1137    carp "Transaction aborted because $msg";
    11371138    eval { $ip_dbh->rollback; };
    1138     syslog "err", "$authuser could not update block/IP '$webvar{block}': '$@'";
    1139     printError("Could not update block/IP $webvar{block}: $@");
     1139    syslog "err", "$authuser could not update block/IP '$webvar{block}': '$msg'";
     1140    printError("Could not update block/IP $webvar{block}: $msg");
    11401141    return;
    11411142  }
     
    12091210
    12101211    # Unassigning a static IP
    1211     my $sth = $ip_dbh->prepare("select ip,custid,city,ptype,notes,circuitid from poolips".
     1212    my $sth = $ip_dbh->prepare("select ip,custid,city,type,notes,circuitid from poolips".
    12121213        " where ip='$webvar{block}'");
    12131214    $sth->execute();
     
    12161217    $sth->bind_columns(\$cidr, \$custid, \$city, \$alloctype, \$notes, \$circid);
    12171218    $sth->fetch() || croak $sth->errstr;
    1218 
    1219     $alloctype .="i";
    12201219
    12211220  } else { # done with alloctype=~ /^.i$/
Note: See TracChangeset for help on using the changeset viewer.