[Bps-public-commit] RT-Extension-MergeUsers branch, master, updated. 0.12_02-1-gce06ab8

Alex Vandiver alexmv at bestpractical.com
Mon Feb 10 18:16:45 EST 2014


The branch, master has been updated
       via  ce06ab88a5d43bf5b92180d76be60695198284ec (commit)
      from  d50bb6efcf69cd2ec83cdd45ef3b64c996c70802 (commit)

Summary of changes:
 lib/RT/Extension/MergeUsers.pm | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

- Log -----------------------------------------------------------------
commit ce06ab88a5d43bf5b92180d76be60695198284ec
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Mon Feb 10 17:43:44 2014 -0500

    Keep the Disabled bit synchronized between merged users
    
    Disabling a user did not disable all of the users merged into them.
    This caused users disabled users to apparently still appear via the web
    UI in user searches, as their merged-in (non-disabled) users often still
    matched the search.
    
    Explicitly propagate Disabled updates on users down into their merged-in
    equivalents.  Note that changes to sub-users do not propagate upward;
    loading them takes explicit effort, changing them could be more
    surpising action-at-a-distance, and introduces difficulties with dealing
    with cycles.

diff --git a/lib/RT/Extension/MergeUsers.pm b/lib/RT/Extension/MergeUsers.pm
index 3d9817a..5628c94 100644
--- a/lib/RT/Extension/MergeUsers.pm
+++ b/lib/RT/Extension/MergeUsers.pm
@@ -341,6 +341,28 @@ sub GotoFirstItem {
     $self->GotoItem(0);
 }
 
+
+package RT::Principal;
+
+sub SetDisabled {
+    my $self = shift;
+    my $value = shift;
+
+    my ($ret, $msg) = $self->_Set( Field => "Disabled", Value => $value );
+    return ($ret, $msg) unless $ret;
+
+    return ($ret, $msg) unless $self->IsUser;
+
+    for my $id (@{$self->Object->GetMergedUsers->Content}) {
+        my $user = RT::User->new( $self->CurrentUser );
+        $user->LoadOriginal( id => $id );
+        $user->PrincipalObj->_Set( Field => "Disabled", Value => $value );
+    }
+
+    return ($ret, $msg);
+}
+
+
 =head1 AUTHOR
 
 Alex Vandiver E<lt>alexmv at bestpractical.comE<gt>

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list