[Bps-public-commit] rt-extension-resetpassword branch, master, updated. 0.05-21-g249bd0e

Kevin Falcone falcone at bestpractical.com
Mon Mar 10 17:20:28 EDT 2014


The branch, master has been updated
       via  249bd0e36275bed3479a8073761a26cef64ce81a (commit)
       via  69f8d08d65da6284fb58fe65a81359f5bf2b5411 (commit)
       via  64be11909082fa0d1217a513f48cbf03e8cd59e7 (commit)
       via  bca607ac6b8a50cb04a821e512bd2a2c3ead3517 (commit)
       via  13ed7d312e4f035e814a57ab1a3d734490ff3bb8 (commit)
       via  6d8c701efb02c1dc5eee8bb1f014b81aeb898326 (commit)
       via  49cb4e91f86f9357ca205ed6d8fcbe8e88bd0266 (commit)
       via  3885ec4056979bfb353acc8ce85d59fed191eb0d (commit)
       via  4b703c122227e00e4945e3ff542319b8e461ffcc (commit)
       via  ce90d96b4e4999dd5774ef3920cc306bf60cb237 (commit)
       via  caac36b62cf54bcde79ca7530f4b177daae15294 (commit)
       via  9dbeab6fe8fadeaa5aa7d1085f1e0e34dbc0c5dd (commit)
       via  c7bebc695074eb4add0293bfcbdb9aa9e145e743 (commit)
       via  03093a7be5f5210f26382eb6fed5b693fb25ea12 (commit)
       via  059766dc42822aaf22929c428e1b188ce08b2507 (commit)
       via  ee9b9f3c6f973c0c32b45bad1b21f6a893638f79 (commit)
       via  27328d4862346acf1a17fd7e4751195626282a4d (commit)
       via  5d29dab2e9f2144fd87d76df3cafd4bbe3e61a0a (commit)
      from  cb9a4b5add50313aa737254151f616626899fb58 (commit)

Summary of changes:
 Changes                                  |  21 ++++++
 MANIFEST                                 |   3 +
 MANIFEST.SKIP                            |   4 +-
 META.yml                                 |  13 ++--
 Makefile.PL                              |   2 -
 README                                   |  69 ++++++++++++++-----
 etc/initialdata                          |  17 +++++
 html/NoAuth/ResetPassword/Request.html   |  59 ++++++++--------
 html/NoAuth/ResetPassword/Reset/dhandler |   2 +-
 inc/Module/Install.pm                    |   4 +-
 inc/Module/Install/Base.pm               |   2 +-
 inc/Module/Install/Can.pm                |  85 +++++++++++++++++++++--
 inc/Module/Install/Fetch.pm              |   2 +-
 inc/Module/Install/Makefile.pm           |  22 +++---
 inc/Module/Install/ManifestSkip.pm       |   4 +-
 inc/Module/Install/Metadata.pm           |   2 +-
 inc/Module/Install/RTx.pm                | 106 ++++++++++++++---------------
 inc/Module/Install/RTx/Factory.pm        |  53 +++++++++++++++
 inc/Module/Install/ReadmeFromPod.pm      | 112 ++++++++++++++++++++++++++++---
 inc/Module/Install/Win32.pm              |   2 +-
 inc/Module/Install/WriteAll.pm           |   2 +-
 lib/RT/Extension/ResetPassword.pm        |  82 +++++++++++++++++-----
 22 files changed, 508 insertions(+), 160 deletions(-)
 create mode 100644 Changes
 create mode 100644 etc/initialdata
 create mode 100644 inc/Module/Install/RTx/Factory.pm

- Log -----------------------------------------------------------------
commit 5d29dab2e9f2144fd87d76df3cafd4bbe3e61a0a
Author: Christian Loos <cloos at netcologne.de>
Date:   Wed Jul 24 17:18:38 2013 +0200

    update Module::Install and friends

diff --git a/MANIFEST.SKIP b/MANIFEST.SKIP
index 4011cb8..9dd42b9 100644
--- a/MANIFEST.SKIP
+++ b/MANIFEST.SKIP
@@ -56,7 +56,7 @@
 ^\.vimrc$
 
 # OS X
-^\.DS_Store$
+\.DS_Store$
 ^\.Trash/
 \B\._
 
@@ -75,6 +75,8 @@
 ^.devel-local$
 ^out$
 ^tmon.out$
+^old/
+^Old/
 
 # Author Notes
 ^notes
diff --git a/inc/Module/Install.pm b/inc/Module/Install.pm
index c685ca4..4ecf46b 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.04';
+	$VERSION = '1.06';
 
 	# Storage for the pseudo-singleton
 	$MAIN    = undef;
@@ -467,4 +467,4 @@ sub _CLASS ($) {
 
 1;
 
-# Copyright 2008 - 2011 Adam Kennedy.
+# Copyright 2008 - 2012 Adam Kennedy.
diff --git a/inc/Module/Install/Base.pm b/inc/Module/Install/Base.pm
index b520616..802844a 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.04';
+	$VERSION = '1.06';
 }
 
 # Suspend handler for "redefined" warnings
diff --git a/inc/Module/Install/Can.pm b/inc/Module/Install/Can.pm
index a162ad4..22167b8 100644
--- a/inc/Module/Install/Can.pm
+++ b/inc/Module/Install/Can.pm
@@ -3,13 +3,12 @@ package Module::Install::Can;
 
 use strict;
 use Config                ();
-use File::Spec            ();
 use ExtUtils::MakeMaker   ();
 use Module::Install::Base ();
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '1.04';
+	$VERSION = '1.06';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
@@ -29,7 +28,7 @@ sub can_use {
 	eval { require $mod; $pkg->VERSION($ver || 0); 1 };
 }
 
-# check if we can run some command
+# Check if we can run some command
 sub can_run {
 	my ($self, $cmd) = @_;
 
@@ -38,14 +37,88 @@ sub can_run {
 
 	for my $dir ((split /$Config::Config{path_sep}/, $ENV{PATH}), '.') {
 		next if $dir eq '';
-		my $abs = File::Spec->catfile($dir, $_[1]);
+		require File::Spec;
+		my $abs = File::Spec->catfile($dir, $cmd);
 		return $abs if (-x $abs or $abs = MM->maybe_command($abs));
 	}
 
 	return;
 }
 
-# can we locate a (the) C compiler
+# Can our C compiler environment build XS files
+sub can_xs {
+	my $self = shift;
+
+	# Ensure we have the CBuilder module
+	$self->configure_requires( 'ExtUtils::CBuilder' => 0.27 );
+
+	# Do we have the configure_requires checker?
+	local $@;
+	eval "require ExtUtils::CBuilder;";
+	if ( $@ ) {
+		# They don't obey configure_requires, so it is
+		# someone old and delicate. Try to avoid hurting
+		# them by falling back to an older simpler test.
+		return $self->can_cc();
+	}
+
+	# Do we have a working C compiler
+	my $builder = ExtUtils::CBuilder->new(
+		quiet => 1,
+	);
+	unless ( $builder->have_compiler ) {
+		# No working C compiler
+		return 0;
+	}
+
+	# Write a C file representative of what XS becomes
+	require File::Temp;
+	my ( $FH, $tmpfile ) = File::Temp::tempfile(
+		"compilexs-XXXXX",
+		SUFFIX => '.c',
+	);
+	binmode $FH;
+	print $FH <<'END_C';
+#include "EXTERN.h"
+#include "perl.h"
+#include "XSUB.h"
+
+int main(int argc, char **argv) {
+    return 0;
+}
+
+int boot_sanexs() {
+    return 1;
+}
+
+END_C
+	close $FH;
+
+	# Can the C compiler access the same headers XS does
+	my @libs   = ();
+	my $object = undef;
+	eval {
+		local $^W = 0;
+		$object = $builder->compile(
+			source => $tmpfile,
+		);
+		@libs = $builder->link(
+			objects     => $object,
+			module_name => 'sanexs',
+		);
+	};
+	my $result = $@ ? 0 : 1;
+
+	# Clean up all the build files
+	foreach ( $tmpfile, $object, @libs ) {
+		next unless defined $_;
+		1 while unlink;
+	}
+
+	return $result;
+}
+
+# Can we locate a (the) C compiler
 sub can_cc {
 	my $self   = shift;
 	my @chunks = split(/ /, $Config::Config{cc}) or return;
@@ -78,4 +151,4 @@ if ( $^O eq 'cygwin' ) {
 
 __END__
 
-#line 156
+#line 236
diff --git a/inc/Module/Install/Fetch.pm b/inc/Module/Install/Fetch.pm
index a412576..bee0c4f 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.04';
+	$VERSION = '1.06';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
diff --git a/inc/Module/Install/Makefile.pm b/inc/Module/Install/Makefile.pm
index 035cef2..7052f36 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.04';
+	$VERSION = '1.06';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
@@ -215,13 +215,17 @@ sub write {
 	require ExtUtils::MakeMaker;
 
 	if ( $perl_version and $self->_cmp($perl_version, '5.006') >= 0 ) {
-		# MakeMaker can complain about module versions that include
-		# an underscore, even though its own version may contain one!
-		# Hence the funny regexp to get rid of it.  See RT #35800
-		# for details.
-		my ($v) = $ExtUtils::MakeMaker::VERSION =~ /^(\d+\.\d+)/;
-		$self->build_requires(     'ExtUtils::MakeMaker' => $v );
-		$self->configure_requires( 'ExtUtils::MakeMaker' => $v );
+		# This previous attempted to inherit the version of
+		# ExtUtils::MakeMaker in use by the module author, but this
+		# was found to be untenable as some authors build releases
+		# using future dev versions of EU:MM that nobody else has.
+		# Instead, #toolchain suggests we use 6.59 which is the most
+		# stable version on CPAN at time of writing and is, to quote
+		# ribasushi, "not terminally fucked, > and tested enough".
+		# TODO: We will now need to maintain this over time to push
+		# the version up as new versions are released.
+		$self->build_requires(     'ExtUtils::MakeMaker' => 6.59 );
+		$self->configure_requires( 'ExtUtils::MakeMaker' => 6.59 );
 	} else {
 		# Allow legacy-compatibility with 5.005 by depending on the
 		# most recent EU:MM that supported 5.005.
@@ -411,4 +415,4 @@ sub postamble {
 
 __END__
 
-#line 540
+#line 544
diff --git a/inc/Module/Install/ManifestSkip.pm b/inc/Module/Install/ManifestSkip.pm
index 6892781..739379f 100644
--- a/inc/Module/Install/ManifestSkip.pm
+++ b/inc/Module/Install/ManifestSkip.pm
@@ -9,7 +9,7 @@
 # - Module::Manifest::Skip
 
 package Module::Install::ManifestSkip;
-use 5.008003;
+use 5.008001;
 use strict;
 use warnings;
 
@@ -19,7 +19,7 @@ my $requires = "
 use Module::Manifest::Skip 0.10 ();
 ";
 
-our $VERSION = '0.19';
+our $VERSION = '0.20';
 our $AUTHOR_ONLY = 1;
 
 my $skip_file = "MANIFEST.SKIP";
diff --git a/inc/Module/Install/Metadata.pm b/inc/Module/Install/Metadata.pm
index 31c953e..58430f3 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.04';
+	$VERSION = '1.06';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
diff --git a/inc/Module/Install/RTx.pm b/inc/Module/Install/RTx.pm
index 73b9cda..c9fe996 100644
--- a/inc/Module/Install/RTx.pm
+++ b/inc/Module/Install/RTx.pm
@@ -8,13 +8,13 @@ no warnings 'once';
 
 use Module::Install::Base;
 use base 'Module::Install::Base';
-our $VERSION = '0.29';
+our $VERSION = '0.31';
 
 use FindBin;
 use File::Glob     ();
 use File::Basename ();
 
-my @DIRS = qw(etc lib html bin sbin po var);
+my @DIRS = qw(etc lib html static bin sbin po var);
 my @INDEX_DIRS = qw(lib bin sbin);
 
 sub RTx {
@@ -62,10 +62,11 @@ sub RTx {
     unshift @INC, "$RT::LocalPath/lib" if $RT::LocalPath;
     unshift @INC, $lib_path;
 
-    $RT::LocalVarPath  ||= $RT::VarPath;
-    $RT::LocalPoPath   ||= $RT::LocalLexiconPath;
-    $RT::LocalHtmlPath ||= $RT::MasonComponentRoot;
-    $RT::LocalLibPath  ||= "$RT::LocalPath/lib";
+    $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 }
@@ -129,18 +130,7 @@ install ::
 
     my %has_etc;
     if ( File::Glob::bsd_glob("$FindBin::Bin/etc/schema.*") ) {
-
-        # got schema, load factory module
         $has_etc{schema}++;
-        $self->load('RTxFactory');
-        $self->postamble(<< ".");
-factory ::
-\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Minc::Module::Install -e"RTxFactory(qw($RTx $name))"
-
-dropdb ::
-\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Minc::Module::Install -e"RTxFactory(qw($RTx $name drop))"
-
-.
     }
     if ( File::Glob::bsd_glob("$FindBin::Bin/etc/acl.*") ) {
         $has_etc{acl}++;
@@ -164,28 +154,19 @@ dropdb ::
         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))"
+\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Minc::Module::Install -e"RTxInitDB(qw(schema \$(NAME) \$(VERSION)))"
 .
         $initdb .= <<"." if $has_etc{acl};
-\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Minc::Module::Install -e"RTxInitDB(qw(acl))"
+\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Minc::Module::Install -e"RTxInitDB(qw(acl \$(NAME) \$(VERSION)))"
 .
         $initdb .= <<"." if $has_etc{initialdata};
-\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Minc::Module::Install -e"RTxInitDB(qw(insert))"
+\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Minc::Module::Install -e"RTxInitDB(qw(insert \$(NAME) \$(VERSION)))"
 .
         $self->postamble("initdb ::\n$initdb\n");
         $self->postamble("initialize-database ::\n$initdb\n");
     }
 }
 
-sub RTxInit {
-    unshift @INC, substr( delete( $INC{'RT.pm'} ), 0, -5 ) if $INC{'RT.pm'};
-    require RT;
-    RT::LoadConfig();
-    RT::ConnectToDatabase();
-
-    die "Cannot load RT" unless $RT::Handle and $RT::DatabaseType;
-}
-
 # stolen from RT::Handle so we work on 3.6 (cmp_versions came in with 3.8)
 { my %word = (
     a     => -4,
@@ -228,4 +209,4 @@ sub requires_rt {
 
 __END__
 
-#line 348
+#line 329
diff --git a/inc/Module/Install/RTx/Factory.pm b/inc/Module/Install/RTx/Factory.pm
new file mode 100644
index 0000000..76ab761
--- /dev/null
+++ b/inc/Module/Install/RTx/Factory.pm
@@ -0,0 +1,46 @@
+#line 1
+package Module::Install::RTx::Factory;
+use Module::Install::Base; @ISA = qw(Module::Install::Base);
+
+use strict;
+use File::Basename ();
+
+sub RTxInitDB {
+    my ($self, $action, $name, $version) = @_;
+
+    unshift @INC, substr(delete($INC{'RT.pm'}), 0, -5) if $INC{'RT.pm'};
+
+    require RT;
+    unshift @INC, "$RT::LocalPath/lib" if $RT::LocalPath;
+
+    $RT::SbinPath ||= $RT::LocalPath;
+    $RT::SbinPath =~ s/local$/sbin/;
+
+    foreach my $file ($RT::CORE_CONFIG_FILE, $RT::SITE_CONFIG_FILE) {
+        next if !-e $file or -r $file;
+        die "No permission to read $file\n-- please re-run $0 with suitable privileges.\n";
+    }
+
+    RT::LoadConfig();
+
+    require RT::System;
+
+    my $lib_path = File::Basename::dirname($INC{'RT.pm'});
+    my @args = ("-Ilib");
+    push @args, "-I$RT::LocalPath/lib" if $RT::LocalPath;
+    push @args, (
+        "-I$lib_path",
+        "$RT::SbinPath/rt-setup-database",
+        "--action"      => $action,
+        "--datadir"     => "etc",
+        (($action eq 'insert') ? ("--datafile"    => "etc/initialdata") : ()),
+        "--dba"         => $RT::DatabaseAdmin || $RT::DatabaseUser,
+        "--prompt-for-dba-password" => '',
+        (RT::System->can('AddUpgradeHistory') ? ("--package" => $name, "--ext-version" => $version) : ()),
+    );
+
+    print "$^X @args\n";
+    (system($^X, @args) == 0) or die "...returned with error: $?\n";
+}
+
+1;
diff --git a/inc/Module/Install/ReadmeFromPod.pm b/inc/Module/Install/ReadmeFromPod.pm
index 348531e..6a80818 100644
--- a/inc/Module/Install/ReadmeFromPod.pm
+++ b/inc/Module/Install/ReadmeFromPod.pm
@@ -7,29 +7,119 @@ use warnings;
 use base qw(Module::Install::Base);
 use vars qw($VERSION);
 
-$VERSION = '0.12';
+$VERSION = '0.20';
 
 sub readme_from {
   my $self = shift;
   return unless $self->is_admin;
 
-  my $file = shift || $self->_all_from
+  # Input file
+  my $in_file  = shift || $self->_all_from
     or die "Can't determine file to make readme_from";
-  my $clean = shift;
 
-  print "Writing README from $file\n";
+  # Get optional arguments
+  my ($clean, $format, $out_file, $options);
+  my $args = shift;
+  if ( ref $args ) {
+    # Arguments are in a hashref
+    if ( ref($args) ne 'HASH' ) {
+      die "Expected a hashref but got a ".ref($args)."\n";
+    } else {
+      $clean    = $args->{'clean'};
+      $format   = $args->{'format'};
+      $out_file = $args->{'output_file'};
+      $options  = $args->{'options'};
+    }
+  } else {
+    # Arguments are in a list
+    $clean    = $args;
+    $format   = shift;
+    $out_file = shift;
+    $options  = \@_;
+  }
+
+  # Default values;
+  $clean  ||= 0;
+  $format ||= 'txt';
+
+  # Generate README
+  print "readme_from $in_file to $format\n";
+  if ($format =~ m/te?xt/) {
+    $out_file = $self->_readme_txt($in_file, $out_file, $options);
+  } elsif ($format =~ m/html?/) {
+    $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 'pdf') {
+    $out_file = $self->_readme_pdf($in_file, $out_file, $options);
+  }
 
-  require Pod::Text;
-  my $parser = Pod::Text->new();
-  open README, '> README' or die "$!\n";
-  $parser->output_fh( *README );
-  $parser->parse_file( $file );
   if ($clean) {
-    $self->clean_files('README');
+    $self->clean_files($out_file);
   }
+
   return 1;
 }
 
+
+sub _readme_txt {
+  my ($self, $in_file, $out_file, $options) = @_;
+  $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";
+  $parser->output_fh( *$out_fh );
+  $parser->parse_file( $in_file );
+  close $out_fh;
+  return $out_file;
+}
+
+
+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,
+  );
+  # Remove temporary files if needed
+  for my $file ('pod2htmd.tmp', 'pod2htmi.tmp') {
+    if (-e $file) {
+      unlink $file or warn "Warning: Could not remove file '$file'.\n$!\n";
+    }
+  }
+  return $out_file;
+}
+
+
+sub _readme_man {
+  my ($self, $in_file, $out_file, $options) = @_;
+  $out_file ||= 'README.1';
+  require Pod::Man;
+  my $parser = Pod::Man->new( @$options );
+  $parser->parse_from_file($in_file, $out_file);
+  return $out_file;
+}
+
+
+sub _readme_pdf {
+  my ($self, $in_file, $out_file, $options) = @_;
+  $out_file ||= 'README.pdf';
+  eval { require App::pod2pdf; }
+    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;
+  return $out_file;
+}
+
+
 sub _all_from {
   my $self = shift;
   return unless $self->admin->{extensions};
@@ -44,5 +134,5 @@ sub _all_from {
 
 __END__
 
-#line 112
+#line 254
 
diff --git a/inc/Module/Install/Win32.pm b/inc/Module/Install/Win32.pm
index 99d9631..eeaa3fe 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.04';
+	$VERSION = '1.06';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
diff --git a/inc/Module/Install/WriteAll.pm b/inc/Module/Install/WriteAll.pm
index 86bb25e..85d8018 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.04';
+	$VERSION = '1.06';
 	@ISA     = qw{Module::Install::Base};
 	$ISCORE  = 1;
 }

commit 27328d4862346acf1a17fd7e4751195626282a4d
Author: Christian Loos <cloos at netcologne.de>
Date:   Wed Jul 24 17:39:19 2013 +0200

    add template for password reset token email

diff --git a/etc/initialdata b/etc/initialdata
new file mode 100644
index 0000000..a16003d
--- /dev/null
+++ b/etc/initialdata
@@ -0,0 +1,17 @@
+ at Templates = (
+    { Queue       => '0',
+      Name        => 'PasswordReset',
+      Description => 'Send user an password reset token',
+      Content     => 'Subject: RT Password Reset Request
+
+Greetings,
+
+Someone at { $ENV{\'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.
+
+To reset your password, click on the following URL and enter your new password:
+
+{ RT->Config->Get(\'WebURL\') }NoAuth/ResetPassword/Reset/{ $Token }/{ $User->id }',
+    },
+);

commit ee9b9f3c6f973c0c32b45bad1b21f6a893638f79
Author: Christian Loos <cloos at netcologne.de>
Date:   Wed Jul 24 17:40:45 2013 +0200

    add instructions to run 'make initdb'

diff --git a/lib/RT/Extension/ResetPassword.pm b/lib/RT/Extension/ResetPassword.pm
index c761a8d..a8055a3 100644
--- a/lib/RT/Extension/ResetPassword.pm
+++ b/lib/RT/Extension/ResetPassword.pm
@@ -20,6 +20,7 @@ To install this extension:
 
     perl Makefile.PL
     make install
+    make initdb # first time only, not on upgrades
 
 If you are running RT 3.8 or later, you must add RT-Extension-
 ResetPassword to your @Plugins in your RT_SiteConfig

commit 059766dc42822aaf22929c428e1b188ce08b2507
Author: Christian Loos <cloos at netcologne.de>
Date:   Wed Jul 24 17:42:04 2013 +0200

    use template instead of static text for email

diff --git a/html/NoAuth/ResetPassword/Request.html b/html/NoAuth/ResetPassword/Request.html
index 3afa02d..88628f1 100644
--- a/html/NoAuth/ResetPassword/Request.html
+++ b/html/NoAuth/ResetPassword/Request.html
@@ -68,24 +68,22 @@ if ($ARGS{'Email'} ) {
     my $token = Digest::MD5->new()->add( $u->id, $u->__Value('Password'),
     $RT::DatabasePassword, $u->LastUpdated, @{[$RT::WebPath]} . '/NoAuth/ResetPassword/Reset')->hexdigest();
 
-    my $msg = <<EOF;
-Greetings,
+    my ($status, $msg) = RT::Interface::Email::SendEmailUsingTemplate(
+        To        => $u->EmailAddress,
+        Template  => 'PasswordReset',
+        Arguments => {
+            Token => $token,
+            User  => $u,
+        },
+    );
 
-Someone at @{[$ENV{'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.
-
-To reset your password, click on the following URL and enter your new password:
-
-@{[$RT::WebURL]}/NoAuth/ResetPassword/Reset/@{[$token]}/@{[$u->id]}
-
-
-EOF
-
-RT::Interface::Email::MailError( To => $u->EmailAddress, From => $RT::OwnerEmail, Subject => 'RT Password Reset Request', Explanation => $msg, LogLevel=> 'info');
-
-
-push @actions, loc("RT has sent you an email message with instructions about how to reset your password");
+    if ($status) {
+        push @actions, loc("RT has sent you an email message with instructions about how to reset your password");
+        RT->Logger->info("Password reset token send to " . $u->EmailAddress);
+    } else {
+        push @actions, loc("Failed to send password reset token, please contact your RT administrator.");
+        RT->Logger->error("Failed to send password reset token to " . $u->EmailAddress . ": $msg");
+    }
 } elsif ($u->id and $u->Disabled) {
 push @actions, loc("You can't reset your password because your user is disabled.");
 } elsif ($u->id) {

commit 03093a7be5f5210f26382eb6fed5b693fb25ea12
Author: Christian Loos <cloos at netcologne.de>
Date:   Wed Jul 24 17:55:26 2013 +0200

    code cleanups, no functional change
    
    fix indentation, line breaks and whitespace

diff --git a/html/NoAuth/ResetPassword/Request.html b/html/NoAuth/ResetPassword/Request.html
index 88628f1..65832b9 100644
--- a/html/NoAuth/ResetPassword/Request.html
+++ b/html/NoAuth/ResetPassword/Request.html
@@ -61,37 +61,40 @@ my @actions;
 
 my $title = loc("Reset your password");
 
-if ($ARGS{'Email'} ) {
+if ($ARGS{'Email'}) {
     my $u = RT::User->new($RT::SystemUser);
     $u->LoadByCols(EmailAddress => $ARGS{'Email'});
     if ($u->id and $u->HasPassword and not $u->Disabled) {
-    my $token = Digest::MD5->new()->add( $u->id, $u->__Value('Password'),
-    $RT::DatabasePassword, $u->LastUpdated, @{[$RT::WebPath]} . '/NoAuth/ResetPassword/Reset')->hexdigest();
+        my $token = Digest::MD5->new()->add(
+            $u->id,
+            $u->__Value('Password'),
+            $RT::DatabasePassword,
+            $u->LastUpdated,
+            @{[$RT::WebPath]} . '/NoAuth/ResetPassword/Reset'
+        )->hexdigest();
 
-    my ($status, $msg) = RT::Interface::Email::SendEmailUsingTemplate(
-        To        => $u->EmailAddress,
-        Template  => 'PasswordReset',
-        Arguments => {
-            Token => $token,
-            User  => $u,
-        },
-    );
+        my ($status, $msg) = RT::Interface::Email::SendEmailUsingTemplate(
+            To        => $u->EmailAddress,
+            Template  => 'PasswordReset',
+            Arguments => {
+                Token => $token,
+                User  => $u,
+            },
+        );
 
-    if ($status) {
-        push @actions, loc("RT has sent you an email message with instructions about how to reset your password");
-        RT->Logger->info("Password reset token send to " . $u->EmailAddress);
+        if ($status) {
+            push @actions, loc("RT has sent you an email message with instructions about how to reset your password");
+            RT->Logger->info("Password reset token send to " . $u->EmailAddress);
+        } else {
+            push @actions, loc("Failed to send password reset token, please contact your RT administrator.");
+            RT->Logger->error("Failed to send password reset token to " . $u->EmailAddress . ": $msg");
+        }
+    } elsif ($u->id and $u->Disabled) {
+        push @actions, loc("You can't reset your password because your user is disabled.");
+    } elsif ($u->id) {
+        push @actions, loc("You can't reset your password as you don't already have one.");
     } else {
-        push @actions, loc("Failed to send password reset token, please contact your RT administrator.");
-        RT->Logger->error("Failed to send password reset token to " . $u->EmailAddress . ": $msg");
+        push @actions, loc("RT couldn't find a user with that email address. Give it another try?");
     }
-} elsif ($u->id and $u->Disabled) {
-push @actions, loc("You can't reset your password because your user is disabled.");
-} elsif ($u->id) {
-push @actions, loc("You can't reset your password as you don't already have one.");
-} else {
-push @actions, loc("RT couldn't find a user with that email address. Give it another try?");
-
-}
 }
-
 </%INIT>

commit c7bebc695074eb4add0293bfcbdb9aa9e145e743
Author: Christian Loos <cloos at netcologne.de>
Date:   Wed Jul 24 18:05:24 2013 +0200

    add strict and warnings pragma

diff --git a/lib/RT/Extension/ResetPassword.pm b/lib/RT/Extension/ResetPassword.pm
index a8055a3..f66d039 100644
--- a/lib/RT/Extension/ResetPassword.pm
+++ b/lib/RT/Extension/ResetPassword.pm
@@ -1,5 +1,8 @@
 package RT::Extension::ResetPassword;
 
+use strict;
+use warnings;
+
 our $VERSION = '0.05';
 
 =head1 DESCRIPTION

commit 9dbeab6fe8fadeaa5aa7d1085f1e0e34dbc0c5dd
Author: Christian Loos <cloos at netcologne.de>
Date:   Wed Jul 24 18:17:15 2013 +0200

    fix and update POD

diff --git a/META.yml b/META.yml
index a6ebebe..681c1fb 100644
--- a/META.yml
+++ b/META.yml
@@ -1,23 +1,24 @@
 ---
 abstract: 'RT Extension-ResetPassword Extension'
 author:
-  - 'Jesse Vincent <jesse at bestpractical.com>'
+  - 'Jesse Vincent <jesse at bestpractical.com>'
 build_requires:
   ExtUtils::MakeMaker: 6.36
 configure_requires:
   ExtUtils::MakeMaker: 6.36
 distribution_type: module
 dynamic_config: 1
-generated_by: 'Module::Install version 1.04'
-license: perl
+generated_by: 'Module::Install version 1.06'
+license: gpl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
   version: 1.4
 name: RT-Extension-ResetPassword
 no_index:
   directory:
+    - etc
     - html
     - inc
 resources:
-  license: http://dev.perl.org/licenses/
+  license: http://opensource.org/licenses/gpl-license.php
 version: 0.05
diff --git a/Makefile.PL b/Makefile.PL
index 9761415..dc2905f 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -1,9 +1,7 @@
 use inc::Module::Install;
 RTx('RT-Extension-ResetPassword');
-author ('Jesse Vincent <jesse at bestpractical.com>');
 readme_from('lib/RT/Extension/ResetPassword.pm');
 all_from('lib/RT/Extension/ResetPassword.pm');
-license('perl');
 
 manifest_skip;
 sign;
diff --git a/lib/RT/Extension/ResetPassword.pm b/lib/RT/Extension/ResetPassword.pm
index f66d039..b77a66c 100644
--- a/lib/RT/Extension/ResetPassword.pm
+++ b/lib/RT/Extension/ResetPassword.pm
@@ -34,10 +34,19 @@ Make sure you clear your mason cache before restarting apache
 rm -rf /opt/rt3/var/mason_data/obj/*
 apachectl restart
 
+=head1 AUTHOR
 
-Copyright 2006-2011 Best Practical Solutions, LLC. 
-This software is distributed under the same license as Perl 5.8.8.
-For commercial support, please contact sales at bestpractical.com
+Jesse Vincent <jesse at bestpractical.com>
+
+=head1 LICENSE AND COPYRIGHT
+
+Copyright 2006-2013 Best Practical Solutions, LLC.
+
+This program is free software; you can redistribute it and/or modify it
+under the terms of either: the GNU General Public License as published
+by the Free Software Foundation; or the Artistic License.
+
+See http://dev.perl.org/licenses/ for more information.
 
 =cut
 

commit caac36b62cf54bcde79ca7530f4b177daae15294
Author: Christian Loos <cloos at netcologne.de>
Date:   Wed Jul 24 18:19:45 2013 +0200

    update MANIFEST and README

diff --git a/MANIFEST b/MANIFEST
index 27017a5..361d760 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -1,3 +1,4 @@
+etc/initialdata
 html/Callbacks/RT-Extension-ResetPassword/Elements/Login/Default
 html/NoAuth/ResetPassword/Request.html
 html/NoAuth/ResetPassword/Reset/dhandler
@@ -10,6 +11,7 @@ inc/Module/Install/ManifestSkip.pm
 inc/Module/Install/Metadata.pm
 inc/Module/Install/ReadmeFromPod.pm
 inc/Module/Install/RTx.pm
+inc/Module/Install/RTx/Factory.pm
 inc/Module/Install/Win32.pm
 inc/Module/Install/WriteAll.pm
 lib/RT/Extension/ResetPassword.pm
diff --git a/README b/README
index fda607a..6516811 100644
--- a/README
+++ b/README
@@ -3,8 +3,9 @@ DESCRIPTION
     front of your RT instance. Any user can request that RT send them a
     password reset token by email. RT will send the user a one-time URL
     which he or she can use to reset her password. This extension allows
-    _all_ users to reset their passwords by email. There isn't yet an option
-    to only allow staff users or non-staff users to reset their passwords.
+    only users that 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.
 
 INSTALL
     This extension should be compatible with RT 3.4 and later
@@ -13,6 +14,7 @@ INSTALL
 
         perl Makefile.PL
         make install
+        make initdb # first time only, not on upgrades
 
     If you are running RT 3.8 or later, you must add RT-Extension-
     ResetPassword to your @Plugins in your RT_SiteConfig
@@ -22,7 +24,15 @@ INSTALL
     Make sure you clear your mason cache before restarting apache rm -rf
     /opt/rt3/var/mason_data/obj/* apachectl restart
 
-    Copyright 2006-2011 Best Practical Solutions, LLC. This software is
-    distributed under the same license as Perl 5.8.8. For commercial
-    support, please contact sales at bestpractical.com
+AUTHOR
+    Jesse Vincent <jesse at bestpractical.com>
+
+LICENSE AND COPYRIGHT
+    Copyright 2006-2013 Best Practical Solutions, LLC.
+
+    This program is free software; you can redistribute it and/or modify it
+    under the terms of either: the GNU General Public License as published
+    by the Free Software Foundation; or the Artistic License.
+
+    See http://dev.perl.org/licenses/ for more information.
 

commit ce90d96b4e4999dd5774ef3920cc306bf60cb237
Author: Christian Loos <cloos at netcologne.de>
Date:   Wed Jul 24 18:25:46 2013 +0200

    use same wording as in other places

diff --git a/html/NoAuth/ResetPassword/Reset/dhandler b/html/NoAuth/ResetPassword/Reset/dhandler
index 3847e00..ad19b0a 100644
--- a/html/NoAuth/ResetPassword/Reset/dhandler
+++ b/html/NoAuth/ResetPassword/Reset/dhandler
@@ -68,7 +68,7 @@ else {
     <td class="value"><input name="password" type="password"></td>
   </tr>
   <tr>
-    <td class="label"><label name="password2"><&|/l&>Once more</&>:</label></td>
+    <td class="label"><label name="password2"><&|/l&>Retype Password</&>:</label></td>
     <td class="value"><input name="password2" type="password"></td>
   </tr>
 </table>

commit 4b703c122227e00e4945e3ff542319b8e461ffcc
Author: Neil Bowers <neil at bowers.com>
Date:   Fri Mar 7 23:47:04 2014 +0000

    Add Changes file

diff --git a/Changes b/Changes
new file mode 100644
index 0000000..8debd82
--- /dev/null
+++ b/Changes
@@ -0,0 +1,18 @@
+Revision history for Perl module RT::Extension::ResetPassword
+
+0.06
+    - Added Changes file, populated from git log comments
+
+0.05 2012-02-07
+    - password reset only for user with password
+    - don't allow requests for disabled users
+
+0.04 2011-09-19
+    - Add a gitignore and move README into lib
+    - Update MI::RTx
+      This avoids needing RTHOME or a prompt to install on RT4
+    - mention RT4
+
+0.03 2009-06-24
+    - First release to CPAN
+

commit 3885ec4056979bfb353acc8ce85d59fed191eb0d
Author: Neil Bowers <neil at bowers.com>
Date:   Fri Mar 7 23:47:44 2014 +0000

    Added pod abstract

diff --git a/Changes b/Changes
index 8debd82..60bf3e9 100644
--- a/Changes
+++ b/Changes
@@ -1,6 +1,7 @@
 Revision history for Perl module RT::Extension::ResetPassword
 
 0.06
+    - Added pod abstract (which MetaCPAN, search.cpan.org, etc expect to find)
     - Added Changes file, populated from git log comments
 
 0.05 2012-02-07
diff --git a/lib/RT/Extension/ResetPassword.pm b/lib/RT/Extension/ResetPassword.pm
index c761a8d..fe2e265 100644
--- a/lib/RT/Extension/ResetPassword.pm
+++ b/lib/RT/Extension/ResetPassword.pm
@@ -2,6 +2,10 @@ package RT::Extension::ResetPassword;
 
 our $VERSION = '0.05';
 
+=head1 NAME
+
+RT::Extension::ResetPassword - add "forgot your password?" link to RT instance
+
 =head1 DESCRIPTION
 
 This extension for RT adds a new "Forgot your password?" link to the front

commit 49cb4e91f86f9357ca205ed6d8fcbe8e88bd0266
Merge: cb9a4b5 ce90d96
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Mon Mar 10 17:19:23 2014 -0400

    Merge branch 'use-template'


commit 6d8c701efb02c1dc5eee8bb1f014b81aeb898326
Merge: 49cb4e9 3885ec4
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Mon Mar 10 17:19:27 2014 -0400

    Merge branch 'update-changes'

diff --cc lib/RT/Extension/ResetPassword.pm
index b77a66c,fe2e265..a5a8ec0
--- a/lib/RT/Extension/ResetPassword.pm
+++ b/lib/RT/Extension/ResetPassword.pm
@@@ -1,10 -1,11 +1,14 @@@
  package RT::Extension::ResetPassword;
  
 +use strict;
 +use warnings;
 +
  our $VERSION = '0.05';
  
+ =head1 NAME
+ 
+ RT::Extension::ResetPassword - add "forgot your password?" link to RT instance
+ 
  =head1 DESCRIPTION
  
  This extension for RT adds a new "Forgot your password?" link to the front

commit 13ed7d312e4f035e814a57ab1a3d734490ff3bb8
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Mon Mar 10 12:13:40 2014 -0400

    Update MIRTx which also updated the README

diff --git a/META.yml b/META.yml
index 681c1fb..83a0a56 100644
--- a/META.yml
+++ b/META.yml
@@ -1,5 +1,5 @@
 ---
-abstract: 'RT Extension-ResetPassword Extension'
+abstract: "add \"forgot your password?\" link to RT instance"
 author:
   - 'Jesse Vincent <jesse at bestpractical.com>'
 build_requires:
diff --git a/README b/README
index 6516811..345ab0f 100644
--- a/README
+++ b/README
@@ -1,3 +1,7 @@
+NAME
+    RT::Extension::ResetPassword - add "forgot your password?" link to RT
+    instance
+
 DESCRIPTION
     This extension for RT adds a new "Forgot your password?" link to the
     front of your RT instance. Any user can request that RT send them a
diff --git a/inc/Module/Install/RTx.pm b/inc/Module/Install/RTx.pm
index c9fe996..469eb42 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.31';
+our $VERSION = '0.32_02';
 
 use FindBin;
 use File::Glob     ();
@@ -136,6 +136,9 @@ install ::
         $has_etc{acl}++;
     }
     if ( -e 'etc/initialdata' ) { $has_etc{initialdata}++; }
+    if ( grep { /\d+\.\d+\.\d+.*$/ } glob('etc/upgrade/*.*.*') ) {
+        $has_etc{upgrade}++;
+    }
 
     $self->postamble("$postamble\n");
     unless ( $subdirs{'lib'} ) {
@@ -164,49 +167,59 @@ install ::
 .
         $self->postamble("initdb ::\n$initdb\n");
         $self->postamble("initialize-database ::\n$initdb\n");
+        if ($has_etc{upgrade}) {
+            print "To upgrade from a previous version of this extension, use 'make upgrade-database'\n";
+            my $upgradedb = qq|\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Minc::Module::Install -e"RTxInitDB(qw(upgrade \$(NAME) \$(VERSION)))"\n|;
+            $self->postamble("upgrade-database ::\n$upgradedb\n");
+            $self->postamble("upgradedb ::\n$upgradedb\n");
+        }
     }
 }
 
-# stolen from RT::Handle so we work on 3.6 (cmp_versions came in with 3.8)
-{ my %word = (
-    a     => -4,
-    alpha => -4,
-    b     => -3,
-    beta  => -3,
-    pre   => -2,
-    rc    => -1,
-    head  => 9999,
-);
-sub cmp_version($$) {
-    my ($a, $b) = (@_);
-    my @a = grep defined, map { /^[0-9]+$/? $_ : /^[a-zA-Z]+$/? $word{$_}|| -10 : undef }
-        split /([^0-9]+)/, $a;
-    my @b = grep defined, map { /^[0-9]+$/? $_ : /^[a-zA-Z]+$/? $word{$_}|| -10 : undef }
-        split /([^0-9]+)/, $b;
-    @a > @b
-        ? push @b, (0) x (@a- at b)
-        : push @a, (0) x (@b- at a);
-    for ( my $i = 0; $i < @a; $i++ ) {
-        return $a[$i] <=> $b[$i] if $a[$i] <=> $b[$i];
-    }
-    return 0;
-}}
 sub requires_rt {
     my ($self,$version) = @_;
 
     # if we're exactly the same version as what we want, silently return
     return if ($version eq $RT::VERSION);
 
-    my @sorted = sort cmp_version $version,$RT::VERSION;
+    _load_rt_handle();
+    my @sorted = sort RT::Handle::cmp_version $version,$RT::VERSION;
 
     if ($sorted[-1] eq $version) {
         # should we die?
-        warn "\nWarning: prerequisite RT $version not found. Your installed version of RT ($RT::VERSION) is too old.\n\n";
+        die "\nWarning: prerequisite RT $version not found. Your installed version of RT ($RT::VERSION) is too old.\n\n";
+    }
+}
+
+sub rt_too_new {
+    my ($self,$version,$msg) = @_;
+    $msg ||= "Your version %s is too new, this extension requires a release of RT older than %s\n";
+
+    _load_rt_handle();
+    my @sorted = sort RT::Handle::cmp_version $version,$RT::VERSION;
+
+    if ($sorted[0] eq $version) {
+        die sprintf($msg,$RT::VERSION,$version);
+    }
+}
+
+# RT::Handle runs FinalizeDatabaseType which calls RT->Config->Get
+# On 3.8, this dies.  On 4.0/4.2 ->Config transparently runs LoadConfig.
+# LoadConfig requires being able to read RT_SiteConfig.pm (root) so we'd
+# like to avoid pushing that on users.
+# Fake up just enough Config to let FinalizeDatabaseType finish, and
+# anyone later calling LoadConfig will overwrite our shenanigans.
+sub _load_rt_handle {
+    unless ($RT::Config) {
+        require RT::Config;
+        $RT::Config = RT::Config->new;
+        RT->Config->Set('DatabaseType','mysql');
     }
+    require RT::Handle;
 }
 
 1;
 
 __END__
 
-#line 329
+#line 362
diff --git a/inc/Module/Install/RTx/Factory.pm b/inc/Module/Install/RTx/Factory.pm
index 76ab761..6776688 100644
--- a/inc/Module/Install/RTx/Factory.pm
+++ b/inc/Module/Install/RTx/Factory.pm
@@ -32,12 +32,19 @@ sub RTxInitDB {
         "-I$lib_path",
         "$RT::SbinPath/rt-setup-database",
         "--action"      => $action,
-        "--datadir"     => "etc",
+        ($action eq 'upgrade' ? () : ("--datadir"     => "etc")),
         (($action eq 'insert') ? ("--datafile"    => "etc/initialdata") : ()),
         "--dba"         => $RT::DatabaseAdmin || $RT::DatabaseUser,
         "--prompt-for-dba-password" => '',
         (RT::System->can('AddUpgradeHistory') ? ("--package" => $name, "--ext-version" => $version) : ()),
     );
+    # If we're upgrading against an RT which isn't at least 4.2 (has
+    # AddUpgradeHistory) then pass --package.  Upgrades against later RT
+    # releases will pick up --package from AddUpgradeHistory.
+    if ($action eq 'upgrade' and
+        not RT::System->can('AddUpgradeHistory')) {
+        push @args, "--package" => $name;
+    }
 
     print "$^X @args\n";
     (system($^X, @args) == 0) or die "...returned with error: $?\n";
diff --git a/inc/Module/Install/ReadmeFromPod.pm b/inc/Module/Install/ReadmeFromPod.pm
index 6a80818..b5e03c3 100644
--- a/inc/Module/Install/ReadmeFromPod.pm
+++ b/inc/Module/Install/ReadmeFromPod.pm
@@ -7,7 +7,7 @@ use warnings;
 use base qw(Module::Install::Base);
 use vars qw($VERSION);
 
-$VERSION = '0.20';
+$VERSION = '0.22';
 
 sub readme_from {
   my $self = shift;

commit bca607ac6b8a50cb04a821e512bd2a2c3ead3517
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Mon Mar 10 17:11:12 2014 -0400

    Update with the more modern/standard install instructions
    
    Mention the template in Upgrading and document that you can change the
    message with the template.

diff --git a/README b/README
index 345ab0f..001b5d1 100644
--- a/README
+++ b/README
@@ -11,28 +11,53 @@ DESCRIPTION
     There isn't yet an option to only allow privileged or unpriviliged users
     to reset their passwords.
 
-INSTALL
-    This extension should be compatible with RT 3.4 and later
+INSTALLATION
+    "perl Makefile.PL"
+    "make"
+    "make install"
+        May need root permissions
 
-    To install this extension:
+    "make initdb"
+        Only run this the first time you install this module.
 
-        perl Makefile.PL
-        make install
-        make initdb # first time only, not on upgrades
+        If you run this twice, you may end up with duplicate data in your
+        database.
 
-    If you are running RT 3.8 or later, you must add RT-Extension-
-    ResetPassword to your @Plugins in your RT_SiteConfig
+        If you are upgrading this module, check for upgrading instructions
+        in case changes need to be made to your database.
 
-    Set(@Plugins, qw(RT::Extension::ResetPassword Your::Other::Extensions));
+    Edit your /opt/rt4/etc/RT_SiteConfig.pm
+        If you are using RT 4.2 or greater, add this line:
 
-    Make sure you clear your mason cache before restarting apache rm -rf
-    /opt/rt3/var/mason_data/obj/* apachectl restart
+            Plugin('RT::Extension::ResetPassword');
+
+        For RT 3.8 and 4.0, add this line:
+
+            Set(@Plugins, qw(RT::Extension::ResetPassword));
+
+        or add "RT::Extension::ResetPassword" 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 version 0.05, you will need to run "make
+    initdb" as documented in INSTALLATION to install the Template used by
+    this Extension.
+
+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
+    template).
 
 AUTHOR
     Jesse Vincent <jesse at bestpractical.com>
 
 LICENSE AND COPYRIGHT
-    Copyright 2006-2013 Best Practical Solutions, LLC.
+    Copyright 2006-2014 Best Practical Solutions, LLC.
 
     This program is free software; you can redistribute it and/or modify it
     under the terms of either: the GNU General Public License as published
diff --git a/lib/RT/Extension/ResetPassword.pm b/lib/RT/Extension/ResetPassword.pm
index a5a8ec0..0c0cd17 100644
--- a/lib/RT/Extension/ResetPassword.pm
+++ b/lib/RT/Extension/ResetPassword.pm
@@ -19,24 +19,59 @@ 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 INSTALL
+=head1 INSTALLATION
 
-This extension should be compatible with RT 3.4 and later
+=over
 
-To install this extension:
+=item C<perl Makefile.PL>
 
-    perl Makefile.PL
-    make install
-    make initdb # first time only, not on upgrades
+=item C<make>
 
-If you are running RT 3.8 or later, you must add RT-Extension-
-ResetPassword to your @Plugins in your RT_SiteConfig
+=item C<make install>
 
-Set(@Plugins, qw(RT::Extension::ResetPassword Your::Other::Extensions));
+May need root permissions
 
-Make sure you clear your mason cache before restarting apache
-rm -rf /opt/rt3/var/mason_data/obj/*
-apachectl restart
+=item C<make initdb>
+
+Only run this the first time you install this module.
+
+If you run this twice, you may end up with duplicate data
+in your database.
+
+If you are upgrading this module, check for upgrading instructions
+in case changes need to be made to your database.
+
+=item Edit your F</opt/rt4/etc/RT_SiteConfig.pm>
+
+If you are using RT 4.2 or greater, add this line:
+
+    Plugin('RT::Extension::ResetPassword');
+
+For RT 3.8 and 4.0, add this line:
+
+    Set(@Plugins, qw(RT::Extension::ResetPassword));
+
+or add C<RT::Extension::ResetPassword> to your existing C<@Plugins> line.
+
+=item Clear your mason cache
+
+    rm -rf /opt/rt4/var/mason_data/obj
+
+=item Restart your webserver
+
+=back
+
+=head1 UPGRADING
+
+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.
+
+=head1 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
+template).
 
 =head1 AUTHOR
 
@@ -44,7 +79,7 @@ Jesse Vincent <jesse at bestpractical.com>
 
 =head1 LICENSE AND COPYRIGHT
 
-Copyright 2006-2013 Best Practical Solutions, LLC.
+Copyright 2006-2014 Best Practical Solutions, LLC.
 
 This program is free software; you can redistribute it and/or modify it
 under the terms of either: the GNU General Public License as published

commit 64be11909082fa0d1217a513f48cbf03e8cd59e7
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Mon Mar 10 17:14:02 2014 -0400

    Update Changes to reflect cloos' work

diff --git a/Changes b/Changes
index 60bf3e9..3f90f53 100644
--- a/Changes
+++ b/Changes
@@ -1,6 +1,8 @@
 Revision history for Perl module RT::Extension::ResetPassword
 
-0.06
+0.06 2014-03-10
+    - Switch to using a ResetPassword Template rather than a hardcoded message
+      Contributed by Christian Loos
     - Added pod abstract (which MetaCPAN, search.cpan.org, etc expect to find)
     - Added Changes file, populated from git log comments
 

commit 69f8d08d65da6284fb58fe65a81359f5bf2b5411
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Mon Mar 10 17:16:54 2014 -0400

    add Changes to MANIFEST

diff --git a/MANIFEST b/MANIFEST
index 361d760..126c578 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -1,3 +1,4 @@
+Changes
 etc/initialdata
 html/Callbacks/RT-Extension-ResetPassword/Elements/Login/Default
 html/NoAuth/ResetPassword/Request.html

commit 249bd0e36275bed3479a8073761a26cef64ce81a
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Mon Mar 10 17:14:49 2014 -0400

    bump version for 0.06

diff --git a/META.yml b/META.yml
index 83a0a56..afd93d3 100644
--- a/META.yml
+++ b/META.yml
@@ -21,4 +21,4 @@ no_index:
     - inc
 resources:
   license: http://opensource.org/licenses/gpl-license.php
-version: 0.05
+version: 0.06
diff --git a/lib/RT/Extension/ResetPassword.pm b/lib/RT/Extension/ResetPassword.pm
index 0c0cd17..e607ac3 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 = '0.05';
+our $VERSION = '0.06';
 
 =head1 NAME
 

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



More information about the Bps-public-commit mailing list