[Bps-public-commit] rt-extension-resetpassword branch, master, updated. 1.03-3-g4299510
Jim Brandt
jbrandt at bestpractical.com
Tue Nov 1 14:26:04 EDT 2016
The branch, master has been updated
via 4299510d084d66903341187505a65cf42cfa29ac (commit)
via 6f262fe23c11a197bb8d85ab455ca4d285fa7d41 (commit)
via e4627abfa154f90973d3aa80bdb16ef976e368b6 (commit)
from dd050884762db0445fb3c1fe2ae46e39d0b2031d (commit)
Summary of changes:
Changes | 3 ++
META.yml | 6 +--
README | 11 ++++++
etc/initialdata | 2 +-
inc/Module/Install.pm | 2 +-
inc/Module/Install/Base.pm | 2 +-
inc/Module/Install/Can.pm | 2 +-
inc/Module/Install/Fetch.pm | 2 +-
inc/Module/Install/Include.pm | 2 +-
inc/Module/Install/Makefile.pm | 2 +-
inc/Module/Install/Metadata.pm | 2 +-
inc/Module/Install/RTx.pm | 29 ++++++++++++--
inc/Module/Install/ReadmeFromPod.pm | 76 +++++++++++++++++++++++++++++--------
inc/Module/Install/Win32.pm | 2 +-
inc/Module/Install/WriteAll.pm | 2 +-
inc/YAML/Tiny.pm | 9 ++---
lib/RT/Extension/ResetPassword.pm | 14 ++++++-
17 files changed, 130 insertions(+), 38 deletions(-)
- Log -----------------------------------------------------------------
commit e4627abfa154f90973d3aa80bdb16ef976e368b6
Author: Jim Brandt <jbrandt at bestpractical.com>
Date: Tue Nov 1 14:13:39 2016 -0400
Update ENV reference to use the new RequestENV function
diff --git a/etc/initialdata b/etc/initialdata
index a16003d..0c9cca3 100644
--- a/etc/initialdata
+++ b/etc/initialdata
@@ -6,7 +6,7 @@
Greetings,
-Someone at { $ENV{\'REMOTE_ADDR\'} } requested that RT send you this message
+Someone at { RT::Interface::Web::RequestENV(\'REMOTE_ADDR\') } requested that RT send you this message
allowing you to reset your password. If you didn\'t request this message, please
notify your RT administrator immediately.
commit 6f262fe23c11a197bb8d85ab455ca4d285fa7d41
Author: Jim Brandt <jbrandt at bestpractical.com>
Date: Tue Nov 1 14:16:16 2016 -0400
Update Module::Install
diff --git a/inc/Module/Install.pm b/inc/Module/Install.pm
index ff767fa..f44ab4d 100644
--- a/inc/Module/Install.pm
+++ b/inc/Module/Install.pm
@@ -31,7 +31,7 @@ BEGIN {
# This is not enforced yet, but will be some time in the next few
# releases once we can make sure it won't clash with custom
# Module::Install extensions.
- $VERSION = '1.14';
+ $VERSION = '1.16';
# Storage for the pseudo-singleton
$MAIN = undef;
diff --git a/inc/Module/Install/Base.pm b/inc/Module/Install/Base.pm
index 4206347..5762a74 100644
--- a/inc/Module/Install/Base.pm
+++ b/inc/Module/Install/Base.pm
@@ -4,7 +4,7 @@ package Module::Install::Base;
use strict 'vars';
use vars qw{$VERSION};
BEGIN {
- $VERSION = '1.14';
+ $VERSION = '1.16';
}
# Suspend handler for "redefined" warnings
diff --git a/inc/Module/Install/Can.pm b/inc/Module/Install/Can.pm
index 9929b1b..d859276 100644
--- a/inc/Module/Install/Can.pm
+++ b/inc/Module/Install/Can.pm
@@ -8,7 +8,7 @@ use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '1.14';
+ $VERSION = '1.16';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
diff --git a/inc/Module/Install/Fetch.pm b/inc/Module/Install/Fetch.pm
index 3d8de76..41d3517 100644
--- a/inc/Module/Install/Fetch.pm
+++ b/inc/Module/Install/Fetch.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '1.14';
+ $VERSION = '1.16';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
diff --git a/inc/Module/Install/Include.pm b/inc/Module/Install/Include.pm
index f274f87..2eb1d1f 100644
--- a/inc/Module/Install/Include.pm
+++ b/inc/Module/Install/Include.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '1.14';
+ $VERSION = '1.16';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
diff --git a/inc/Module/Install/Makefile.pm b/inc/Module/Install/Makefile.pm
index 66993af..e9918d2 100644
--- a/inc/Module/Install/Makefile.pm
+++ b/inc/Module/Install/Makefile.pm
@@ -8,7 +8,7 @@ use Fcntl qw/:flock :seek/;
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '1.14';
+ $VERSION = '1.16';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
diff --git a/inc/Module/Install/Metadata.pm b/inc/Module/Install/Metadata.pm
index e547fa0..9792685 100644
--- a/inc/Module/Install/Metadata.pm
+++ b/inc/Module/Install/Metadata.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '1.14';
+ $VERSION = '1.16';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
diff --git a/inc/Module/Install/RTx.pm b/inc/Module/Install/RTx.pm
index 97acf77..80538d3 100644
--- a/inc/Module/Install/RTx.pm
+++ b/inc/Module/Install/RTx.pm
@@ -8,7 +8,7 @@ no warnings 'once';
use Module::Install::Base;
use base 'Module::Install::Base';
-our $VERSION = '0.37';
+our $VERSION = '0.38';
use FindBin;
use File::Glob ();
@@ -37,6 +37,13 @@ sub RTx {
}
$self->add_metadata("x_module_install_rtx_version", $VERSION );
+ my $installdirs = $ENV{INSTALLDIRS};
+ for ( @ARGV ) {
+ if ( /INSTALLDIRS=(.*)/ ) {
+ $installdirs = $1;
+ }
+ }
+
# Try to find RT.pm
my @prefixes = qw( /opt /usr/local /home /usr /sw /usr/share/request-tracker4);
$ENV{RTHOME} =~ s{/RT\.pm$}{} if defined $ENV{RTHOME};
@@ -71,7 +78,13 @@ sub RTx {
# Installation locations
my %path;
- $path{$_} = $RT::LocalPluginPath . "/$name/$_"
+ my $plugin_path;
+ if ( $installdirs && $installdirs eq 'vendor' ) {
+ $plugin_path = $RT::PluginPath;
+ } else {
+ $plugin_path = $RT::LocalPluginPath;
+ }
+ $path{$_} = $plugin_path . "/$name/$_"
foreach @DIRS;
# Copy RT 4.2.0 static files into NoAuth; insufficient for
@@ -85,7 +98,7 @@ sub RTx {
my %index = map { $_ => 1 } @INDEX_DIRS;
$self->no_index( directory => $_ ) foreach grep !$index{$_}, @DIRS;
- my $args = join ', ', map "q($_)", map { ($_, $path{$_}) }
+ my $args = join ', ', map "q($_)", map { ($_, "\$(DESTDIR)$path{$_}") }
sort keys %path;
printf "%-10s => %s\n", $_, $path{$_} for sort keys %path;
@@ -131,6 +144,7 @@ install ::
if ( $path{lib} ) {
$self->makemaker_args( INSTALLSITELIB => $path{'lib'} );
$self->makemaker_args( INSTALLARCHLIB => $path{'lib'} );
+ $self->makemaker_args( INSTALLVENDORLIB => $path{'lib'} )
} else {
$self->makemaker_args( PM => { "" => "" }, );
}
@@ -139,6 +153,13 @@ install ::
$self->makemaker_args( INSTALLSITEMAN3DIR => "$RT::LocalPath/man/man3" );
$self->makemaker_args( INSTALLSITEARCH => "$RT::LocalPath/man" );
+ # INSTALLDIRS=vendor should install manpages into /usr/share/man.
+ # That is the default path in most distributions. Need input from
+ # Redhat, Centos etc.
+ $self->makemaker_args( INSTALLVENDORMAN1DIR => "/usr/share/man/man1" );
+ $self->makemaker_args( INSTALLVENDORMAN3DIR => "/usr/share/man/man3" );
+ $self->makemaker_args( INSTALLVENDORARCH => "/usr/share/man" );
+
if (%has_etc) {
print "For first-time installation, type 'make initdb'.\n";
my $initdb = '';
@@ -258,4 +279,4 @@ sub _load_rt_handle {
__END__
-#line 390
+#line 428
diff --git a/inc/Module/Install/ReadmeFromPod.pm b/inc/Module/Install/ReadmeFromPod.pm
index b5e03c3..3634ee0 100644
--- a/inc/Module/Install/ReadmeFromPod.pm
+++ b/inc/Module/Install/ReadmeFromPod.pm
@@ -7,12 +7,41 @@ use warnings;
use base qw(Module::Install::Base);
use vars qw($VERSION);
-$VERSION = '0.22';
+$VERSION = '0.26';
+
+{
+
+ # these aren't defined until after _require_admin is run, so
+ # define them so prototypes are available during compilation.
+ sub io;
+ sub capture(&;@);
+
+#line 28
+
+ my $done = 0;
+
+ sub _require_admin {
+
+ # do this once to avoid redefinition warnings from IO::All
+ return if $done;
+
+ require IO::All;
+ IO::All->import( '-binary' );
+
+ require Capture::Tiny;
+ Capture::Tiny->import ( 'capture' );
+
+ return;
+ }
+
+}
sub readme_from {
my $self = shift;
return unless $self->is_admin;
+ _require_admin;
+
# Input file
my $in_file = shift || $self->_all_from
or die "Can't determine file to make readme_from";
@@ -50,6 +79,8 @@ sub readme_from {
$out_file = $self->_readme_htm($in_file, $out_file, $options);
} elsif ($format eq 'man') {
$out_file = $self->_readme_man($in_file, $out_file, $options);
+ } elsif ($format eq 'md') {
+ $out_file = $self->_readme_md($in_file, $out_file, $options);
} elsif ($format eq 'pdf') {
$out_file = $self->_readme_pdf($in_file, $out_file, $options);
}
@@ -67,10 +98,10 @@ sub _readme_txt {
$out_file ||= 'README';
require Pod::Text;
my $parser = Pod::Text->new( @$options );
- open my $out_fh, '>', $out_file or die "Could not write file $out_file:\n$!\n";
+ my $io = io->file($out_file)->open(">");
+ my $out_fh = $io->io_handle;
$parser->output_fh( *$out_fh );
$parser->parse_file( $in_file );
- close $out_fh;
return $out_file;
}
@@ -79,11 +110,14 @@ sub _readme_htm {
my ($self, $in_file, $out_file, $options) = @_;
$out_file ||= 'README.htm';
require Pod::Html;
- Pod::Html::pod2html(
- "--infile=$in_file",
- "--outfile=$out_file",
- @$options,
- );
+ my ($o) = capture {
+ Pod::Html::pod2html(
+ "--infile=$in_file",
+ "--outfile=-",
+ @$options,
+ );
+ };
+ io->file($out_file)->print($o);
# Remove temporary files if needed
for my $file ('pod2htmd.tmp', 'pod2htmi.tmp') {
if (-e $file) {
@@ -99,7 +133,10 @@ sub _readme_man {
$out_file ||= 'README.1';
require Pod::Man;
my $parser = Pod::Man->new( @$options );
- $parser->parse_from_file($in_file, $out_file);
+ my $io = io->file($out_file)->open(">");
+ my $out_fh = $io->io_handle;
+ $parser->output_fh( *$out_fh );
+ $parser->parse_file( $in_file );
return $out_file;
}
@@ -111,11 +148,20 @@ sub _readme_pdf {
or die "Could not generate $out_file because pod2pdf could not be found\n";
my $parser = App::pod2pdf->new( @$options );
$parser->parse_from_file($in_file);
- open my $out_fh, '>', $out_file or die "Could not write file $out_file:\n$!\n";
- select $out_fh;
- $parser->output;
- select STDOUT;
- close $out_fh;
+ my ($o) = capture { $parser->output };
+ io->file($out_file)->print($o);
+ return $out_file;
+}
+
+sub _readme_md {
+ my ($self, $in_file, $out_file, $options) = @_;
+ $out_file ||= 'README.md';
+ require Pod::Markdown;
+ my $parser = Pod::Markdown->new( @$options );
+ my $io = io->file($out_file)->open(">");
+ my $out_fh = $io->io_handle;
+ $parser->output_fh( *$out_fh );
+ $parser->parse_file( $in_file );
return $out_file;
}
@@ -134,5 +180,5 @@ sub _all_from {
__END__
-#line 254
+#line 316
diff --git a/inc/Module/Install/Win32.pm b/inc/Module/Install/Win32.pm
index 9706e5f..218a66b 100644
--- a/inc/Module/Install/Win32.pm
+++ b/inc/Module/Install/Win32.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '1.14';
+ $VERSION = '1.16';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
diff --git a/inc/Module/Install/WriteAll.pm b/inc/Module/Install/WriteAll.pm
index dbedc00..530749b 100644
--- a/inc/Module/Install/WriteAll.pm
+++ b/inc/Module/Install/WriteAll.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '1.14';
+ $VERSION = '1.16';
@ISA = qw{Module::Install::Base};
$ISCORE = 1;
}
diff --git a/inc/YAML/Tiny.pm b/inc/YAML/Tiny.pm
index 8da7cd1..aa539f7 100644
--- a/inc/YAML/Tiny.pm
+++ b/inc/YAML/Tiny.pm
@@ -2,13 +2,12 @@
use 5.008001; # sane UTF-8 support
use strict;
use warnings;
-package YAML::Tiny;
-# git description: v1.63-12-g5dd832a
-$YAML::Tiny::VERSION = '1.64';
+package YAML::Tiny; # git description: v1.68-2-gcc5324e
# XXX-INGY is 5.8.1 too old/broken for utf8?
# XXX-XDG Lancaster consensus was that it was sufficient until
# proven otherwise
+our $VERSION = '1.69';
#####################################################################
# The YAML::Tiny API.
@@ -514,7 +513,7 @@ sub _load_hash {
}
if ( exists $hash->{$key} ) {
- die \"YAML::Tiny found a duplicate key '$key' in line '$lines->[0]'";
+ warn "YAML::Tiny found a duplicate key '$key' in line '$lines->[0]'";
}
# Do we have a value?
@@ -872,4 +871,4 @@ delete $YAML::Tiny::{refaddr};
__END__
-#line 1490
+#line 1489
commit 4299510d084d66903341187505a65cf42cfa29ac
Author: Jim Brandt <jbrandt at bestpractical.com>
Date: Tue Nov 1 14:24:30 2016 -0400
Prep for 1.04 release
diff --git a/Changes b/Changes
index 2c7a9f6..c897177 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,8 @@
Revision history for Perl module RT::Extension::ResetPassword
+1.04 2016-11-01
+ - Update ENV reference to use the new RequestENV function
+
1.03 2015-03-05
- Fix a "Use of uninitialized value" warning
diff --git a/META.yml b/META.yml
index fb97563..bfe3c9a 100644
--- a/META.yml
+++ b/META.yml
@@ -8,7 +8,7 @@ configure_requires:
ExtUtils::MakeMaker: 6.59
distribution_type: module
dynamic_config: 1
-generated_by: 'Module::Install version 1.14'
+generated_by: 'Module::Install version 1.16'
license: gpl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -23,6 +23,6 @@ requires:
perl: 5.8.3
resources:
license: http://opensource.org/licenses/gpl-license.php
-version: '1.03'
-x_module_install_rtx_version: '0.37'
+version: '1.04'
+x_module_install_rtx_version: '0.38'
x_requires_rt: 4.0.0
diff --git a/README b/README
index faf157d..1b303c7 100644
--- a/README
+++ b/README
@@ -11,6 +11,9 @@ DESCRIPTION
There isn't yet an option to only allow privileged or unpriviliged users
to reset their passwords.
+RT VERSION
+ Works with RT 4.0, 4.2, 4.4
+
INSTALLATION
perl Makefile.PL
make
@@ -47,6 +50,14 @@ UPGRADING
as documented in INSTALLATION to install the Template used by this
Extension.
+ To run on RT 4.0 or 4.2, replace this line in the template:
+
+ { RT::Interface::Web::RequestENV('REMOTE_ADDR') }
+
+ with this:
+
+ { $ENV{'REMOTE_ADDR'} }
+
CONFIGURATION
The contents of the email sent to users can be found in the global
PasswordReset template (do not confuse this with the core PasswordChange
diff --git a/lib/RT/Extension/ResetPassword.pm b/lib/RT/Extension/ResetPassword.pm
index 3ad490b..1e96f02 100644
--- a/lib/RT/Extension/ResetPassword.pm
+++ b/lib/RT/Extension/ResetPassword.pm
@@ -3,7 +3,7 @@ package RT::Extension::ResetPassword;
use strict;
use warnings;
-our $VERSION = '1.03';
+our $VERSION = '1.04';
=head1 NAME
@@ -19,6 +19,10 @@ already have passwords reset their passwords by email.
There isn't yet an option to only allow privileged or unpriviliged users
to reset their passwords.
+=head1 RT VERSION
+
+Works with RT 4.0, 4.2, 4.4
+
=head1 INSTALLATION
=over
@@ -67,6 +71,14 @@ If you are upgrading from version 0.05, you will need to run C<make
initdb> as documented in L<INSTALLATION> to install the Template used by
this Extension.
+To run on RT 4.0 or 4.2, replace this line in the template:
+
+ { RT::Interface::Web::RequestENV('REMOTE_ADDR') }
+
+with this:
+
+ { $ENV{'REMOTE_ADDR'} }
+
=head1 CONFIGURATION
The contents of the email sent to users can be found in the global
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list