Commit 6b49bd98 authored by Alex Vandiver's avatar Alex Vandiver
Browse files

Version 0.13 releng

parent aade62d1
0.12 Thu Mar 27 12:52:17 EST 2014
1.00 2014-06-20
- Better compatibility with shredder -- tool to repair badly shredded
merged users, and adjustments to make shredder un-merge before
removing.
0.12 2014-03-27
- Merge users as the current user, not always the superuser
- Propagate Disabled bit to users that are merged in
0.11 2013-09-10
- For every merged user in a collection one user at the end of the
collection was skipped, for example in owners drop down, admin interface
or in autocompletion lists.
0.10 2013-08-02
- Enable user autocomplete on the "Merge user into" form for RT 4.2
- Correct a packaging error in MANIFEST in the previous release
0.09 2013-06-26
- Update Module::Install and Module::Install::RTx
- Fix "Merged into ..." messages in user comments
- Remove Hook::LexWrap, to allow useful stacktraces
- Hook for user summary (RT 4.2)
- Fix a bug with the unique'ing code in RT::Users
- Fix for loading from a RT::CurrentUser, not just an RT::User
0.08 2013-02-25
- Move tests to author-only; they require having an RT installed somewhere
- Switch to .in files for substitution so as not to trash
version-controlled files
- Record the merged/mergee's user Name if EmailAddress is empty
- Unset EmailAddress by setting the empty string rather than undef
- Switch to modern RT::Test infrastructure for testing plugins
0.07 2012-08-30
- Fix bug of "user email address destroys matching address in other user"
(#70641)
0.06 2011-10-17
- Actually clear the seen_users cache when we get undef back from
SUPER::Next
0.05 2011-09-30
- Update packaging and install infrastructure for RT 4
0.04 2010-12-14
- Also clear cache when merging
- Update docs
0.04_01 2009-10-03
- Fix bug in cache and unmerging
- Apply modified patch from Jason A Smith to make it clearer which users
are being affected.
0.03 2009-09-16
- Release updates from 0.03 prereleases
0.03_02 2009-04-06
- Track merged users bidirectionally
- Allow unmerging users from the main user's modification page
- Show errors/results from merging
- Add new script for adding bidirectional attributes to old installs
0.03_01 2008-11-23
- remove User_Overlay and Users_Overlay to avoid conflicts with other
plugins
- Use callbacks available in 3.6/3.8 rather than overriding the whole
Admin/Users/Modify.html template
- Upgrade Module::Install::RTx to work with 3.8
* Merge users as the current user, not always the superuser
* Propagate Disabled bit to users that are merged in
0.11 Tue Sep 10 14:42:46 MSK 2013
* For every merged user in a collection one user at the end of
the collection was skipped, for example in owners drop down,
admin interface or in autocompletion lists.
0.10 Fri Aug 2 15:34:06 PDT 2013
* Enable user autocomplete on the "Merge user into" form for RT 4.2
* Correct a packaging error in MANIFEST in the previous release
0.09 Wed Jun 26 15:06:42 EST 2013
* Update Module::Install and Module::Install::RTx
* Fix "Merged into ..." messages in user comments
* Remove Hook::LexWrap, to allow useful stacktraces
* Hook for user summary (RT 4.2)
* Fix a bug with the unique'ing code in RT::Users
* Fix for loading from a RT::CurrentUser, not just an RT::User
0.08 Mon Feb 25 13:33:48 PST 2013
* Move tests to author-only; they require having an RT installed
somewhere
* Switch to .in files for substitution so as not to trash
version-controlled files
* Record the merged/mergee's user Name if EmailAddress is empty
* Unset EmailAddress by setting the empty string rather than undef
* Switch to modern RT::Test infrastructure for testing plugins
0.07 Thu Aug 30 12:09:31 EST 2012
* Fix bug of "user email address destroys matching address in other
user" (#70641)
0.06
* Actually clear the seen_users cache when we get undef back from SUPER::Next
0.05
* Update packaging and install infrastructure for RT 4
0.04
* Also clear cache when merging
* Update docs
0.04_01
* Fix bug in cache and unmerging
* Apply modified patch from Jason A Smith to make it clearer which
users are being affected.
0.03
* Release updates from 0.03 prereleases
0.03_02 2009-04-06 Tue 17:08 -0400 falcone
* Track merged users bidirectionally
* Allow unmerging users from the main user's modification page
* Show errors/results from merging
* Add new script for adding bidirectional attributes to old installs
0.03_01 2008-11-23 Sun 18:51 -0500 falcone
* remove User_Overlay and Users_Overlay to avoid conflicts with
other plugins
* Use callbacks available in 3.6/3.8 rather than overriding the
whole Admin/Users/Modify.html template
* Upgrade Module::Install::RTx to work with 3.8
bin/rt-clean-merged-users
bin/rt-clean-merged-users.in
bin/rt-merge-users.in
bin/rt-update-merged-users.in
Changes
html/Callbacks/RT-Extension-MergeUsers/Admin/Users/Modify.html/RightColumnBottom
html/Callbacks/RT-Extension-MergeUsers/User/Elements/TicketList/ModifyWatcherSQL
inc/Module/AutoInstall.pm
inc/Module/Install.pm
inc/Module/Install/AutoInstall.pm
inc/Module/Install/Base.pm
inc/Module/Install/Can.pm
inc/Module/Install/Fetch.pm
......@@ -14,9 +14,12 @@ inc/Module/Install/Makefile.pm
inc/Module/Install/Metadata.pm
inc/Module/Install/ReadmeFromPod.pm
inc/Module/Install/RTx.pm
inc/Module/Install/RTx/Runtime.pm
inc/Module/Install/Substitute.pm
inc/Module/Install/Win32.pm
inc/Module/Install/WriteAll.pm
inc/unicore/Name.pm
inc/YAML/Tiny.pm
lib/RT/Extension/MergeUsers.pm
Makefile.PL
MANIFEST This list of files
......
......@@ -27,4 +27,7 @@ requires:
perl: 5.8.3
resources:
license: http://opensource.org/licenses/gpl-license.php
version: 0.12
version: '1.00'
x_module_install_rtx_version: 0.34_03
x_requires_rt: 4.0.0
x_rt_too_new: 4.4.0
use inc::Module::Install;
RTx('RT-Extension-MergeUsers');
all_from ('lib/RT/Extension/MergeUsers.pm');
readme_from ('lib/RT/Extension/MergeUsers.pm');
RTx 'RT-Extension-MergeUsers';
readme_from 'lib/RT/Extension/MergeUsers.pm';
requires_rt('3.8.3');
requires_rt('4.0.0');
rt_too_new('4.4.0');
my ($lib_path) = $INC{'RT.pm'} =~ /^(.*)[\\\/]/;
my $local_lib_path = "$RT::LocalPath/lib";
......@@ -30,5 +30,4 @@ substitute( {
no_index( package => 'RT::User', 'RT::Users', 'RT::Principal');
sign();
auto_install();
WriteAll();
......@@ -15,23 +15,51 @@ DESCRIPTION
all e-mail sent from secondary users is displayed as coming from the
primary user.
RT::Shredder and Merged Users
Merging a user effectively makes it impossible to load the merged user
directly. Attempting to access the old user resolves to the merged-into
user. Because of this, MergeUsers has some extra code to help
RT::Shredder clean up these merged records to avoid leaving merged user
records in the DB while removing the user they were merged into.
When running RT::Shredder on a user record with other users merged into
it, the merged users are Unmerged before the initial user record is
shredded. There are two options to handle these newly unmerged users:
1. Re-run your shredder command with the same or similar options. The
unmerged user records will now be accessible and, depending on your
shredder options, they will likely be shredded on the second run. If
you have multiple layers of merged users, you may need to run
shredder multiple times.
2. MergeUsers will log the unmerged users at the "info" level so you
can pull the user ids from the log and shred them manually. This is
most likely to be useful if you are shredding one specific user (and
all merged accounts).
INSTALLATION
If you're upgrading then, as well, read "UPGRADING" below.
Be sure to also read "UPGRADING" if you are upgrading.
"perl Makefile.PL"
"make"
"make install"
May need root permissions
perl Makefile.PL
make
make install
clear your mason cache
most often this would be rm -rf /opt/rt3/var/mason_data/*
restart apache
Edit your /opt/rt4/etc/RT_SiteConfig.pm
If you are using RT 4.2 or greater, add this line:
For RT 3.8
Plugin('RT::Extension::MergeUsers');
Add RT::Extension::MergeUsers to your /opt/rt3/etc/RT_SiteConfig.pm file
Set(@Plugins, qw(RT::Extension::MergeUsers));
For RT 4.0, add this line:
If you have more than one Plugin enabled, you must enable them as one
Set(@Plugins, qw(Foo Bar)); command
Set(@Plugins, qw(RT::Extension::MergeUsers));
or add "RT::Extension::MergeUsers" to your existing @Plugins line.
Clear your mason cache
rm -rf /opt/rt4/var/mason_data/obj
Restart your webserver
UPGRADING
If you are upgrading from 0.03_01 or earlier, you must run
......@@ -41,6 +69,14 @@ UPGRADING
users. It can be safely run multiple times, it will only create
Attributes as needed.
UTILITIES
rt-clean-merged-users
When a user with another user merged into it is shredded, the attributes
on that user are also shredded, but the merged user will remain, along
with attributes that may point to the now missing user id. This script
cleans up attributes if the merged-into user record is now gone. These
users will then be converted back to regular unmerged users.
Next
This custom iterator makes sure that duplicate users are never shown in
search results.
......
%# BEGIN BPS TAGGED BLOCK {{{
%#
%#
%# COPYRIGHT:
%#
%# This software is Copyright (c) 1996-2008 Best Practical Solutions, LLC
%#
%# This software is Copyright (c) 1996-2014 Best Practical Solutions, LLC
%# <sales@bestpractical.com>
%#
%#
%# (Except where explicitly superseded by other copyright notices)
%#
%#
%#
%#
%# LICENSE:
%#
%#
%# This work is made available to you under the terms of Version 2 of
%# the GNU General Public License. A copy of that license should have
%# been provided with this software, but in any event can be snarfed
%# from www.gnu.org.
%#
%#
%# This work is distributed in the hope that it will be useful, but
%# WITHOUT ANY WARRANTY; without even the implied warranty of
%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
%# General Public License for more details.
%#
%#
%# You should have received a copy of the GNU General Public License
%# along with this program; if not, write to the Free Software
%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
%# 02110-1301 or visit their web page on the internet at
%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
%#
%#
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
%#
%#
%# (The following paragraph is not intended to limit the rights granted
%# to you to modify and distribute this software under the terms of
%# the GNU General Public License and is only of importance to you if
%# you choose to contribute your changes and enhancements to the
%# community by submitting them to Best Practical Solutions, LLC.)
%#
%#
%# By intentionally submitting any modifications, corrections or
%# derivatives to this work, or any other work intended for use with
%# Request Tracker, to Best Practical Solutions, LLC, you confirm that
......@@ -43,7 +43,7 @@
%# royalty-free, perpetual, license to use, copy, create derivative
%# works based on those contributions, and sublicense and distribute
%# those contributions and any derivatives thereof.
%#
%#
%# END BPS TAGGED BLOCK }}}
<br />
<&| /Widgets/TitleBox, title => loc('Merge user') &>
......
This diff is collapsed.
#line 1
package Module::Install::AutoInstall;
use strict;
use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
$VERSION = '1.08';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
sub AutoInstall { $_[0] }
sub run {
my $self = shift;
$self->auto_install_now(@_);
}
sub write {
my $self = shift;
$self->auto_install(@_);
}
sub auto_install {
my $self = shift;
return if $self->{done}++;
# Flatten array of arrays into a single array
my @core = map @$_, map @$_, grep ref,
$self->build_requires, $self->requires;
my @config = @_;
# We'll need Module::AutoInstall
$self->include('Module::AutoInstall');
require Module::AutoInstall;
my @features_require = Module::AutoInstall->import(
(@config ? (-config => \@config) : ()),
(@core ? (-core => \@core) : ()),
$self->features,
);
my %seen;
my @requires = map @$_, map @$_, grep ref, $self->requires;
while (my ($mod, $ver) = splice(@requires, 0, 2)) {
$seen{$mod}{$ver}++;
}
my @build_requires = map @$_, map @$_, grep ref, $self->build_requires;
while (my ($mod, $ver) = splice(@build_requires, 0, 2)) {
$seen{$mod}{$ver}++;
}
my @configure_requires = map @$_, map @$_, grep ref, $self->configure_requires;
while (my ($mod, $ver) = splice(@configure_requires, 0, 2)) {
$seen{$mod}{$ver}++;
}
my @deduped;
while (my ($mod, $ver) = splice(@features_require, 0, 2)) {
push @deduped, $mod => $ver unless $seen{$mod}{$ver}++;
}
$self->requires(@deduped);
$self->makemaker_args( Module::AutoInstall::_make_args() );
my $class = ref($self);
$self->postamble(
"# --- $class section:\n" .
Module::AutoInstall::postamble()
);
}
sub installdeps_target {
my ($self, @args) = @_;
$self->include('Module::AutoInstall');
require Module::AutoInstall;
Module::AutoInstall::_installdeps_target(1);
$self->auto_install(@args);
}
sub auto_install_now {
my $self = shift;
$self->auto_install(@_);
Module::AutoInstall::do_install();
}
1;
......@@ -8,7 +8,7 @@ no warnings 'once';
use Module::Install::Base;
use base 'Module::Install::Base';
our $VERSION = '0.33';
our $VERSION = '0.34_03';
use FindBin;
use File::Glob ();
......@@ -20,98 +20,67 @@ my @INDEX_DIRS = qw(lib bin sbin);
sub RTx {
my ( $self, $name ) = @_;
my $original_name = $name;
my $RTx = 'RTx';
$RTx = $1 if $name =~ s/^(\w+)-//;
# Set up names
my $fname = $name;
$fname =~ s!-!/!g;
$self->name("$RTx-$name")
$self->name( $name )
unless $self->name;
$self->all_from( -e "$name.pm" ? "$name.pm" : "lib/$RTx/$fname.pm" )
$self->all_from( "lib/$fname.pm" )
unless $self->version;
$self->abstract("RT $name Extension")
$self->abstract("$name Extension")
unless $self->abstract;
my @prefixes = (qw(/opt /usr/local /home /usr /sw ));
my $prefix = $ENV{PREFIX};
@ARGV = grep { /PREFIX=(.*)/ ? ( ( $prefix = $1 ), 0 ) : 1 } @ARGV;
if ($prefix) {
$RT::LocalPath = $prefix;
$INC{'RT.pm'} = "$RT::LocalPath/lib/RT.pm";
} else {
local @INC = (
$ENV{RTHOME} ? ( $ENV{RTHOME}, "$ENV{RTHOME}/lib" ) : (),
@INC,
map { ( "$_/rt4/lib", "$_/lib/rt4", "$_/rt3/lib", "$_/lib/rt3", "$_/lib" )
} grep $_, @prefixes
);
until ( eval { require RT; $RT::LocalPath } ) {
warn
"Cannot find the location of RT.pm that defines \$RT::LocalPath in: @INC\n";
$_ = $self->prompt("Path to directory containing your RT.pm:") or exit;
$_ =~ s/\/RT\.pm$//;
push @INC, $_, "$_/rt3/lib", "$_/lib/rt3", "$_/lib";
}
$self->add_metadata("x_module_install_rtx_version", $VERSION );
# Try to find RT.pm
my @prefixes = qw( /opt /usr/local /home /usr /sw );
my @try = $ENV{RTHOME} ? ($ENV{RTHOME}, "$ENV{RTHOME}/lib") : ();
while (1) {
my @look = @INC;
unshift @look, grep {defined and -d $_} @try;
push @look, grep {defined and -d $_}
map { ( "$_/rt4/lib", "$_/lib/rt4", "$_/lib" ) } @prefixes;
last if eval {local @INC = @look; require RT; $RT::LocalLibPath};
warn
"Cannot find the location of RT.pm that defines \$RT::LocalPath in: @look\n";
$_ = $self->prompt("Path to directory containing your RT.pm:") or exit;
$_ =~ s{(/lib)?/RT\.pm$}{};
@try = ("$_/rt4/lib", "$_/lib/rt4", "$_/lib");
}
my $lib_path = File::Basename::dirname( $INC{'RT.pm'} );
my $local_lib_path = "$RT::LocalPath/lib";
print "Using RT configuration from $INC{'RT.pm'}:\n";
unshift @INC, "$RT::LocalPath/lib" if $RT::LocalPath;
my $local_lib_path = $RT::LocalLibPath;
unshift @INC, $local_lib_path;
my $lib_path = File::Basename::dirname( $INC{'RT.pm'} );
unshift @INC, $lib_path;
$RT::LocalVarPath ||= $RT::VarPath;
$RT::LocalPoPath ||= $RT::LocalLexiconPath;
$RT::LocalHtmlPath ||= $RT::MasonComponentRoot;
$RT::LocalStaticPath ||= $RT::StaticPath;
$RT::LocalLibPath ||= "$RT::LocalPath/lib";
my $with_subdirs = $ENV{WITH_SUBDIRS};
@ARGV = grep { /WITH_SUBDIRS=(.*)/ ? ( ( $with_subdirs = $1 ), 0 ) : 1 }
@ARGV;
my %subdirs;
%subdirs = map { $_ => 1 } split( /\s*,\s*/, $with_subdirs )
if defined $with_subdirs;
unless ( keys %subdirs ) {
$subdirs{$_} = 1 foreach grep -d "$FindBin::Bin/$_", @DIRS;
}
# Set a baseline minimum version
$self->requires_rt('4.0.0');
# If we're running on RT 3.8 with plugin support, we really wany
# to install libs, mason templates and po files into plugin specific
# directories
# Installation locations
my %path;
if ( $RT::LocalPluginPath ) {
die "Because of bugs in RT 3.8.0 this extension can not be installed.\n"
."Upgrade to RT 3.8.1 or newer.\n" if $RT::VERSION =~ /^3\.8\.0/;
$path{$_} = $RT::LocalPluginPath . "/$original_name/$_"
foreach @DIRS;
# Copy RT 4.2.0 static files into NoAuth; insufficient for
# images, but good enough for css and js.
$path{static} = "$path{html}/NoAuth/"
unless $RT::StaticPath;
} else {
foreach ( @DIRS ) {
no strict 'refs';
my $varname = "RT::Local" . ucfirst($_) . "Path";
$path{$_} = ${$varname} || "$RT::LocalPath/$_";
}
$path{$_} = $RT::LocalPluginPath . "/$name/$_"
foreach @DIRS;
$path{$_} .= "/$name" for grep $path{$_}, qw(etc po var);
}
# Copy RT 4.2.0 static files into NoAuth; insufficient for
# images, but good enough for css and js.
$path{static} = "$path{html}/NoAuth/"
unless $RT::StaticPath;
# Delete the ones we don't need
delete $path{$_} for grep {not -d "$FindBin::Bin/$_"} keys %path;
my %index = map { $_ => 1 } @INDEX_DIRS;
$self->no_index( directory => $_ ) foreach grep !$index{$_}, @DIRS;
my $args = join ', ', map "q($_)", map { ($_, $path{$_}) }
grep $subdirs{$_}, keys %path;
sort keys %path;
print "./$_\t=> $path{$_}\n" for sort keys %subdirs;
printf "%-10s => %s\n", $_, $path{$_} for sort keys %path;
if ( my @dirs = map { ( -D => $_ ) } grep $subdirs{$_}, qw(bin html sbin) ) {
if ( my @dirs = map { ( -D => $_ ) } grep $path{$_}, qw(bin html sbin etc) ) {
my @po = map { ( -o => $_ ) }
grep -f,
File::Glob::bsd_glob("po/*.po");
......@@ -121,12 +90,15 @@ lexicons ::
.
}
$self->include('Module::Install::RTx::Runtime') if $self->admin;
$self->include_deps( 'YAML::Tiny', 0 ) if $self->admin;
my $postamble = << ".";
install ::
\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Iinc -MModule::Install::RTx::Runtime -e"RTxPlugin()"
\t\$(NOECHO) \$(PERL) -MExtUtils::Install -e \"install({$args})\"
.
if ( $subdirs{var} and -d $RT::MasonDataDir ) {
if ( $path{var} and -d $RT::MasonDataDir ) {
my ( $uid, $gid ) = ( stat($RT::MasonDataDir) )[ 4, 5 ];
$postamble .= << ".";
\t\$(NOECHO) chown -R $uid:$gid $path{var}
......@@ -146,11 +118,11 @@ install ::
}
$self->postamble("$postamble\n");
unless ( $subdirs{'lib'} ) {
$self->makemaker_args( PM => { "" => "" }, );
} else {
if ( $path{lib} ) {
$self->makemaker_args( INSTALLSITELIB => $path{'lib'} );
$self->makemaker_args( INSTALLARCHLIB => $path{'lib'} );
} else {
$self->makemaker_args( PM => { "" => "" }, );
}
$self->makemaker_args( INSTALLSITEMAN1DIR => "$RT::LocalPath/man/man1" );
......@@ -158,47 +130,96 @@ install ::
$self->makemaker_args( INSTALLSITEARCH => "$RT::LocalPath/man" );
if (%has_etc) {
$self->load('RTxInitDB');
print "For first-time installation, type 'make initdb'.\n";
my $initdb = '';
$initdb .= <<"." if $has_etc{schema};
\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Minc::Module::Install -e"RTxInitDB(qw(schema \$(NAME) \$(VERSION)))"