Changeset 94


Ignore:
Timestamp:
04/14/11 17:14:23 (14 years ago)
Author:
Kris Deugau
Message:

/trunk

Remove a few stale ##fixme notes
Minor formatting nitpick cleanup
Use "SELECT currval..." when adding a user to get the new user ID
Remove stale stub editRecord() since it's been superceded by updateRec()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/DNSDB.pm

    r91 r94  
    240240# Update an ACL entry
    241241# Takes a db handle, type, owner-id, and hashref for the changed permissions.
    242 ##fixme: Must handle case of changing object's permissions from custom to inherited
    243242sub changePermissions {
    244243  my $dbh = shift;
     
    735734  local $dbh->{RaiseError} = 1;
    736735
    737 my $failmsg;
     736  my $failmsg = '';
     737
    738738  # Wrap all the SQL in a transaction
    739739  eval {
     
    746746
    747747    # get the ID...
    748     $sth = $dbh->prepare("select user_id from users where username=?");
    749     $sth->execute($username);
    750     ($user_id) = $sth->fetchrow_array();
     748    ($user_id) = $dbh->selectrow_array("SELECT currval('users_user_id_seq')");
    751749
    752750# Permissions!  Gotta set'em all!
     
    788786
    789787##fixme: add another table to hold name/email for log table?
    790 #die "dying horribly ($permstring, $user_id)";
    791788
    792789    # once we get here, we should have suceeded.
     
    969966
    970967
    971 ## DNSDB::editRecord()
    972 # Change an existing record
    973 # Takes a database handle, default/live flag, record ID, and new data and updates the data fields for it
    974 sub editRecord {
    975   $errstr = '';
    976   my $dbh = shift;
    977   my $defflag = shift;
    978   my $recid = shift;
    979   my $host = shift;
    980   my $address = shift;
    981   my $distance = shift;
    982   my $weight = shift;
    983   my $port = shift;
    984   my $ttl = shift;
    985 }
    986 
    987 
    988968## DNSDB::getSOA()
    989969# Return all suitable fields from an SOA record in separate elements of a hash
     
    10801060  }
    10811061  $sql .= " AND NOT r.type=$reverse_typemap{SOA} ORDER BY r.$order $direction";
    1082 ##fixme:  need to set nstart properly (offset is not internally multiplied with limit)
    10831062  $sql .= " LIMIT $nrecs OFFSET ".($nstart*$nrecs) if $nstart ne 'all';
    10841063
Note: See TracChangeset for help on using the changeset viewer.