Changeset 404 for trunk


Ignore:
Timestamp:
10/04/12 16:25:57 (12 years ago)
Author:
Kris Deugau
Message:

/trunk

Fix up initRPC() so it actually works the way it's supposed to. See #33.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/DNSDB.pm

    r402 r404  
    14191419  return if !$args{fullname};
    14201420
    1421   %userdata = %{$dbh->selectrow_hashref("SELECT user_id,group_id,firstname,lastname,status FROM users".
    1422         " WHERE username=?", undef, ($args{username}) )};
     1421  my $tmpuser = $dbh->selectrow_hashref("SELECT user_id AS userid,group_id,firstname,lastname,status".
     1422        " FROM users WHERE username=?", undef, ($args{username}) );
    14231423  if (!%userdata) {
    14241424    $dbh->do("INSERT INTO users (username,password,firstname,type) VALUES (?,'RPC',?,'R')", undef,
    14251425        ($args{username}, $args{fullname}) );
    1426     %userdata = %{$dbh->selectrow_hashref("SELECT user_id,group_id,firstname,lastname,status FROM users".
    1427         " WHERE username=?", undef, ($args{username}) )};
    1428   }
    1429   $userdata{fullname} = "$userdata{firstname} $userdata{lastname}/$args{rpcsys}";
     1426    $tmpuser = $dbh->selectrow_hashref("SELECT user_id AS userid,group_id,firstname,lastname,status".
     1427        " FROM users WHERE username=?", undef, ($args{username}) );
     1428  }
     1429  %userdata = %{$tmpuser};
     1430  $userdata{fullname} = "$userdata{firstname} $userdata{lastname} ($args{rpcsys})";
     1431  $userdata{username} = "$args{username}/$args{rpcsys}";
    14301432  return 1 if %userdata;
    14311433} # end initRPC()
Note: See TracChangeset for help on using the changeset viewer.