[open-ils-commits] [GIT] Evergreen ILS branch master updated. 3ba2b7b83280933a36b9b24a19bf386afa8dab3f

Evergreen Git git at git.evergreen-ils.org
Thu Sep 22 01:14:23 EDT 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  3ba2b7b83280933a36b9b24a19bf386afa8dab3f (commit)
       via  5dbb9095a5ea8e83e1560c8d62b9c8e208477a66 (commit)
       via  b16adc7c6f88c59492fa37d57dceaf49b1d17b4a (commit)
      from  5708b03000eb649c0feda7d430b0096d1faebade (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 3ba2b7b83280933a36b9b24a19bf386afa8dab3f
Author: Dan Scott <dscott at laurentian.ca>
Date:   Thu Sep 22 01:11:06 2011 -0400

    Password resets: avoid run-on subjects
    
    The password reset template had a space on the first blank line after
    the Subject: which lead to the first paragraph being tacked onto the
    Subject line. Get rid of the space, and create an upgrade script ready
    to roll.
    
    Signed-off-by: Dan Scott <dscott at laurentian.ca>

diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql
index a5641e9..8b8b297 100644
--- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql
+++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql
@@ -6668,7 +6668,7 @@ $$
 To: [%- params.recipient_email || user.email %]
 From: [%- params.sender_email || user.home_ou.email || default_sender %]
 Subject: [% user.home_ou.name %]: library account password reset request
-  
+
 You have received this message because you, or somebody else, requested a reset
 of your library system password. If you did not request a reset of your library
 system password, just ignore this message and your current password will
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.patron-password-reset-msg.sql b/Open-ILS/src/sql/Pg/upgrade/0627.data.patron-password-reset-msg.sql
similarity index 86%
rename from Open-ILS/src/sql/Pg/upgrade/XXXX.data.patron-password-reset-msg.sql
rename to Open-ILS/src/sql/Pg/upgrade/0627.data.patron-password-reset-msg.sql
index 7eb3bfc..05af6a4 100644
--- a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.patron-password-reset-msg.sql
+++ b/Open-ILS/src/sql/Pg/upgrade/0627.data.patron-password-reset-msg.sql
@@ -1,12 +1,11 @@
--- Evergreen DB patch XXXX.data.patron-password-reset-msg.sql
+-- Evergreen DB patch 0627.data.patron-password-reset-msg.sql
 --
--- FIXME: insert description of change, if needed
+-- Updates password reset template to match TPAC reset form
 --
 BEGIN;
 
-
 -- check whether patch can be applied
-SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+SELECT evergreen.upgrade_deps_block_check('0627', :eg_version);
 
 UPDATE action_trigger.event_definition SET template = 
 $$
@@ -15,7 +14,7 @@ $$
 To: [%- params.recipient_email || user.email %]
 From: [%- params.sender_email || user.home_ou.email || default_sender %]
 Subject: [% user.home_ou.name %]: library account password reset request
-  
+
 You have received this message because you, or somebody else, requested a reset
 of your library system password. If you did not request a reset of your library
 system password, just ignore this message and your current password will

commit 5dbb9095a5ea8e83e1560c8d62b9c8e208477a66
Author: Bill Erickson <berick at esilibrary.com>
Date:   Tue Sep 20 10:43:58 2011 -0400

    TPac: password reset honors success/error style
    
    Signed-off-by: Bill Erickson <berick at esilibrary.com>
    Signed-off-by: Dan Scott <dscott at laurentian.ca>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm
index 63caca7..fbcc8e7 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm
@@ -1598,7 +1598,7 @@ sub load_password_reset {
 
         } else { # 2 password values needed
 
-            $ctx->{pwreset} = {style => 'error', status => 'TWO_PASSWORDS'};
+            $ctx->{pwreset} = {status => 'TWO_PASSWORDS'};
         }
 
     } elsif ($barcode or $username) {
@@ -1609,7 +1609,7 @@ sub load_password_reset {
             'open-ils.actor', 
             'open-ils.actor.patron.password_reset.request', @params);
 
-        $ctx->{pwreset} = {style => 'plain', status => 'REQUEST_SUCCESS'};
+        $ctx->{pwreset} = {status => 'REQUEST_SUCCESS'};
     }
 
     $logger->info("patron password reset resulted in " . Dumper($ctx->{pwreset}));
diff --git a/Open-ILS/src/templates/opac/password_reset.tt2 b/Open-ILS/src/templates/opac/password_reset.tt2
index bc35a64..b0533ac 100644
--- a/Open-ILS/src/templates/opac/password_reset.tt2
+++ b/Open-ILS/src/templates/opac/password_reset.tt2
@@ -16,7 +16,7 @@
         NO_MATCH => l('Passwords did not match. Please try again'),
         NOT_ACTIVE => l('This was not an active password reset request. Your password has not been reset.'),
         NOT_STRONG => l('The password you chose was not considered complex enough to protect your account. Your password has not been reset.'),
-        TWO_PASSWORDS => l('Please enter your password twice'),
+        TWO_PASSWORDS => l('Please enter and repeat your new password.'),
         REQUEST_SUCCESS => l('Your user name or barcode has been submitted for a password reset. ' _ 
             'If a matching account with an email address is found, you will soon receive an email at that address with further instructions for resetting your password.')
     }
diff --git a/Open-ILS/web/css/skin/default/opac/style.css b/Open-ILS/web/css/skin/default/opac/style.css
index 80e1766..226e4b9 100644
--- a/Open-ILS/web/css/skin/default/opac/style.css
+++ b/Open-ILS/web/css/skin/default/opac/style.css
@@ -1030,3 +1030,6 @@ a.opac-button {
 
 
 .bookbag-item-row td { vertical-align: top; }
+
+.error { color: red; font-weight: bold; }
+.success { color: green; font-weight: bold; }

commit b16adc7c6f88c59492fa37d57dceaf49b1d17b4a
Author: Bill Erickson <berick at esilibrary.com>
Date:   Mon Sep 19 18:18:41 2011 -0400

    TPac: integrated patron password reset
    
    Port the existing password reset functionality into TPac.  This allows
    us to leverage the TPac innards for localization.  It also means there's
    one less moving part.  (and, incidentally, no more dojo for the form).
    
    Signed-off-by: Bill Erickson <berick at esilibrary.com>
    Signed-off-by: Dan Scott <dscott at laurentian.ca>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm
index 60d7e8f..4137472 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm
@@ -130,6 +130,8 @@ sub load {
         return $self->load_logout;
     }
 
+    return $self->load_password_reset if $path =~ m|opac/password_reset|;
+
     # ----------------------------------------------------------------
     #  Everything below here requires SSL + authentication
     # ----------------------------------------------------------------
diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm
index 4b0477e..63caca7 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm
@@ -1548,4 +1548,72 @@ sub load_myopac_bookbag_print {
     return Apache2::Const::OK;
 }
 
+sub load_password_reset {
+    my $self = shift;
+    my $cgi = $self->cgi;
+    my $ctx = $self->ctx;
+    my $barcode = $cgi->param('barcode');
+    my $username = $cgi->param('username');
+    my $email = $cgi->param('email');
+    my $pwd1 = $cgi->param('pwd1');
+    my $pwd2 = $cgi->param('pwd2');
+    my $uuid = $ctx->{page_args}->[0];
+
+    if ($uuid) {
+
+        $logger->info("patron password reset with uuid $uuid");
+
+        if ($pwd1 and $pwd2) {
+
+            if ($pwd1 eq $pwd2) {
+
+                my $response = $U->simplereq(
+                    'open-ils.actor', 
+                    'open-ils.actor.patron.password_reset.commit',
+                    $uuid, $pwd1);
+
+                $logger->info("patron password reset response " . Dumper($response));
+
+                if ($U->event_code($response)) { # non-success event
+                    
+                    my $code = $response->{textcode};
+                    
+                    if ($code eq 'PATRON_NOT_AN_ACTIVE_PASSWORD_RESET_REQUEST') {
+                        $ctx->{pwreset} = {style => 'error', status => 'NOT_ACTIVE'};
+                    }
+
+                    if ($code eq 'PATRON_PASSWORD_WAS_NOT_STRONG') {
+                        $ctx->{pwreset} = {style => 'error', status => 'NOT_STRONG'};
+                    }
+
+                } else { # success
+
+                    $ctx->{pwreset} = {style => 'success', status => 'SUCCESS'};
+                }
+
+            } else { # passwords not equal
+
+                $ctx->{pwreset} = {style => 'error', status => 'NO_MATCH'};
+            }
+
+        } else { # 2 password values needed
+
+            $ctx->{pwreset} = {style => 'error', status => 'TWO_PASSWORDS'};
+        }
+
+    } elsif ($barcode or $username) {
+
+        my @params = $barcode ? ('barcode', $barcode) : ('username', $username);
+
+        $U->simplereq(
+            'open-ils.actor', 
+            'open-ils.actor.patron.password_reset.request', @params);
+
+        $ctx->{pwreset} = {style => 'plain', status => 'REQUEST_SUCCESS'};
+    }
+
+    $logger->info("patron password reset resulted in " . Dumper($ctx->{pwreset}));
+    return Apache2::Const::OK;
+}
+
 1;
diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql
index db3afc2..a5641e9 100644
--- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql
+++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql
@@ -6677,7 +6677,7 @@ continue to work.
 If you did request a reset of your library system password, please perform
 the following steps to continue the process of resetting your password:
 
-1. Open the following link in a web browser: https://[% params.hostname %]/opac/password/[% params.locale || 'en-US' %]/[% target.uuid %]
+1. Open the following link in a web browser: https://[% params.hostname %]/eg/opac/password_reset/[% target.uuid %]
 The browser displays a password reset form.
 
 2. Enter your new password in the password reset form in the browser. You must
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.patron-password-reset-msg.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.patron-password-reset-msg.sql
new file mode 100644
index 0000000..7eb3bfc
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.patron-password-reset-msg.sql
@@ -0,0 +1,38 @@
+-- Evergreen DB patch XXXX.data.patron-password-reset-msg.sql
+--
+-- FIXME: insert description of change, if needed
+--
+BEGIN;
+
+
+-- check whether patch can be applied
+SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+
+UPDATE action_trigger.event_definition SET template = 
+$$
+[%- USE date -%]
+[%- user = target.usr -%]
+To: [%- params.recipient_email || user.email %]
+From: [%- params.sender_email || user.home_ou.email || default_sender %]
+Subject: [% user.home_ou.name %]: library account password reset request
+  
+You have received this message because you, or somebody else, requested a reset
+of your library system password. If you did not request a reset of your library
+system password, just ignore this message and your current password will
+continue to work.
+
+If you did request a reset of your library system password, please perform
+the following steps to continue the process of resetting your password:
+
+1. Open the following link in a web browser: https://[% params.hostname %]/eg/opac/password_reset/[% target.uuid %]
+The browser displays a password reset form.
+
+2. Enter your new password in the password reset form in the browser. You must
+enter the password twice to ensure that you do not make a mistake. If the
+passwords match, you will then be able to log in to your library system account
+with the new password.
+
+$$
+WHERE id = 20; -- Password reset request notification
+
+COMMIT;
diff --git a/Open-ILS/src/templates/opac/parts/login/form.tt2 b/Open-ILS/src/templates/opac/parts/login/form.tt2
index 7e200ab..48f2f67 100644
--- a/Open-ILS/src/templates/opac/parts/login/form.tt2
+++ b/Open-ILS/src/templates/opac/parts/login/form.tt2
@@ -128,8 +128,8 @@
                                 </div>
                                 <div style="padding-top:14px;">
                                     <input type="submit" value="[% l('Log in') %]" alt="[% l('Log in') %]" class="opac-button" />
-                                    [% IF reset_password; loc = ctx.locale.replace('_', '-'); %]
-                                    <a href='/opac/password/[% loc %]/'>[% l('Forgot your password?') %]</a>
+                                    [% IF reset_password %]
+                                    <a href='[% mkurl(ctx.opac_root _ '/password_reset', {}, 1) %]'>[% l('Forgot your password?') %]</a>
                                     [% END %]
                                 </div>
                             </td>
diff --git a/Open-ILS/src/templates/opac/password_reset.tt2 b/Open-ILS/src/templates/opac/password_reset.tt2
new file mode 100644
index 0000000..bc35a64
--- /dev/null
+++ b/Open-ILS/src/templates/opac/password_reset.tt2
@@ -0,0 +1,71 @@
+[%  PROCESS "opac/parts/header.tt2";
+    PROCESS "opac/parts/config.tt2";
+    WRAPPER "opac/parts/base.tt2";
+    INCLUDE "opac/parts/topnav.tt2";
+    ctx.page_title = l('Library system password reset request form');
+%]
+<div id="search-wrapper">
+    [% INCLUDE "opac/parts/printnav.tt2" %]
+    [% INCLUDE "opac/parts/searchbar.tt2" %]
+</div>
+
+[%  
+    uuid = ctx.page_args.0;
+    msg_map = {
+        SUCCESS => l('Password has been reset'),
+        NO_MATCH => l('Passwords did not match. Please try again'),
+        NOT_ACTIVE => l('This was not an active password reset request. Your password has not been reset.'),
+        NOT_STRONG => l('The password you chose was not considered complex enough to protect your account. Your password has not been reset.'),
+        TWO_PASSWORDS => l('Please enter your password twice'),
+        REQUEST_SUCCESS => l('Your user name or barcode has been submitted for a password reset. ' _ 
+            'If a matching account with an email address is found, you will soon receive an email at that address with further instructions for resetting your password.')
+    }
+%]
+<div id="content-wrapper">
+    <div id="main-content">
+        <br/>
+        <p class='[% ctx.pwreset.style %]'>[% stat = ctx.pwreset.status; msg_map.$stat %]</p>
+        [% IF uuid %]
+            [% IF stat == 'SUCCESS' %]
+                <p><a href='[% mkurl(ctx.opac_root _ '/login', {}, 1) %]'>[% l('Log in to My Account') %]</a>
+            [% ELSE %]
+            <form method="post">
+                <input type='hidden' name='uuid' value='[% uuid | html %]'/>
+                <table>
+                    <tr>
+                        <td><label for="pwd1">[% l('New password:') %]</label></td>
+                        <td><input type="password" name="pwd1"/></td>
+                    </tr>
+                    <tr>
+                        <td><label for="pwd2">[% l('Re-enter new password:') %]</label></td>
+                        <td><input type="password" name="pwd2"/></td>
+                    </tr>
+                    <tr>
+                        <td>
+                            <button name="submit" id="submitButton" type="submit">[% l('Submit') %]</button>
+                        </td>
+                    </tr>
+                </table>
+            </form>
+            [% END %]
+        [% ELSIF !ctx.pwreset.status %]
+        <h2>[% l('Please enter your user name or barcode to identify your library account and request a password reset') %]</h2>
+        <form method="post">
+            <table>
+                <tr>
+                    <td><label for="barcode">[% l('Barcode:') %] </label></td>
+                    <td><input type="text" id="barcode" name="barcode"/></td>
+                </tr>
+                <tr>
+                    <td><label for="username">[% l('User name:') %] </label></td>
+                    <td><input type="text" id="username" name="username"/></td>
+                </tr>
+            </table>
+            <!--<label for="email">[% l('Email address associated with the account:') %] </label><input type="text" name="email"/></br>-->
+            <button name="submit" id="submitButton" type="submit">[% l('Submit') %]</button>
+        </form>
+        [% END %]
+    </div>
+</div>
+[% END %]
+

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

Summary of changes:
 .../src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm    |    2 +
 .../lib/OpenILS/WWW/EGCatLoader/Account.pm         |   68 +++++++++++++++++++
 Open-ILS/src/sql/Pg/950.data.seed-values.sql       |    4 +-
 .../0627.data.patron-password-reset-msg.sql        |   37 ++++++++++
 Open-ILS/src/templates/opac/parts/login/form.tt2   |    4 +-
 Open-ILS/src/templates/opac/password_reset.tt2     |   71 ++++++++++++++++++++
 Open-ILS/web/css/skin/default/opac/style.css       |    3 +
 7 files changed, 185 insertions(+), 4 deletions(-)
 create mode 100644 Open-ILS/src/sql/Pg/upgrade/0627.data.patron-password-reset-msg.sql
 create mode 100644 Open-ILS/src/templates/opac/password_reset.tt2


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list