Make console add_access command add someone to groups, not replace
their groups.
Patch by afuna.
diffs (23 lines):
diff -r f3b13011c03c -r f814352fdaab cgi-bin/DW/Console/Command/ManageCircle.pm
--- a/cgi-bin/DW/Console/Command/ManageCircle.pm Fri Jun 12 21:04:00
2009 +0000
+++ b/cgi-bin/DW/Console/Command/ManageCircle.pm Fri Jun 12 21:11:11
2009 +0000
@@ -29,7 +29,7 @@ sub args_desc {
[
'command' => 'Subcommand: add_read, del_read, add_access, del_access.',
'username' => 'Username to act on.',
- 'groups' => 'If using add_access, a comma separated list of trust
group ids.',
+ 'groups' => 'If using add_access, a comma separated list of trust
group ids. Will add to the list of groups this user is already in.',
]
}
sub usage { '<subcommand> <username> [groups]' }
@@ -70,6 +70,10 @@ sub execute {
} elsif ( $cmd eq 'add_access' ) {
my $mask = 0;
$mask += ( 1 << $_ ) foreach @groups;
+
+ my $existing_mask = $remote->trustmask( $to_u );
+ $mask |= $existing_mask;
+
$remote->add_edge( $to_u, trust => {
mask => $mask,
nonotify => $remote->trusts( $to_u ) ? 1 : 0,
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog