]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/sql/Pg/upgrade/0237.data.password-reset.sql
LP#1178377: Make bib source optional element from unapi.bre
[working/Evergreen.git] / Open-ILS / src / sql / Pg / upgrade / 0237.data.password-reset.sql
1 BEGIN;
2
3 INSERT INTO config.upgrade_log (version) VALUES ('0237');
4
5 INSERT into config.org_unit_setting_type
6 ( name, label, description, datatype ) VALUES
7 ( 'circ.password_reset_request_per_user_limit',
8     oils_i18n_gettext('circ.password_reset_request_per_user_limit', 'Circulation: Maximum concurrently active self-serve password reset requests per user', 'coust', 'label'),
9     oils_i18n_gettext('circ.password_reset_request_per_user_limit', 'When a user has more than this number of concurrently active self-serve password reset requests for their account, prevent the user from creating any new self-serve password reset requests until the number of active requests for the user drops back below this number.', 'coust', 'description'),
10     'string'),
11
12 ( 'circ.password_reset_request_time_to_live',
13     oils_i18n_gettext('circ.password_reset_request_time_to_live', 'Circulation: Self-serve password reset request time-to-live', 'coust', 'label'),
14     oils_i18n_gettext('circ.password_reset_request_time_to_live', 'Length of time (in seconds) a self-serve password reset request should remain active.', 'coust', 'description'),
15     'string'),
16
17 ( 'circ.password_reset_request_throttle',
18     oils_i18n_gettext('circ.password_reset_request_throttle', 'Circulation: Maximum concurrently active self-serve password reset requests', 'coust', 'label'),
19     oils_i18n_gettext('circ.password_reset_request_throttle', 'Prevent the creation of new self-serve password reset requests until the number of active requests drops back below this number.', 'coust', 'description'),
20     'string')
21 ;
22
23 INSERT INTO action_trigger.hook (key,core_type,description) VALUES ('password.reset_request','aupr','Patron has requested a self-serve password reset');
24 INSERT INTO action_trigger.event_definition (id, active, owner, name, hook, validator, reactor, delay, template) 
25     VALUES (20, 'f', 1, 'Password reset request notification', 'password.reset_request', 'NOOP_True', 'SendEmail', '00:00:01',
26 $$
27 [%- USE date -%]
28 [%- user = target.usr -%]
29 To: [%- params.recipient_email || user.email %]
30 From: [%- params.sender_email || user.home_ou.email || default_sender %]
31 Subject: [% user.home_ou.name %]: library account password reset request
32   
33 You have received this message because you, or somebody else, requested a reset
34 of your library system password. If you did not request a reset of your library
35 system password, just ignore this message and your current password will
36 continue to work.
37
38 If you did request a reset of your library system password, please perform
39 the following steps to continue the process of resetting your password:
40
41 1. Open the following link in a web browser: https://[% params.hostname %]/opac/password/[% params.locale || 'en-US' %]/[% target.uuid %]
42 The browser displays a password reset form.
43
44 2. Enter your new password in the password reset form in the browser. You must
45 enter the password twice to ensure that you do not make a mistake. If the
46 passwords match, you will then be able to log in to your library system account
47 with the new password.
48
49 $$);
50 INSERT INTO action_trigger.environment ( event_def, path) VALUES
51     ( 20, 'usr' );
52 INSERT INTO action_trigger.environment ( event_def, path) VALUES
53     ( 20, 'usr.home_ou' );
54
55 COMMIT;