Changeset 469


Ignore:
Timestamp:
03/12/13 16:12:46 (12 years ago)
Author:
Kris Deugau
Message:

/trunk

Object conversion of DNSDB.pm, 5 of <mumble>. See #11.

  • convert a couple more initialization/setup subs
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/DNSDB.pm

    r467 r469  
    14661466
    14671467## DNSDB::initRPC()
    1468 # Takes a database handle, remote username, and remote fullname.
     1468# Takes a remote username and remote fullname.
    14691469# Sets up the RPC logging-pseudouser if needed.
    14701470# Sets the %userdata hash for logging.
    14711471# Returns undef on failure
    14721472sub initRPC {
    1473   my $dbh = shift;
     1473  my $self = shift;
     1474  my $dbh = $self->{dbh};
    14741475  my %args  = @_;
    14751476
     
    15001501# Returns undef otherwise
    15011502sub login {
    1502   my $dbh = shift;
     1503  my $self = shift;
     1504  my $dbh = $self->{dbh};
    15031505  my $user = shift;
    15041506  my $pass = shift;
     
    15341536# See https://secure.deepnet.cx/trac/dnsadmin/ticket/21
    15351537sub initActionLog {
    1536   my $dbh = shift;
     1538  my $self = shift;
     1539  my $dbh = $self->{dbh};
    15371540  my $uid = shift;
    15381541
     
    15621565# Takes database handle and UID
    15631566sub initPermissions {
    1564   my $dbh = shift;
     1567  my $self = shift;
     1568  my $dbh = $self->{dbh};
    15651569  my $uid = shift;
    15661570
    1567 #  %permissions = $(getPermissions($dbh,'user',$uid));
    1568   getPermissions($dbh, 'user', $uid, \%permissions);
     1571#  %permissions = $(getPermissions('user',$uid));
     1572  $self->getPermissions('user', $uid, \%permissions);
    15691573
    15701574} # end initPermissions()
     
    15751579# Requires DB handle, group or user flag, ID, and hashref.
    15761580sub getPermissions {
    1577   my $dbh = shift;
     1581  my $self = shift;
     1582  my $dbh = $self->{dbh};
     1583
    15781584  my $type = shift;
    15791585  my $id = shift;
  • trunk/dns.cgi

    r468 r469  
    312312    my $flag = 0;
    313313    foreach (@viewablegroups) {
    314       $flag = 1 if isParent($dbh, $_, 'group', $webvar{id}, 'domain');
     314      $flag = 1 if $dnsdb->isParent(, $_, 'group', $webvar{id}, 'domain');
    315315    }
    316316    if ($flag && ($permissions{admin} || $permissions{domain_edit})) {
     
    416416    my $flag = 0;
    417417    foreach (@viewablegroups) {
    418       $flag = 1 if isParent($dbh, $_, 'group', $webvar{id}, 'revzone');
     418      $flag = 1 if $dnsdb->isParent(, $_, 'group', $webvar{id}, 'revzone');
    419419    }
    420420    if ($flag && ($permissions{admin} || $permissions{domain_edit})) {
     
    10921092    my $flag = 0;
    10931093    foreach (@viewablegroups) {
    1094       $flag = 1 if isParent($dbh, $_, 'group', $webvar{id}, 'user');
     1094      $flag = 1 if $dnsdb->isParent(, $_, 'group', $webvar{id}, 'user');
    10951095    }
    10961096    if ($flag && ($permissions{admin} || $permissions{user_edit} ||
     
    17751775    $row{whereami} = $uri_self;
    17761776    $row{curgrp} = ($_ == $cur);
    1777     $row{expanded} = isParent($dbh, $_, 'group', $cur, 'group');
     1777    $row{expanded} = $dnsdb->isParent(, $_, 'group', $cur, 'group');
    17781778    $row{expanded} = 1 if $_ == $cur;
    17791779    $row{subs} = fill_grptree($_,$cur,$indent.'    ');
     
    23372337  } else {
    23382338    foreach (@viewablegroups) {
    2339       return 1 if isParent($dbh, $_, 'group', $entity, $entype);
     2339      return 1 if $dnsdb->isParent(, $_, 'group', $entity, $entype);
    23402340    }
    23412341  }
Note: See TracChangeset for help on using the changeset viewer.