Bugzilla – Attachment 186513 Details for
Bug 40824
Add option to prevent re-use of passwords
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40824: Atomic update for borrower password history
Bug-40824-Atomic-update-for-borrower-password-hist.patch (text/plain), 2.90 KB, created by
Jacob O'Mara
on 2025-09-17 09:47:34 UTC
(
hide
)
Description:
Bug 40824: Atomic update for borrower password history
Filename:
MIME Type:
Creator:
Jacob O'Mara
Created:
2025-09-17 09:47:34 UTC
Size:
2.90 KB
patch
obsolete
>From b4da6273e2a2a187eea38569ee999f1ff746f960 Mon Sep 17 00:00:00 2001 >From: Jacob O'Mara <jacob.omara@openfifth.co.uk> >Date: Thu, 10 Apr 2025 12:28:57 +0100 >Subject: [PATCH] Bug 40824: Atomic update for borrower password history > >--- > .../bug_40824-add_password_history.pl | 51 +++++++++++++++++++ > 1 file changed, 51 insertions(+) > create mode 100755 installer/data/mysql/atomicupdate/bug_40824-add_password_history.pl > >diff --git a/installer/data/mysql/atomicupdate/bug_40824-add_password_history.pl b/installer/data/mysql/atomicupdate/bug_40824-add_password_history.pl >new file mode 100755 >index 00000000000..c16d1f3fa51 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_40824-add_password_history.pl >@@ -0,0 +1,51 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => "40824", >+ description => "Add password history feature", >+ up => sub { >+ my ($args) = @_; >+ my ( $dbh, $out ) = @$args{qw(dbh out)}; >+ >+ # Create password history table and add system preference if the table doesn't exist >+ unless ( TableExists('borrower_password_history') ) { >+ >+ # Create the table >+ $dbh->do( >+ q{ >+ CREATE TABLE IF NOT EXISTS borrower_password_history ( >+ id int(11) NOT NULL AUTO_INCREMENT, >+ borrowernumber int(11) NOT NULL, >+ password varchar(128) NOT NULL, >+ created_on timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, >+ PRIMARY KEY (id), >+ KEY borrowernumber (borrowernumber), >+ CONSTRAINT borrower_password_history_ibfk_1 FOREIGN KEY (borrowernumber) REFERENCES borrowers(borrowernumber) ON DELETE CASCADE ON UPDATE CASCADE >+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; >+ } >+ ); >+ say $out "Created borrower_password_history table"; >+ >+ # Add system preference >+ $dbh->do( >+ q{ >+ INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) >+ VALUES ('PasswordHistoryCount','0','Number of previous passwords to check against when changing password','','Integer') >+ } >+ ); >+ say $out "Added new system preference 'PasswordHistoryCount'"; >+ } >+ >+ # Add password_history_count column to categories table if it doesn't exist >+ unless ( column_exists( 'categories', 'password_history_count' ) ) { >+ $dbh->do( >+ q{ >+ ALTER TABLE categories >+ ADD COLUMN password_history_count smallint(6) NULL DEFAULT NULL >+ COMMENT 'Number of previous passwords to check against when changing password for this patron type' >+ } >+ ); >+ say $out "Added password_history_count column to categories table"; >+ } >+ }, >+}; >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 40824
:
186511
|
186512
| 186513 |
186514
|
186515
|
186516
|
186517
|
186518
|
186519
|
186520
|
186521
|
186522
|
186523
|
186524
|
186525
|
186526
|
186527