[Bps-public-commit] RT-Extension-MergeUsers branch, master, updated. 0.10-6-g6c5be82

Alex Vandiver alexmv at bestpractical.com
Mon Jan 27 16:41:29 EST 2014


The branch, master has been updated
       via  6c5be82269acefff0578a4ef502410e9ee786497 (commit)
       via  03573403aa1ed498a7865890c259e88137771bb6 (commit)
      from  a4f7cb9778adb6632caacf08bcc4f6ae4f7b8376 (commit)

Summary of changes:
 MANIFEST                       |  1 +
 META.yml                       |  2 +-
 lib/RT/Extension/MergeUsers.pm | 14 +++++++-------
 3 files changed, 9 insertions(+), 8 deletions(-)

- Log -----------------------------------------------------------------
commit 03573403aa1ed498a7865890c259e88137771bb6
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Wed Jan 8 20:33:18 2014 -0500

    Avoid forcing the user to the current user
    
    This allows the Creator of the EffectiveId to serve as a signal as to who merged the users

diff --git a/lib/RT/Extension/MergeUsers.pm b/lib/RT/Extension/MergeUsers.pm
index 9d5b461..9d16a48 100644
--- a/lib/RT/Extension/MergeUsers.pm
+++ b/lib/RT/Extension/MergeUsers.pm
@@ -124,7 +124,7 @@ sub CanonicalizeEmailAddress {
     }
 
     # get the user whose email address this is
-    my $canonical_user = RT::User->new($RT::SystemUser);
+    my $canonical_user = RT::User->new( $self->CurrentUser );
     $canonical_user->LoadByCols( EmailAddress => $address );
     return $address unless $canonical_user->id;
     return $address unless $canonical_user->EmailAddress ne $address;
@@ -187,12 +187,12 @@ sub MergeInto {
     if (ref $user) {
         return (0, "User is not loaded") unless $user->id;
 
-        $merge = RT::User->new($RT::SystemUser);
+        $merge = RT::User->new( $self->CurrentUser );
         $merge->Load($user->id);
         return (0, "Could not reload user #". $user->id)
             unless $merge->id;
     } else {
-        $merge = RT::User->new($RT::SystemUser);
+        $merge = RT::User->new( $self->CurrentUser );
         $merge->Load($user);
         return (0, "Could not load user '$user'") unless $merge->id;
     }
@@ -201,7 +201,7 @@ sub MergeInto {
     # Get copies of the canonicalized users
     my $email;
 
-    my $canonical_self = RT::User->new($RT::SystemUser);
+    my $canonical_self = RT::User->new( $self->CurrentUser );
     $canonical_self->Load($self->id);
     return (0, "Could not load user to merge into") unless $canonical_self->id;
 
@@ -250,7 +250,7 @@ sub UnMerge {
     # clobber $self
     delete $EFFECTIVE_ID_CACHE{$self->id};
 
-    my $merge = RT::User->new($RT::SystemUser);
+    my $merge = RT::User->new( $self->CurrentUser );
     $merge->Load( $current->Content );
 
     $current->Delete;
@@ -284,7 +284,7 @@ sub SetEmailAddress {
 
     # if value is valid then either there is no user or
     # user is merged into this one
-    my $tmp = RT::User->new($RT::SystemUser);
+    my $tmp = RT::User->new( $self->CurrentUser );
     $tmp->LoadOriginal( EmailAddress => $value );
     if ( $tmp->id && $tmp->id != $self->id ) {
         # there is a different user record

commit 6c5be82269acefff0578a4ef502410e9ee786497
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Mon Jan 27 16:40:21 2014 -0500

    Bump version to a developer release

diff --git a/MANIFEST b/MANIFEST
index cb81d9e..add40bf 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -25,3 +25,4 @@ META.yml
 README
 xt/01merge_users.t
 xt/change_email.t
+xt/collection.t
diff --git a/META.yml b/META.yml
index ee23a64..424b0c2 100644
--- a/META.yml
+++ b/META.yml
@@ -23,4 +23,4 @@ requires:
   perl: 5.8.3
 resources:
   license: http://opensource.org/licenses/gpl-license.php
-version: 0.11
+version: 0.12_01
diff --git a/lib/RT/Extension/MergeUsers.pm b/lib/RT/Extension/MergeUsers.pm
index 9d16a48..05b9e78 100644
--- a/lib/RT/Extension/MergeUsers.pm
+++ b/lib/RT/Extension/MergeUsers.pm
@@ -49,7 +49,7 @@ use warnings; no warnings qw(redefine);
 
 package RT::Extension::MergeUsers;
 
-our $VERSION = '0.11';
+our $VERSION = '0.12_01';
 
 =head1 NAME
 

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



More information about the Bps-public-commit mailing list