Changeset 782 for trunk/cgi-bin/IPDB.pm
- Timestamp:
- 10/08/15 17:09:51 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cgi-bin/IPDB.pm
r780 r782 1467 1467 undef, ($args{parent}) ); 1468 1468 } 1469 $dbh->do("UPDATE poolips SET custid = ?, city = ?,available='n', description = ?, notes = ?, ". 1470 "circuitid = ?, privdata = ?, vrf = ?, rdns = ? ". 1469 1470 # backup 1471 my $backupid = 0; 1472 if ($args{backup}) { 1473 my $sql = "INSERT INTO backuplist ("; 1474 my @bkvals; 1475 for my $bk (qw(brand model type port src user vpass epass)) { 1476 if ($args{"bk$bk"}) { 1477 $sql .= "bk$bk,"; 1478 push @bkvals, $args{"bk$bk"}; 1479 } 1480 } 1481 $sql .= "ip) VALUES (".('?,' x scalar(@bkvals))."?)"; 1482 $dbh->do($sql, undef, @bkvals, $args{cidr}); 1483 ($backupid) = $dbh->selectrow_array("SELECT currval('backuplist_backup_id_seq')"); 1484 } 1485 1486 # finally assign the IP 1487 $dbh->do("UPDATE poolips SET custid = ?, city = ?, available='n', description = ?, notes = ?, ". 1488 "circuitid = ?, privdata = ?, vrf = ?, rdns = ?, backup_id = ? ". 1471 1489 "WHERE ip = ? AND parent_id = ?", undef, 1472 1490 ($args{custid}, $args{city}, $args{desc}, $args{notes}, 1473 $args{circid}, $args{privdata}, $args{vrf}, $args{rdns}, 1491 $args{circid}, $args{privdata}, $args{vrf}, $args{rdns}, $backupid, 1474 1492 $args{cidr}, $args{parent}) ); 1475 1493
Note:
See TracChangeset
for help on using the changeset viewer.