[open-ils-commits] r16584 - in trunk/Open-ILS/src: perlmods/OpenILS/Application sql/Pg sql/Pg/upgrade (phasefx)
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Jun 3 15:33:16 EDT 2010
Author: phasefx
Date: 2010-06-03 15:33:11 -0400 (Thu, 03 Jun 2010)
New Revision: 16584
Added:
trunk/Open-ILS/src/sql/Pg/upgrade/0290.data.org-setting-password-reset-request.sql
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm
trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql
Log:
org unit setting for requiring a matching email for password reset requests (no UI support yet)
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm 2010-06-03 17:30:48 UTC (rev 16583)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm 2010-06-03 19:33:11 UTC (rev 16584)
@@ -3696,12 +3696,13 @@
params => [
{ desc => 'user_id_type', type => 'string' },
{ desc => 'user_id', type => 'string' },
+ { desc => 'optional (based on library setting) matching email address for authorizing request', type => 'string' },
],
return => {desc => '1 on success, Event on error'}
}
);
sub request_password_reset {
- my($self, $conn, $user_id_type, $user_id) = @_;
+ my($self, $conn, $user_id_type, $user_id, $email) = @_;
# Check to see if password reset requests are already being throttled:
# 0. Check cache to see if we're in throttle mode (avoid hitting database)
@@ -3726,12 +3727,20 @@
}
$user = $card->usr;
}
-
+
# If the user doesn't have an email address, we can't help them
if (!$user->email) {
$e->die_event;
return OpenILS::Event->new('PATRON_NO_EMAIL_ADDRESS');
}
+
+ my $email_must_match = $U->ou_ancestor_setting_value($user->home_ou, 'circ.password_reset_request_requires_matching_email');
+ if ($email_must_match) {
+ if ($user->email ne $email) {
+ return OpenILS::Event->new('EMAIL_VERIFICATION_FAILED');
+ }
+ }
+
_reset_password_request($conn, $e, $user);
}
Modified: trunk/Open-ILS/src/sql/Pg/002.schema.config.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2010-06-03 17:30:48 UTC (rev 16583)
+++ trunk/Open-ILS/src/sql/Pg/002.schema.config.sql 2010-06-03 19:33:11 UTC (rev 16584)
@@ -65,7 +65,7 @@
install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
);
-INSERT INTO config.upgrade_log (version) VALUES ('0289'); -- phasefx
+INSERT INTO config.upgrade_log (version) VALUES ('0290'); -- phasefx
CREATE TABLE config.bib_source (
id SERIAL PRIMARY KEY,
Modified: trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql 2010-06-03 17:30:48 UTC (rev 16583)
+++ trunk/Open-ILS/src/sql/Pg/950.data.seed-values.sql 2010-06-03 19:33:11 UTC (rev 16584)
@@ -2079,6 +2079,22 @@
'bool'
);
+-- 0290.data.org-setting-password-reset-request.sql
+INSERT INTO config.org_unit_setting_type ( name, label, description, datatype ) VALUES (
+ 'circ.password_reset_request_requires_matching_email',
+ oils_i18n_gettext(
+ 'circ.password_reset_request_requires_matching_email',
+ 'Circulation: Require matching email address for password reset requests',
+ 'coust',
+ 'label'),
+ oils_i18n_gettext(
+ 'circ.password_reset_request_requires_matching_email',
+ 'Circulation: Require matching email address for password reset requests',
+ 'coust',
+ 'description'),
+ 'bool'
+);
+
-- Org_unit_setting_type(s) that need an fm_class:
INSERT into config.org_unit_setting_type
( name, label, description, datatype, fm_class ) VALUES
Added: trunk/Open-ILS/src/sql/Pg/upgrade/0290.data.org-setting-password-reset-request.sql
===================================================================
--- trunk/Open-ILS/src/sql/Pg/upgrade/0290.data.org-setting-password-reset-request.sql (rev 0)
+++ trunk/Open-ILS/src/sql/Pg/upgrade/0290.data.org-setting-password-reset-request.sql 2010-06-03 19:33:11 UTC (rev 16584)
@@ -0,0 +1,20 @@
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0290'); -- phasefx
+
+INSERT INTO config.org_unit_setting_type ( name, label, description, datatype ) VALUES (
+ 'circ.password_reset_request_requires_matching_email',
+ oils_i18n_gettext(
+ 'circ.password_reset_request_requires_matching_email',
+ 'Circulation: Require matching email address for password reset requests',
+ 'coust',
+ 'label'),
+ oils_i18n_gettext(
+ 'circ.password_reset_request_requires_matching_email',
+ 'Circulation: Require matching email address for password reset requests',
+ 'coust',
+ 'description'),
+ 'bool'
+);
+
+COMMIT;
More information about the open-ils-commits
mailing list