Changeset 489


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

/trunk

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

  • remove %permissions global from module; all the access controls are checked on the caller's side. Declare it in dns.cgi instead (the only place it's checked).
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/DNSDB.pm

    r488 r489  
    3838@EXPORT_OK      = qw(
    3939        &initGlobals &login &initActionLog
    40         &initPermissions &getPermissions &changePermissions &comparePermissions
     40        &getPermissions &changePermissions &comparePermissions
    4141        &changeGroup
    4242        &loadConfig &connectDB &finish
     
    6060        &mailNotify
    6161        %typemap %reverse_typemap %config
    62         %permissions @permtypes $permlist %permchains
     62        @permtypes $permlist %permchains
    6363        );
    6464
    65 @EXPORT         = qw(%typemap %reverse_typemap %permissions @permtypes $permlist %permchains);
     65@EXPORT         = qw(%typemap %reverse_typemap @permtypes $permlist %permchains);
    6666%EXPORT_TAGS    = ( ALL => [qw(
    6767                &initGlobals &login &initActionLog
    68                 &initPermissions &getPermissions &changePermissions &comparePermissions
     68                &getPermissions &changePermissions &comparePermissions
    6969                &changeGroup
    7070                &loadConfig &connectDB &finish
     
    8888                &mailNotify
    8989                %typemap %reverse_typemap %config
    90                 %permissions @permtypes $permlist %permchains
     90                @permtypes $permlist %permchains
    9191                )]
    9292        );
     
    135135our %typemap;
    136136our %reverse_typemap;
    137 
    138 our %permissions;
    139137
    140138# Prepopulate a basic config.  Note some of these *will* cause errors if left unset.
     
    15571555
    15581556} # end initActionLog
    1559 
    1560 
    1561 ## DNSDB::initPermissions()
    1562 # Set up permissions global
    1563 # Takes database handle and UID
    1564 sub initPermissions {
    1565   my $self = shift;
    1566   my $dbh = $self->{dbh};
    1567   my $uid = shift;
    1568 
    1569 #  %permissions = $(getPermissions('user',$uid));
    1570   $self->getPermissions('user', $uid, \%permissions);
    1571 
    1572 } # end initPermissions()
    15731557
    15741558
  • trunk/dns.cgi

    r486 r489  
    291291
    292292# Misc Things To Do on most pages
    293 $dnsdb->initPermissions($session->param('uid'));
     293my %permissions;
     294$dnsdb->getPermissions('user', $session->param('uid'), \%permissions);
    294295$dnsdb->initActionLog($session->param('uid'));
    295296
Note: See TracChangeset for help on using the changeset viewer.