Changeset 87 for trunk/dns.cgi
- Timestamp:
- 03/31/11 18:01:43 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dns.cgi
r83 r87 7 7 # Last update by $Author$ 8 8 ### 9 # Copyright (C) 2008 ,2009- Kris Deugau <kdeugau@deepnet.cx>9 # Copyright (C) 2008-2011 - Kris Deugau <kdeugau@deepnet.cx> 10 10 11 11 use strict; … … 261 261 $sortorder = $session->param($webvar{page}.'order'); 262 262 263 ##work264 263 # set up the headers 265 264 my @cols = ('host', 'type', 'val', 'distance', 'weight', 'port', 'ttl'); … … 275 274 $page->param(defrec => $webvar{defrec}); 276 275 if ($webvar{defrec} eq 'y') { 277 ##fixme: hardcoded group278 276 showdomain('y',$curgroup); 279 277 } else { … … 291 289 if ($webvar{recact} eq 'new') { 292 290 293 $page->param(todo => "Add record to");291 $page->param(todo => "Add record"); 294 292 $page->param(recact => "add"); 295 293 $page->param(parentid => $webvar{parentid}); … … 324 322 $page->param(errmsg => $msg); 325 323 $page->param(wastrying => "adding"); 326 $page->param(todo => "Add record to");324 $page->param(todo => "Add record"); 327 325 $page->param(recact => "add"); 328 326 $page->param(parentid => $webvar{parentid}); … … 613 611 614 612 my $alterperms = 0; # flag iff we need to force custom permissions due to user's current access limits 615 my %newperms; 613 614 my %newperms; # we're going to prefill the existing permissions, so we can change them. 615 getPermissions($dbh, 'user', $webvar{uid}, \%newperms); 616 616 617 617 if ($webvar{pass1} ne $webvar{pass2}) { … … 642 642 $permstring = 'C:'; 643 643 foreach (@permtypes) { 644 $newperms{$_} = 0; 645 $newperms{$_} = 1 if $webvar{$_} eq 'on'; 646 if ($permissions{admin}) { 644 if ($permissions{admin} || $permissions{$_}) { 647 645 $permstring .= ",$_" if defined($webvar{$_}) && $webvar{$_} eq 'on'; 648 } else { 649 $permstring .= ",$_" if $permissions{$_} && defined($webvar{$_}) && $webvar{$_} eq 'on'; 646 $newperms{$_} = (defined($webvar{$_}) && $webvar{$_} eq 'on' ? 1 : 0); 650 647 } 651 648 } … … 653 650 } elsif ($permissions{admin} && $webvar{perms_type} eq 'clone') { 654 651 $permstring = "c:$webvar{clonesrc}"; 652 getPermissions($dbh, 'user', $webvar{clonesrc}, \%newperms); 655 653 $page->param(perm_clone => 1); 656 654 } else { … … 671 669 ##fixme - need to actually get a correct permission set to pass in here, 672 670 # also a flag to revert custom permissions to inherited 673 ##work 674 ($code,$msg) = changePermissions($dbh, 'user', $webvar{uid}, \%newperms); 671 ($code,$msg) = changePermissions($dbh, 'user', $webvar{uid}, \%newperms, ($permstring eq 'i')); 675 672 } 676 673 } … … 694 691 $page->param(action => $webvar{action}); 695 692 $page->param(set_permgroup => 1); 693 if ($webvar{perms_type} eq 'inherit') { # set permission class radio 694 $page->param(perm_inherit => 1); 695 } elsif ($webvar{perms_type} eq 'clone') { 696 $page->param(perm_clone => 1); 697 } else { 698 $page->param(perm_custom => 1); 699 } 696 700 $page->param(uname => $webvar{uname}); 697 701 $page->param(fname => $webvar{fname}); … … 724 728 $page->param(fname => $userinfo->{firstname}); 725 729 $page->param(lname => $userinfo->{lastname}); 730 $page->param(set_permgroup => 1); 726 731 if ($userinfo->{inherit_perm}) { 727 732 $page->param(perm_inherit => 1); … … 729 734 $page->param(perm_custom => 1); 730 735 } 731 736 ##work 732 737 # } elsif ($webvar{action} eq 'update') { 733 738 } else { … … 1043 1048 } 1044 1049 1050 print "<pre>\n"; 1045 1051 foreach (@debugbits) { print; } 1052 print "</pre>\n"; 1046 1053 1047 1054 # spit it out … … 1239 1246 $sth->execute; 1240 1247 1248 # shut up some warnings, but don't stomp on caller's state 1249 local $webvar{clonesrc} = 0 if !defined($webvar{clonesrc}); 1250 1241 1251 my @clonesrc; 1242 1252 while (my ($username,$uid) = $sth->fetchrow_array) { … … 1276 1286 $page->param(lastoffs => int (($count-1)/$perpage)); 1277 1287 } 1288 } else { 1289 $page->param(onepage => 1); 1278 1290 } 1279 1291 } … … 1374 1386 } # end listdomains() 1375 1387 1388 1376 1389 sub listgroups { 1377 1390
Note:
See TracChangeset
for help on using the changeset viewer.