[open-ils-commits] r19672 - branches/rel_2_0/Open-ILS/src/sql/Pg (miker)

svn at svn.open-ils.org svn at svn.open-ils.org
Wed Mar 9 21:32:29 EST 2011


Author: miker
Date: 2011-03-09 21:32:27 -0500 (Wed, 09 Mar 2011)
New Revision: 19672

Modified:
   branches/rel_2_0/Open-ILS/src/sql/Pg/1.6.1-2.0-upgrade-db.sql
Log:
do some fancy dancing to make moving an event def around possible

Modified: branches/rel_2_0/Open-ILS/src/sql/Pg/1.6.1-2.0-upgrade-db.sql
===================================================================
--- branches/rel_2_0/Open-ILS/src/sql/Pg/1.6.1-2.0-upgrade-db.sql	2011-03-09 22:04:40 UTC (rev 19671)
+++ branches/rel_2_0/Open-ILS/src/sql/Pg/1.6.1-2.0-upgrade-db.sql	2011-03-10 02:32:27 UTC (rev 19672)
@@ -3187,10 +3187,45 @@
 -- additional opportunities for typos, since we already have the insert from
 -- an upgrade script.
 
-UPDATE action_trigger.environment
-SET event_def = 20
-WHERE event_def = 15;
+DELETE FROM action_trigger.event_definition
+WHERE id = 15;
 
+-- Only insert this if it's not there already
+INSERT INTO action_trigger.hook (key,core_type,description)
+ SELECT  'password.reset_request','aupr','Patron has requested a self-serve password reset'
+   WHERE (SELECT COUNT(*) FROM action_trigger.hook WHERE key = 'password.reset_request') = 0;
+
+INSERT INTO action_trigger.event_definition (id, active, owner, name, hook, validator, reactor, delay, template)
+    VALUES (20, 'f', 1, 'Password reset request notification', 'password.reset_request', 'NOOP_True', 'SendEmail', '00:00:01',
+$$
+[%- 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 %]/opac/password/[% params.locale || 'en-US' %]/[% 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.
+
+$$);
+
+INSERT INTO action_trigger.environment ( event_def, path) VALUES
+    ( 20, 'usr' ),
+    ( 20, 'usr.home_ou' );
+
 UPDATE action_trigger.event
 SET event_def = 20
 WHERE event_def = 15;
@@ -3199,9 +3234,6 @@
 SET event_def = 20
 WHERE event_def = 15;
 
-DELETE FROM action_trigger.event_definition
-WHERE id = 15;
-
 INSERT INTO action_trigger.event_definition (
         id,
         active,



More information about the open-ils-commits mailing list