Changeset 474


Ignore:
Timestamp:
03/12/13 18:04:34 (12 years ago)
Author:
Kris Deugau
Message:

/trunk

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

  • update entry to getPermissions() and changePermissions(), update callers
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/DNSDB.pm

    r473 r474  
    16311631# Takes a db handle, type, owner-id, and hashref for the changed permissions.
    16321632sub changePermissions {
    1633   my $dbh = shift;
     1633  my $self = shift;
     1634  my $dbh = $self->{dbh};
    16341635  my $type = shift;
    16351636  my $id = shift;
  • trunk/dns.cgi

    r473 r474  
    893893    # fill default permissions with immediate parent's current ones
    894894    my %parperms;
    895     getPermissions($dbh, 'group', $curgroup, \%parperms);
     895    $dnsdb->getPermissions('group', $curgroup, \%parperms);
    896896    fill_permissions($page, \%parperms);
    897897  }
     
    944944    # extra safety check;  make sure user can't construct a URL to bypass ACLs
    945945    my %curperms;
    946     getPermissions($dbh, 'group', $webvar{gid}, \%curperms);
     946    $dnsdb->getPermissions('group', $webvar{gid}, \%curperms);
    947947    my %chperms;
    948948    my $alterperms = 0;
     
    963963      }
    964964    }
    965     my ($code,$msg) = changePermissions($dbh, 'group', $webvar{gid}, \%chperms);
     965    my ($code,$msg) = $dnsdb->changePermissions('group', $webvar{gid}, \%chperms);
    966966    if ($code eq 'OK') {
    967967      if ($alterperms) {
     
    980980  $page->param(grpmeddle => $dnsdb->groupName($webvar{gid}));
    981981  my %grpperms;
    982   getPermissions($dbh, 'group', $webvar{gid}, \%grpperms);
     982  $dnsdb->getPermissions('group', $webvar{gid}, \%grpperms);
    983983  fill_permissions($page, \%grpperms);
    984984
     
    11241124  fill_clonemelist();
    11251125  my %grpperms;
    1126   getPermissions($dbh, 'group', $curgroup, \%grpperms);
     1126  $dnsdb->getPermissions('group', $curgroup, \%grpperms);
    11271127
    11281128  my $grppermlist = new HTML::Template(filename => "$templatedir/permlist.tmpl");
     
    11461146
    11471147    my %newperms;       # we're going to prefill the existing permissions, so we can change them.
    1148     getPermissions($dbh, 'user', $webvar{uid}, \%newperms);
     1148    $dnsdb->getPermissions('user', $webvar{uid}, \%newperms);
    11491149
    11501150    if ($webvar{pass1} ne $webvar{pass2}) {
     
    11611161      if (!$permissions{admin}) {
    11621162        my %grpperms;
    1163         getPermissions($dbh, 'group', $curgroup, \%grpperms);
     1163        $dnsdb->getPermissions('group', $curgroup, \%grpperms);
    11641164        my $ret = comparePermissions(\%permissions, \%grpperms);
    11651165        if ($ret eq '<' || $ret eq '!') {
     
    11831183      } elsif ($permissions{admin} && $webvar{perms_type} eq 'clone') {
    11841184        $permstring = "c:$webvar{clonesrc}";
    1185         getPermissions($dbh, 'user', $webvar{clonesrc}, \%newperms);
     1185        $dnsdb->getPermissions('user', $webvar{clonesrc}, \%newperms);
    11861186        $page->param(perm_clone => 1);
    11871187      } else {
     
    12191219        if ($code eq 'OK') {
    12201220          $newperms{admin} = 1 if $webvar{accttype} eq 'S';
    1221           ($code2,$msg2) = changePermissions($dbh, 'user', $webvar{uid}, \%newperms, ($permstring eq 'i'));
     1221          ($code2,$msg2) = $dnsdb->changePermissions('user', $webvar{uid}, \%newperms, ($permstring eq 'i'));
    12221222        }
    12231223      }
     
    12811281
    12821282    my %curperms;
    1283     getPermissions($dbh, 'user', $webvar{user}, \%curperms);
     1283    $dnsdb->getPermissions('user', $webvar{user}, \%curperms);
    12841284    fill_permissions($page, \%curperms);
    12851285
Note: See TracChangeset for help on using the changeset viewer.