Changeset 207 for trunk/dns.cgi
- Timestamp:
- 12/19/11 17:20:54 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dns.cgi
r205 r207 807 807 unless ($permissions{admin} || $permissions{group_create}); 808 808 809 # do.. uhh.. stuff.. if we have no webvar{ action}810 if ($webvar{ action} && $webvar{action} eq 'add') {809 # do.. uhh.. stuff.. if we have no webvar{grpaction} 810 if ($webvar{grpaction} && $webvar{grpaction} eq 'add') { 811 811 812 812 # security check - does the user have permission to access this entity? … … 901 901 } 902 902 903 if ($webvar{ action} eq 'updperms') {903 if ($webvar{grpaction} eq 'updperms') { 904 904 # extra safety check; make sure user can't construct a URL to bypass ACLs 905 905 my %curperms; … … 994 994 } 995 995 996 if ($webvar{ action} eq 'move') {996 if ($webvar{bulkaction} eq 'move') { 997 997 changepage(page => "domlist", errmsg => "You are not permitted to bulk-move domains") 998 998 unless ($permissions{admin} || ($permissions{domain_edit} && $permissions{domain_create} && $permissions{domain_delete})); … … 1029 1029 $page->param(bulkresults => \@bulkresults); 1030 1030 1031 } elsif ($webvar{ action} eq 'deactivate' || $webvar{action} eq 'activate') {1032 changepage(page => "domlist", errmsg => "You are not permitted to bulk-$webvar{ action} domains")1031 } elsif ($webvar{bulkaction} eq 'deactivate' || $webvar{bulkaction} eq 'activate') { 1032 changepage(page => "domlist", errmsg => "You are not permitted to bulk-$webvar{bulkaction} domains") 1033 1033 unless ($permissions{admin} || $permissions{domain_edit}); 1034 $page->param(action => "$webvar{ action} domains");1034 $page->param(action => "$webvar{bulkaction} domains"); 1035 1035 my @bulkresults; 1036 1036 foreach (keys %webvar) { … … 1046 1046 $row{domain} = domainName($dbh,$webvar{$_}); 1047 1047 ##fixme: error handling on status change 1048 my $stat = domStatus($dbh,$webvar{$_},($webvar{ action} eq 'activate' ? 'domon' : 'domoff'));1048 my $stat = domStatus($dbh,$webvar{$_},($webvar{bulkaction} eq 'activate' ? 'domon' : 'domoff')); 1049 1049 logaction($webvar{$_}, $session->param("username"), parentID($webvar{$_}, 'dom', 'group'), 1050 1050 "Changed domain ".domainName($dbh, $webvar{$_})." state to ".($stat ? 'active' : 'inactive')); … … 1056 1056 $page->param(bulkresults => \@bulkresults); 1057 1057 1058 } elsif ($webvar{ action} eq 'delete') {1058 } elsif ($webvar{bulkaction} eq 'delete') { 1059 1059 changepage(page => "domlist", errmsg => "You are not permitted to bulk-delete domains") 1060 1060 unless ($permissions{admin} || $permissions{domain_delete}); 1061 $page->param(action => "$webvar{ action} domains");1061 $page->param(action => "$webvar{bulkaction} domains"); 1062 1062 my @bulkresults; 1063 1063 foreach (keys %webvar) { … … 1155 1155 $page->param(is_admin => $permissions{admin}); 1156 1156 1157 $webvar{ action} = '' if !$webvar{action};1158 1159 if ($webvar{ action} eq 'add' or $webvar{action} eq 'update') {1160 1161 $page->param(add => 1) if $webvar{ action} eq 'add';1157 $webvar{useraction} = '' if !$webvar{useraction}; 1158 1159 if ($webvar{useraction} eq 'add' or $webvar{useraction} eq 'update') { 1160 1161 $page->param(add => 1) if $webvar{useraction} eq 'add'; 1162 1162 1163 1163 my ($code,$msg); … … 1208 1208 $permstring = 'i'; 1209 1209 } 1210 if ($webvar{ action} eq 'add') {1210 if ($webvar{useraction} eq 'add') { 1211 1211 changepage(page => "useradmin", errmsg => "You do not have permission to add new users") 1212 1212 unless $permissions{admin} || $permissions{user_create}; … … 1244 1244 changepage(page => "useradmin", warnmsg => 1245 1245 "You can only grant permissions you hold. $webvar{uname} ". 1246 ($webvar{ action} eq 'add' ? 'added' : 'updated')." with reduced access.");1246 ($webvar{useraction} eq 'add' ? 'added' : 'updated')." with reduced access."); 1247 1247 } else { 1248 1248 changepage(page => "useradmin", resultmsg => "Successfully ". 1249 ($webvar{ action} eq 'add' ? 'added' : 'updated')." user $webvar{uname}");1249 ($webvar{useraction} eq 'add' ? 'added' : 'updated')." user $webvar{uname}"); 1250 1250 } 1251 1251 … … 1253 1253 } else { 1254 1254 $page->param(add_failed => 1); 1255 $page->param(action => $webvar{ action});1255 $page->param(action => $webvar{useraction}); 1256 1256 $page->param(set_permgroup => 1); 1257 1257 if ($webvar{perms_type} eq 'inherit') { # set permission class radio … … 1271 1271 fill_actypelist($webvar{accttype}); 1272 1272 fill_clonemelist(); 1273 logaction(0, $session->param("username"), $curgroup, "Failed to $webvar{ action} user ".1273 logaction(0, $session->param("username"), $curgroup, "Failed to $webvar{useraction} user ". 1274 1274 "$webvar{uname}: $msg") 1275 1275 if $config{log_failures}; 1276 1276 } 1277 1277 1278 } elsif ($webvar{ action} eq 'edit') {1278 } elsif ($webvar{useraction} eq 'edit') { 1279 1279 1280 1280 changepage(page => "useradmin", errmsg => "You do not have permission to edit users")
Note:
See TracChangeset
for help on using the changeset viewer.