From 8ec7572d0ccd0aec27a8900725118e4da9a9a25a Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Fri, 22 Jan 2016 10:18:29 +0100 Subject: [PATCH] Bug 8753: [QA Follow-up] Primary key and collation This patch includes: [1] Adds primary key borrowernumber to new table. [2] Fixes collation. [3] Removes manual PK in DBIx schema file. [4] Fixes typo CompletePasswordRevovery. [5] Removes use strict from opac-password-recovery; Modern::Perl is used. Signed-off-by: Marcel de Rooy --- C4/Passwordrecovery.pm | 2 +- Koha/Schema/Result/BorrowerPasswordRecovery.pm | 17 ++++++++++++++--- ...ug_8753-Add_forgot_password_link_to_OPAC.sql | 3 ++- installer/data/mysql/kohastructure.sql | 3 ++- opac/opac-password-recovery.pl | 1 - 5 files changed, 19 insertions(+), 7 deletions(-) diff --git a/C4/Passwordrecovery.pm b/C4/Passwordrecovery.pm index d8420dbda0..ea01e1503c 100644 --- a/C4/Passwordrecovery.pm +++ b/C4/Passwordrecovery.pm @@ -164,7 +164,7 @@ sub SendPasswordRecoveryEmail { =head2 CompletePasswordRecovery - $bool = CompletePasswordRevovery($uuid); + $bool = CompletePasswordRecovery($uuid); Deletes a password recovery entry. diff --git a/Koha/Schema/Result/BorrowerPasswordRecovery.pm b/Koha/Schema/Result/BorrowerPasswordRecovery.pm index 85d63434f3..c7f567d102 100644 --- a/Koha/Schema/Result/BorrowerPasswordRecovery.pm +++ b/Koha/Schema/Result/BorrowerPasswordRecovery.pm @@ -57,12 +57,23 @@ __PACKAGE__->add_columns( }, ); +=head1 PRIMARY KEY -# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-11-03 12:08:20 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ORAWxUHIkefSfPSqrcfeXA +=over 4 +=item * L + +=back + +=cut -# You can replace this text with custom code or comments, and it will be preserved on regeneration __PACKAGE__->set_primary_key("borrowernumber"); + +# Created by DBIx::Class::Schema::Loader v0.07025 @ 2016-01-22 10:16:52 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:c4ehAGqOD6YHpGg85BX8YQ + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration + 1; diff --git a/installer/data/mysql/atomicupdate/bug_8753-Add_forgot_password_link_to_OPAC.sql b/installer/data/mysql/atomicupdate/bug_8753-Add_forgot_password_link_to_OPAC.sql index 9719bee330..f47e562b06 100644 --- a/installer/data/mysql/atomicupdate/bug_8753-Add_forgot_password_link_to_OPAC.sql +++ b/installer/data/mysql/atomicupdate/bug_8753-Add_forgot_password_link_to_OPAC.sql @@ -5,8 +5,9 @@ CREATE TABLE IF NOT EXISTS borrower_password_recovery ( borrowernumber int(11) NOT NULL, uuid varchar(128) NOT NULL, valid_until timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (borrowernumber), KEY borrowernumber (borrowernumber) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; INSERT IGNORE INTO `letter` (module, code, branchcode, name, is_html, title, content, message_transport_type) VALUES ('members','PASSWORD_RESET','','Online password reset',1,'Koha password recovery','\r\n

This email has been sent in response to your password recovery request for the account <>.\r\n

\r\n

\r\nYou can now create your new password using the following link:\r\n
>\"><>\r\n

\r\n

This link will be valid for 2 days from this email\'s reception, then you must reapply if you do not change your password.

\r\n

Thank you.

\r\n\r\n','email'); diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 3975f28d6e..b98b017b34 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -365,8 +365,9 @@ CREATE TABLE IF NOT EXISTS `borrower_password_recovery` ( -- holds information a `borrowernumber` int(11) NOT NULL, -- the user asking a password recovery `uuid` varchar(128) NOT NULL, -- a unique string to identify a password recovery attempt `valid_until` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, -- a time limit on the password recovery attempt + PRIMARY KEY (`borrowernumber`), KEY borrowernumber (borrowernumber) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Table structure for table borrower_sync diff --git a/opac/opac-password-recovery.pl b/opac/opac-password-recovery.pl index 6cfc4144c5..7e3eae2f1c 100755 --- a/opac/opac-password-recovery.pl +++ b/opac/opac-password-recovery.pl @@ -1,6 +1,5 @@ #!/usr/bin/perl -use strict; use Modern::Perl; use CGI; -- 2.39.5