[Bps-public-commit] rt-extension-resetpassword branch, master, updated. 1.04-38-g4fed880

Jim Brandt jbrandt at bestpractical.com
Thu Dec 17 11:31:29 EST 2020


The branch, master has been updated
       via  4fed88047102152002c046be416bc97f45b03e56 (commit)
       via  4176d560d0d4ef09c04c9dd04cc2895e29c782c0 (commit)
       via  37e6831632bb0f7177e5d831da915f026c5e83b8 (commit)
       via  0c8095a8818f9ba8c17310a1012468182da430cc (commit)
       via  15490cfb4c6e0d90619f891e0654818f0d2d5c3f (commit)
       via  da6cedc62e6ff4baf5644fbc4f7a52bee782969f (commit)
      from  b2c154ba7351413982e3383f6ccd531b7bbc407c (commit)

Summary of changes:
 Changes                                            |  9 ++++++
 META.yml                                           |  5 +--
 .../Elements/Login/Default                         | 10 +++---
 html/NoAuth/ResetPassword/Request.html             |  9 +++---
 inc/Module/Install/RTx.pm                          | 36 ++++++++++++++++------
 lib/RT/Extension/ResetPassword.pm                  |  2 +-
 6 files changed, 49 insertions(+), 22 deletions(-)

- Log -----------------------------------------------------------------
commit 4176d560d0d4ef09c04c9dd04cc2895e29c782c0
Merge: b2c154b 37e6831
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Thu Dec 17 11:21:33 2020 -0500

    Merge branch 'update-rt5-styling'


commit 4fed88047102152002c046be416bc97f45b03e56
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Thu Dec 17 11:31:15 2020 -0500

    Prep version 1.07

diff --git a/Changes b/Changes
index ef72e03..2d5fb6d 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,14 @@
 Revision history for Perl module RT::Extension::ResetPassword
 
+1.07 2020-12-17
+ - Update styles for RT 5
+ - Use SHA256 instead of MD5 to generate the token
+ - Store the temporary token in a cookie rather than Referrer header
+
+1.06 [not released]
+ - Add new options for creating accounts, setting passwords if a user has none,
+   creating users as privileged, and reseting only from the user admin page.
+
 1.05 2020-02-14
  - Update Module::Install so "make initdb" could work in recent perls
 
diff --git a/META.yml b/META.yml
index f14c189..d7337f3 100644
--- a/META.yml
+++ b/META.yml
@@ -19,10 +19,11 @@ no_index:
     - etc
     - html
     - inc
+    - static
 requires:
   perl: 5.8.3
 resources:
   license: http://opensource.org/licenses/gpl-license.php
-version: '1.06'
-x_module_install_rtx_version: '0.40'
+version: '1.07'
+x_module_install_rtx_version: '0.42'
 x_requires_rt: 4.0.0
diff --git a/inc/Module/Install/RTx.pm b/inc/Module/Install/RTx.pm
index 7cad529..2dd9489 100644
--- a/inc/Module/Install/RTx.pm
+++ b/inc/Module/Install/RTx.pm
@@ -6,9 +6,10 @@ use strict;
 use warnings;
 no warnings 'once';
 
+use Term::ANSIColor qw(:constants);
 use Module::Install::Base;
 use base 'Module::Install::Base';
-our $VERSION = '0.40';
+our $VERSION = '0.42';
 
 use FindBin;
 use File::Glob     ();
@@ -53,7 +54,7 @@ sub RTx {
         my @look = @INC;
         unshift @look, grep {defined and -d $_} @try;
         push @look, grep {defined and -d $_}
-            map { ( "$_/rt4/lib", "$_/lib/rt4", "$_/lib" ) } @prefixes;
+            map { ( "$_/rt5/lib", "$_/lib/rt5", "$_/rt4/lib", "$_/lib/rt4", "$_/lib" ) } @prefixes;
         last if eval {local @INC = @look; require RT; $RT::LocalLibPath};
 
         warn
@@ -76,6 +77,22 @@ sub RTx {
         $self->requires_rt('4.0.0');
     }
 
+    my $package = $name;
+    $package =~ s/-/::/g;
+    if ( $RT::CORED_PLUGINS{$package} ) {
+        my ($base_version) = $RT::VERSION =~ /(\d+\.\d+\.\d+)/;
+        die RED, <<"EOT";
+
+**** Error: Your installed version of RT ($RT::VERSION) already
+            contains this extension in core, so you don't need to
+            install it.
+
+            Check https://docs.bestpractical.com/rt/$base_version/RT_Config.html
+            to configure it.
+
+EOT
+    }
+
     # Installation locations
     my %path;
     my $plugin_path;
@@ -223,7 +240,7 @@ sub requires_rt {
     my @sorted = sort RT::Handle::cmp_version $version,$RT::VERSION;
 
     if ($sorted[-1] eq $version) {
-        die <<"EOT";
+        die RED, <<"EOT";
 
 **** Error: This extension requires RT $version. Your installed version
             of RT ($RT::VERSION) is too old.
@@ -249,12 +266,12 @@ sub requires_rt_plugin {
         unshift @INC, $path;
     } else {
         my $name = $self->name;
-        warn <<"EOT";
+        my $msg = <<"EOT";
 
 **** Warning: $name requires that the $plugin plugin be installed and
               enabled; it does not appear to be installed.
-
 EOT
+        warn RED, $msg, RESET, "\n";
     }
     $self->requires(@_);
 }
@@ -264,9 +281,8 @@ sub rt_too_new {
     my $name = $self->name;
     $msg ||= <<EOT;
 
-**** Error: Your installed version of RT (%s) is too new; this extension
-            only works with versions older than %s.
-
+**** Warning: Your installed version of RT (%s) is too new; this extension
+              has not been tested on your version of RT and may not work as expected.
 EOT
     $self->add_metadata("x_rt_too_new", $version) if $self->is_admin;
 
@@ -274,7 +290,7 @@ EOT
     my @sorted = sort RT::Handle::cmp_version $version,$RT::VERSION;
 
     if ($sorted[0] eq $version) {
-        die sprintf($msg,$RT::VERSION,$version);
+        warn RED, sprintf($msg,$RT::VERSION), RESET, "\n";
     }
 }
 
@@ -297,4 +313,4 @@ sub _load_rt_handle {
 
 __END__
 
-#line 468
+#line 484
diff --git a/lib/RT/Extension/ResetPassword.pm b/lib/RT/Extension/ResetPassword.pm
index f740163..bce6e76 100644
--- a/lib/RT/Extension/ResetPassword.pm
+++ b/lib/RT/Extension/ResetPassword.pm
@@ -5,7 +5,7 @@ use warnings;
 
 use Digest::SHA qw(sha256_hex);
 
-our $VERSION = '1.06';
+our $VERSION = '1.07';
 
 RT->AddStyleSheets("resetpassword.css");
 

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


More information about the Bps-public-commit mailing list