[Rt-commit] rt branch, 4.4/remove-user-info, repushed

? sunnavy sunnavy at bestpractical.com
Fri Dec 28 15:35:52 EST 2018


The branch 4.4/remove-user-info was deleted and repushed:
       was 0b531738c3297087b83b8d34e497fb33e794c559
       now 59a381ff103cedfc8c277c27869ee1d1e468210b

 1: d0449e83dd < --:  ------- Create ReplaceAttachments, ReplaceHeader and ReplaceContent Methods
 2: 74736c6cbd < --:  ------- Create rt-munge-attachments executable
 3: 1461de1fec < --:  ------- Add tests for methods that munge the attachments table
 4: 32518488be < --:  ------- Fix rt-dump-metadata for the AppliedTo => AddedTo change
 5: 55f253644b < --:  ------- Rename RelatedData to BasicUserData
 6: 7c348191a6 < --:  ------- Move User related info portlet into side column
 7: 45525a282c < --:  ------- Create method AnonymizeUser in User.pm
--:  ------- >  1: 7683adbe21 Remove user related data download links on "About Me" page of priviged users
12: 84c49dbcd4 !  2: a73494e8e6 Allow TSVExport filename to be set through Filename arg
    @@ -22,40 +22,3 @@
      my $DisplayFormat = $m->comp('/Elements/ScrubHTML', Content => $Format);
      
     
    -diff --git a/share/html/User/BasicUserData.tsv b/share/html/User/BasicUserData.tsv
    ---- a/share/html/User/BasicUserData.tsv
    -+++ b/share/html/User/BasicUserData.tsv
    -@@
    - $Type             => 'User'
    - $Format           => undef
    - $id
    -+$Filename         => undef
    - </%ARGS>
    - 
    - <%INIT>
    -@@
    - }
    - 
    - $m->comp( "/Elements/TSVExport", Collection => $Collection, Format => $Format,
    --    PreserveNewLines => $PreserveNewLines
    -+    PreserveNewLines => $PreserveNewLines, Filename => $Filename,
    - );
    - </%INIT>
    -
    -diff --git a/share/html/User/Elements/BasicUserData b/share/html/User/Elements/BasicUserData
    ---- a/share/html/User/Elements/BasicUserData
    -+++ b/share/html/User/Elements/BasicUserData
    -@@
    - <div id="manage-user-data">
    -     <div name="download-user-data-title"><b>Download User Information:</b></div>
    -     <div name="download-user-data-buttons" class="inline-row">
    --        <div class="inline-cell"><a class="button" href="/User/BasicUserData.tsv?Type=User&id=<% $UserObj->id %>"><% $UserDataButton %></a></div>
    --        <div class="inline-cell"><a class="button" href="/Search/Results.tsv?Query=Requestor.id=<% $UserObj->id %>&Format=<% $Format | un %>"><% $UserTicketsButton %></a></div>
    --        <div class="inline-cell"><a class="button" href="/User/BasicUserData.tsv?Type=Transaction&id=<% $UserObj->id %>"><% $UserTxnButton %></a></div>
    -+        <div class="inline-cell"><a class="button" href="/User/BasicUserData.tsv?Type=User&id=<% $UserObj->id %>&Filename=UserData.tsv"><% $UserDataButton %></a></div>
    -+        <div class="inline-cell"><a class="button" href="/Search/Results.tsv?Query=Requestor.id=<% $UserObj->id %>&Format=<% $Format | un %>&Filename=UserTicketData.tsv"><% $UserTicketsButton %></a></div>
    -+        <div class="inline-cell"><a class="button" href="/User/BasicUserData.tsv?Type=Transaction&id=<% $UserObj->id %>&Filename=UserTransactionData.tsv"><% $UserTxnButton %></a></div>
    -     </div>
    -     <div name="remove-user-data-title"><b>Remove User Information:</b></div>
    -     <div name="remove-user-data-buttons" class="inline-row">
    -
--:  ------- >  3: 5a8673412f Set filename of downloaded user related tsv data
 8: 8b4dca4713 !  4: 20e809325a Add Timezone info to user related data
    @@ -1,6 +1,6 @@
     Author: Craig Kaiser <craig at bestpractical.com>
     
    -    Add Timezone to user column map
    +    Add Timezone info to user related data
     
     diff --git a/etc/RT_Config.pm.in b/etc/RT_Config.pm.in
     --- a/etc/RT_Config.pm.in
 9: 2459773347 !  5: fca10a9820 Update title of ObjectId in $UserTransactionDataResultFormat
    @@ -1,6 +1,6 @@
     Author: Craig Kaiser <craig at bestpractical.com>
     
    -    Update download user data default format
    +    Update title of ObjectId in $UserTransactionDataResultFormat
     
     diff --git a/etc/RT_Config.pm.in b/etc/RT_Config.pm.in
     --- a/etc/RT_Config.pm.in
    @@ -13,8 +13,5 @@
     +Set($UserTransactionDataResultFormat, "'__ObjectId__/TITLE:Ticket Id', '__id__', '__Created__', '__Description__',\
                                              '__OldValue__', '__NewValue__', '__Content__'");
      
    --
    - =item C<$DefaultSearchResultOrderBy>
      
    - What Tickets column should we order by for RT Ticket search results.
     
--:  ------- >  6: a4d10d41cb No need to show "Download User ..." buttons on user create page
--:  ------- >  7: 4f8878effb Move User related info portlet into side column
--:  ------- >  8: eaca3ea66d Create method AnonymizeUser in User.pm
10: bd01d586fc !  9: 1ceeab2d0a Create modal mason component
    @@ -56,26 +56,26 @@
     +%# END BPS TAGGED BLOCK }}}
     +<div id="<% $ModalId %>" class="<% $Class %>" align="center">
     +    <form action="<% $Action %>" method="<% $Method %>" id="<% $ModalId %>" name="<% $Name %>" >
    -+% foreach my $field (@{$Fields}) {
    ++% foreach my $field (@Fields) {
     +        <p><% $field->{'Label'} %>
     +%   if ( $field->{'Input'} ) {
     +        <input type="<% $field->{'Input'} %>" class="<% $field->{'Class'} %>" name="<% $field->{'Name'} %>" value="<% $field->{'Value'} %>">
     +%   }
     +        </p>
     +% }
    -+        <a href="#" rel="modal:close" class="button"><&|/l, $Cancel &>[_1]</&></a>
    -+        <button type="Submit" class="button"><&|/l, $Accept &>[_1]</&></button>
    ++        <a href="#" rel="modal:close" class="button"><% $Cancel %></a>
    ++        <button type="Submit" class="button"><% $Accept %></button>
     +    </form>
     +</div>
     +
     +<%ARGS>
    -+$Fields   => undef
    -+$Name     => undef
    -+$ModalId  => undef
    ++ at Fields   => ()
    ++$Name     => ''
    ++$ModalId  => ''
     +$Class    => 'modal'
    -+$Action   => undef
    ++$Action   => ''
     +$Method   => 'GET'
    -+$Accept   => 'Ok'
    -+$Cancel   => 'Cancel'
    ++$Accept   => loc('Ok')
    ++$Cancel   => loc('Cancel')
     +</%ARGS>
     
11: 311942ebb1 < --:  ------- Create portlet for removing user information
13: 0c23452c59 < --:  ------- Add remove user info portlet to user modify page
--:  ------- > 10: c8ebf4ef65 Enhance "User related info" with actions of clearing user info
14: def189a9f8 ! 11: fce1361c56 Create test for remove user information
    @@ -24,43 +24,44 @@
     +
     +# Anonymize User
     +{
    ++    my %skip_clear = map { $_ => 1 } qw/Name Password AuthToken/;
    ++    my @user_identifying_info
    ++      = grep { !$skip_clear{$_} && RT::User->_Accessible( $_, 'write' ) } keys %{ RT::User->_CoreAccessible() };
    ++
     +    my $user = RT::Test->load_or_create_user(
    ++        map( { $_ => 'test_string' } @user_identifying_info, 'AuthToken' ),
     +        Name         => 'Test User',
     +        EmailAddress => 'test at example.com',
     +    );
     +    ok( $user && $user->id );
    ++
    ++    foreach my $attr (@user_identifying_info) {
    ++        ok( $user->$attr, 'Attribute ' . $attr . ' is set' );
    ++    }
     +
     +    my $user_id = $user->id;
     +
     +    $agent->get_ok( $url . "Admin/Users/Modify.html?id=" . $user_id );
     +    $agent->follow_link_ok( { text => 'Anonymize User' } );
     +
    -+    $agent->submit_form_ok( { form_id => 'user-info-modal', },
    -+        "Anonymize user" );
    -+
    -+    $user->Load($user_id);
    -+    is( $user->EmailAddress, '', 'User Email removed' );
    ++    $agent->submit_form_ok( { form_id => 'user-info-modal', }, "Anonymize user" );
     +
     +    # UserId is still the same, but all other records should be anonimyzed for TestUser
     +    my ( $ret, $msg ) = $user->Load($user_id);
     +    ok($ret);
     +
    -+    is( $user->Name =~ /anon_/, 1, 'Username replaced with anon name' );
    -+
    -+    my @core_accessable = $user->_CoreAccessible();
    -+    my @tmp;
    -+    map{ push @tmp, $_ if $user->_Accessible($_, 'write') } keys %{$core_accessable[0] };
    -+
    -+    my %skip_clear = ( Name => '1', Password => '1', AuthToken => '1' );
    -+    my @user_identifying_info = grep { !$skip_clear{$_} } @tmp;
    ++    like( $user->Name, qr/anon_/, 'Username replaced with anon name' );
     +
     +    $user->Load($user_id);
     +
    -+    # Ensure that all other user fields are blank
    ++    # Ensure that all other user fields are unset
     +    foreach my $attr (@user_identifying_info) {
    -+        my $check = grep { not defined $_ or $_ eq '' or $_ eq 0 } $user->$attr;
    -+        is $check, 1, 'Attribute ' . $attr . ' is blank';
    ++        ok( !$user->$attr, 'Attribute ' . $attr . ' is unset' );
     +    }
    ++
    ++    ok( !$user->HasPassword, 'Password is unset' );
    ++    # Can't call AuthToken here because it creates new one automatically
    ++    ok( !$user->_Value('AuthToken'), 'Authtoken is unset' );
     +
     +    # Test that customfield values are removed with anonymize user action
     +    my $customfield = RT::CustomField->new( RT->SystemUser );
    @@ -80,8 +81,7 @@
     +    );
     +    ok( $ret, $msg );
     +
    -+    is( $user->FirstCustomFieldValue('TestCustomfield'), 'Testing',
    -+        'Customfield exists and has value for user.' );
    ++    is( $user->FirstCustomFieldValue('TestCustomfield'), 'Testing', 'Customfield exists and has value for user.' );
     +
     +    $agent->get_ok( $url . "Admin/Users/Modify.html?id=" . $user->id );
     +    $agent->follow_link_ok( { text => 'Anonymize User' } );
    @@ -93,8 +93,7 @@
     +        "Anonymize user and customfields"
     +    );
     +
    -+    is( $user->FirstCustomFieldValue('TestCustomfield'), undef,
    -+        'Customfield value cleared' );
    ++    is( $user->FirstCustomFieldValue('TestCustomfield'), undef, 'Customfield value cleared' );
     +}
     +
     +# Test replace user
    @@ -107,11 +106,7 @@
     +    ok( $user && $user->id );
     +    my $id = $user->id;
     +
    -+    ok( RT::Test->set_rights(
    -+            { Principal => $user, Right => [qw(SuperUser)] },
    -+        ),
    -+        'set rights'
    -+      );
    ++    ok( RT::Test->set_rights( { Principal => $user, Right => [qw(SuperUser)] }, ), 'set rights' );
     +
     +    ok( $agent->logout );
     +    ok( $agent->login( 'root' => 'password' ) );
    @@ -127,10 +122,9 @@
     +        "Replace user"
     +    );
     +
    -+    my ($ret, $msg) = $user->Load($id);
    ++    my ( $ret, $msg ) = $user->Load($id);
     +
    -+    is( $ret, 0,
    -+        'User successfully deleted with replace' );
    ++    is( $ret, 0, 'User successfully deleted with replace' );
     +}
     +
     +done_testing();
15: 0b531738c3 = 12: 59a381ff10 Update download user info tests



More information about the rt-commit mailing list