Changeset 67 for trunk/DNSDB.pm
- Timestamp:
- 11/30/10 18:01:27 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DNSDB.pm
r66 r67 25 25 @ISA = qw(Exporter); 26 26 @EXPORT_OK = qw( 27 &initGlobals &initPermissions &getPermissions &changePermissions 27 &initGlobals 28 &initPermissions &getPermissions &changePermissions &comparePermissions 28 29 &connectDB &finish 29 30 &addDomain &delDomain &domainName … … 39 40 @EXPORT = (); # Export nothing by default. 40 41 %EXPORT_TAGS = ( ALL => [qw( 41 &initGlobals &initPermissions &getPermissions &changePermissions 42 &initGlobals 43 &initPermissions &getPermissions &changePermissions &comparePermissions 42 44 &connectDB &finish 43 45 &addDomain &delDomain &domainName … … 294 296 295 297 298 ## DNSDB::comparePermissions() 299 # Compare two permission hashes 300 # Returns '>', '<', '=', '!' 301 sub comparePermissions { 302 my $p1 = shift; 303 my $p2 = shift; 304 305 my $retval = '='; # assume equality until proven otherwise 306 307 no warnings "uninitialized"; 308 309 foreach (@permtypes) { 310 next if $p1->{$_} == $p2->{$_}; # equal is good 311 if ($p1->{$_} && !$p2->{$_}) { 312 if ($retval eq '<') { # if we've already found an unequal pair where 313 $retval = '!'; # $p2 has more access, and we now find a pair 314 last; # where $p1 has more access, the overall access 315 } # is neither greater or lesser, it's unequal. 316 $retval = '>'; 317 } 318 if (!$p1->{$_} && $p2->{$_}) { 319 if ($retval eq '>') { # if we've already found an unequal pair where 320 $retval = '!'; # $p1 has more access, and we now find a pair 321 last; # where $p2 has more access, the overall access 322 } # is neither greater or lesser, it's unequal. 323 $retval = '<'; 324 } 325 } 326 return $retval; 327 } # end comparePermissions() 328 329 296 330 ## DNSDB::_log() 297 331 # Log an action … … 640 674 my $type = shift || 'u'; # create limited users by default - fwiw, not sure yet how this will interact with ACLs 641 675 676 my $permstring = shift || 'i'; # default is to inhert permissions from group 677 642 678 my $fname = shift || $username; 643 679 my $lname = shift || '';
Note:
See TracChangeset
for help on using the changeset viewer.