From a8c071f856206db5dd36789933841a70165d2d4f Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Wed, 5 Jan 2011 13:57:49 -0800 Subject: [PATCH] Read and write group ACL when editing a group https://sourceforge.net/tracker/?func=detail&atid=117457&aid=3151868&group_id=17457 --- cluster-webmin/edit_acl.cgi | 9 ++++++++- cluster-webmin/save_acl.cgi | 6 ++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/cluster-webmin/edit_acl.cgi b/cluster-webmin/edit_acl.cgi index ce66bd326..95b4af826 100755 --- a/cluster-webmin/edit_acl.cgi +++ b/cluster-webmin/edit_acl.cgi @@ -69,7 +69,14 @@ $desc = &text($user ? 'acl_title2'.$ga : 'acl_title3'.$ga, # Get the host's ACL options &remote_foreign_require($serv->{'host'}, "acl", "acl-lib.pl"); -$aref = &remote_eval($serv->{'host'}, "acl", "\%rv = &get_module_acl('$who', '$mod->{'dir'}'); \\%rv"); +if ($user) { + $aref = &remote_eval($serv->{'host'}, "acl", + "\%rv = &get_module_acl('$who', '$mod->{'dir'}'); \\%rv"); + } +else { + $aref = &remote_eval($serv->{'host'}, "acl", + "\%rv = &get_group_module_acl('$who', '$mod->{'dir'}'); \\%rv"); + } %access = %$aref; # Display the editor form from this host diff --git a/cluster-webmin/save_acl.cgi b/cluster-webmin/save_acl.cgi index 4097e0534..c9011d3e7 100755 --- a/cluster-webmin/save_acl.cgi +++ b/cluster-webmin/save_acl.cgi @@ -70,9 +70,11 @@ foreach $h (@hosts) { } # Save the .acl file - local $cd = &remote_eval($s->{'host'}, "acl", '$config_directory'); + local $cd = &remote_eval($s->{'host'}, "acl", + '$config_directory'); + $sfx = $in{'_acl_user'} ? "acl" : "gacl"; &remote_foreign_call($s->{'host'}, "acl", "write_file", - "$cd/$in{'_acl_mod'}/$who.acl", \%maccess); + "$cd/$in{'_acl_mod'}/$who.$sfx", \%maccess); # Recursively update the ACL for all member users and groups if ($in{'_acl_group'}) {