From: Jaswinder Singh Date: Sun, 23 Sep 2018 15:57:01 +0000 (-0400) Subject: LP#1772680: Changed Registration form, added code in the backend to save email into... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=673e93cd6507b7fc493acbd4b6f763d41039cf02;p=evergreen%2Fpines.git LP#1772680: Changed Registration form, added code in the backend to save email into evergreen if changed Signed-off-by: Jaswinder Singh Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/EbookAPI.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/EbookAPI.pm index 061cc0aa04..76767bf1f5 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/EbookAPI.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/EbookAPI.pm @@ -993,7 +993,7 @@ __PACKAGE__->register_method( # Call an API to register a patron sub register_patron { - my ($self, $conn, $auth, $session_id, $password) = @_; + my ($self, $conn, $auth, $session_id, $email, $password) = @_; $logger->info("EbookAPI: Initiating patron registration"); # verify that user is authenticated in EG @@ -1003,6 +1003,17 @@ sub register_patron { return; } + # Update email in the Evergreen system if changed by the user + if (lc $editor->requestor->email ne lc $email) { + #Begin transaction + $editor->xact_begin; + my $db_user = $editor->retrieve_actor_user($editor->requestor->id); + $db_user->email($email); + + $editor->update_actor_user($db_user) or return $editor->die_event; + $editor->commit; + } + $logger->info("EbookAPI: User Authenticated. Now, registering the patron with RBDigital"); my $handler = new_handler($session_id); @@ -1028,6 +1039,11 @@ __PACKAGE__->register_method( type => 'string' }, { + name => 'email', + desc => 'New email address for evergreen and vendor portal', + type => 'string' + }, + { name => 'password', desc => 'The password for vendor portal', type => 'string' diff --git a/Open-ILS/src/templates/opac/ebook_api/rbdigital/register_modal.tt2 b/Open-ILS/src/templates/opac/ebook_api/rbdigital/register_modal.tt2 index ce74ae82f5..bc7f076afb 100644 --- a/Open-ILS/src/templates/opac/ebook_api/rbdigital/register_modal.tt2 +++ b/Open-ILS/src/templates/opac/ebook_api/rbdigital/register_modal.tt2 @@ -6,16 +6,16 @@