Changeset 488


Ignore:
Timestamp:
03/19/13 17:30:51 (12 years ago)
Author:
Kris Deugau
Message:

/trunk

Object conversion of DNSDB.pm, part 20. See #11.

  • get rid of not-quite-global %userdata hash used for logging; if someone wants to use multiple DNSDB objects chances are they'll want to initialize them with separate users.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/DNSDB.pm

    r487 r488  
    175175# it relies on visibility flags from the rectypes table in the DB
    176176my %validators;
    177 
    178 # Username, full name, ID - mainly for logging
    179 my %userdata;
    180177
    181178# Entity-relationship reference hashes.
     
    378375        undef,
    379376        ($args{domain_id}, $args{rdns_id}, $args{group_id}, $args{entry},
    380                 $userdata{userid}, $userdata{username}, $userdata{fullname}) );
     377                $self->{loguserid}, $self->{logusername}, $self->{logfullname}) );
    381378#  } elsif ($config{log_channel} eq 'file') {
    382379#  } elsif ($config{log_channel} eq 'syslog') {
     
    14881485        " FROM users WHERE username=?", undef, ($args{username}) );
    14891486  }
    1490   %userdata = %{$tmpuser};
    1491   $userdata{lastname} = '' if !$userdata{lastname};
    1492   $userdata{fullname} = "$userdata{firstname} $userdata{lastname} ($args{rpcsys})";
     1487  $tmpuser->{lastname} = '' if !$tmpuser->{lastname};
     1488  $self->{loguserid} = $tmpuser->{userid};
     1489  $self->{logusername} = $tmpuser->{username};
     1490  $self->{logfullname} = "$tmpuser->{firstname} $tmpuser->{lastname} ($args{rpcsys})";
    14931491  return 1 if $tmpuser;
    14941492} # end initRPC()
     
    15491547##fixme: errors are unpossible!
    15501548
    1551   $userdata{username} = $username;
    1552   $userdata{userid} = $uid;
    1553   $userdata{fullname} = $fullname;
     1549  $self->{logusername} = $username;
     1550  $self->{loguserid} = $uid;
     1551  $self->{logfullname} = $fullname;
    15541552
    15551553  # convert to real check once we have other logging channels
Note: See TracChangeset for help on using the changeset viewer.