Changeset 207
- Timestamp:
- 12/19/11 17:20:54 (13 years ago)
- Location:
- trunk
- Files:
-
- 6 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") -
trunk/templates/bulkdomain.tmpl
r166 r207 21 21 <td>Action:</td> 22 22 <td align="left"> 23 <TMPL_IF maymove> <input type="radio" name=" action" value="move" checked="checked" /> Move to group: <select name="destgroup">23 <TMPL_IF maymove> <input type="radio" name="bulkaction" value="move" checked="checked" /> Move to group: <select name="destgroup"> 24 24 <TMPL_LOOP name=grouplist> <option value="<TMPL_VAR NAME=groupval>"<TMPL_IF groupactive> selected="selected"</TMPL_IF>><TMPL_VAR name=groupname></option> 25 25 </TMPL_LOOP> 26 26 </select><br /></TMPL_IF> 27 <TMPL_IF maystatus> <input type="radio" name=" action" value="deactivate" /> Deactivate<br />28 <input type="radio" name=" action" value="activate" /> Activate<br /></TMPL_IF>29 <TMPL_IF maydelete> <input type="radio" name=" action" value="delete" /> Delete<br /></TMPL_IF>27 <TMPL_IF maystatus> <input type="radio" name="bulkaction" value="deactivate" /> Deactivate<br /> 28 <input type="radio" name="bulkaction" value="activate" /> Activate<br /></TMPL_IF> 29 <TMPL_IF maydelete> <input type="radio" name="bulkaction" value="delete" /> Delete<br /></TMPL_IF> 30 30 </td> 31 31 </tr> -
trunk/templates/edgroup.tmpl
r100 r207 9 9 <input type="hidden" name="sid" value="<TMPL_VAR NAME=sid>" /> 10 10 <input type="hidden" name="page" value="edgroup" /> 11 <input type="hidden" name=" action" value="updperms" />11 <input type="hidden" name="grpaction" value="updperms" /> 12 12 <input type="hidden" name="gid" value="<TMPL_VAR NAME=gid>" /> 13 13 -
trunk/templates/newgrp.tmpl
r133 r207 10 10 <input type="hidden" name="sid" value="<TMPL_VAR NAME=sid>" /> 11 11 <input type="hidden" name="page" value="newgrp" /> 12 <input type="hidden" name=" action" value="add" />12 <input type="hidden" name="grpaction" value="add" /> 13 13 14 14 <table class="container" width="450"> -
trunk/templates/user.tmpl
r143 r207 10 10 <input type="hidden" name="sid" value="<TMPL_VAR NAME=sid>" /> 11 11 <input type="hidden" name="page" value="user" /> 12 <input type="hidden" name=" action" value="<TMPL_VAR NAME=action>" />12 <input type="hidden" name="useraction" value="<TMPL_VAR NAME=action>" /> 13 13 <TMPL_IF uid><input type="hidden" name="uid" value="<TMPL_VAR NAME=uid>" /></TMPL_IF> 14 14 <TMPL_IF gid><input type="hidden" name="gid" value="<TMPL_VAR NAME=gid>" /></TMPL_IF> -
trunk/templates/useradmin.tmpl
r144 r207 37 37 <TMPL_LOOP name=usertable> 38 38 <tr class="row<TMPL_VAR name=bg>"> 39 <td align="left"><TMPL_IF eduser><a href="dns.cgi?sid=<TMPL_VAR NAME=sid>&page=user& action=edit&user=<TMPL_VAR NAME=userid>"><TMPL_VAR NAME=username></a><TMPL_ELSE><TMPL_VAR NAME=username></TMPL_IF></td>39 <td align="left"><TMPL_IF eduser><a href="dns.cgi?sid=<TMPL_VAR NAME=sid>&page=user&useraction=edit&user=<TMPL_VAR NAME=userid>"><TMPL_VAR NAME=username></a><TMPL_ELSE><TMPL_VAR NAME=username></TMPL_IF></td> 40 40 <td class="data_nowrap"><TMPL_VAR name=userfull></td> 41 41 <td><TMPL_VAR name=usertype></td>
Note:
See TracChangeset
for help on using the changeset viewer.