Bugzilla – Attachment 62453 Details for
Bug 18314
Account lockout
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18314: Add pref FailedLoginAttempts and columns borrowers.login_attempts
Bug-18314-Add-pref-FailedLoginAttempts-and-columns.patch (text/plain), 5.32 KB, created by
Biblibre Sandboxes
on 2017-04-20 11:25:05 UTC
(
hide
)
Description:
Bug 18314: Add pref FailedLoginAttempts and columns borrowers.login_attempts
Filename:
MIME Type:
Creator:
Biblibre Sandboxes
Created:
2017-04-20 11:25:05 UTC
Size:
5.32 KB
patch
obsolete
>From a5f5970bd7c98e5049f260d10fe18d35e2cec469 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 21 Mar 2017 17:20:00 -0300 >Subject: [PATCH] Bug 18314: Add pref FailedLoginAttempts and columns > borrowers.login_attempts > >And of course deletedborrowers.login_attempts > >Signed-off-by: Jonathan Field <jonathan.field@ptfs-europe.com> >--- > installer/data/mysql/atomicupdate/lockout.perl | 19 +++++++++++++++++++ > installer/data/mysql/kohastructure.sql | 2 ++ > installer/data/mysql/sysprefs.sql | 1 + > .../prog/en/modules/admin/preferences/patrons.pref | 5 +++++ > 4 files changed, 27 insertions(+) > create mode 100644 installer/data/mysql/atomicupdate/lockout.perl > >diff --git a/installer/data/mysql/atomicupdate/lockout.perl b/installer/data/mysql/atomicupdate/lockout.perl >new file mode 100644 >index 0000000..db7fbc9 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/lockout.perl >@@ -0,0 +1,19 @@ >+$DBversion = 'XXX'; # will be replaced by the RM >+if( CheckVersion( $DBversion ) ) { >+ $dbh->do( q| >+ INSERT IGNORE INTO systempreferences (`variable`, `value`, `options`, `explanation`, `type`) >+ VALUES ('FailedLoginAttempts','','','Number of login attempts before lockout the patron account','Integer'); >+ |); >+ >+ unless( column_exists( 'borrowers', 'login_attempts' ) ) { >+ $dbh->do(q| >+ ALTER TABLE borrowers ADD COLUMN login_attempts INT(4) DEFAULT 0 AFTER lastseen >+ |); >+ $dbh->do(q| >+ ALTER TABLE deletedborrowers ADD COLUMN login_attempts INT(4) DEFAULT 0 AFTER lastseen >+ |); >+ } >+ >+ SetVersion( $DBversion ); >+ print "Upgrade to $DBversion done (Bug XXXXX - Add FailedLoginAttempts and borrowers.login_attempts)\n"; >+} >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 261fb37..55daa8d 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -632,6 +632,7 @@ CREATE TABLE `deletedborrowers` ( -- stores data related to the patrons/borrower > `checkprevcheckout` varchar(7) NOT NULL default 'inherit', -- produce a warning for this patron if this item has previously been checked out to this patron if 'yes', not if 'no', defer to category setting if 'inherit'. > `updated_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- time of last change could be useful for synchronization with external systems (among others) > `lastseen` datetime default NULL, -- last time a patron has been seed (connected at the OPAC or staff interface) >+ `login_attempts` int(4) default 0, -- number of failed login attemps > `overdrive_auth_token` text default NULL, -- persist OverDrive auth token > KEY borrowernumber (borrowernumber), > KEY `cardnumber` (`cardnumber`), >@@ -1663,6 +1664,7 @@ CREATE TABLE `borrowers` ( -- this table includes information about your patrons > `checkprevcheckout` varchar(7) NOT NULL default 'inherit', -- produce a warning for this patron if this item has previously been checked out to this patron if 'yes', not if 'no', defer to category setting if 'inherit'. > `updated_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -- time of last change could be useful for synchronization with external systems (among others) > `lastseen` datetime default NULL, -- last time a patron has been seed (connected at the OPAC or staff interface) >+ `login_attempts` int(4) default 0, -- number of failed login attemps > `overdrive_auth_token` text default NULL, -- persist OverDrive auth token > UNIQUE KEY `cardnumber` (`cardnumber`), > PRIMARY KEY `borrowernumber` (`borrowernumber`), >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index 64aa493..964d605 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -159,6 +159,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('ExtendedPatronAttributes','0',NULL,'Use extended patron IDs and attributes','YesNo'), > ('FacetLabelTruncationLength','20',NULL,'Specify the facet max length in OPAC','Integer'), > ('FacetMaxCount','20',NULL,'Specify the max facet count for each category','Integer'), >+('FailedLoginAttempts','','','Number of login attempts before lockout the patron account','Integer'), > ('FeeOnChangePatronCategory','1','','If set, when a patron changes to a category with enrolment fee, a fee is charged','YesNo'), > ('FilterBeforeOverdueReport','0','','Do not run overdue report until filter selected','YesNo'), > ('FineNotifyAtCheckin','0',NULL,'If ON notify librarians of overdue fines on the items they are checking in.','YesNo'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref >index 4a85957..ac4946d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref >@@ -212,3 +212,8 @@ Patrons: > yes: Do > no: "Don't" > - search the Norwegian national patron database after a local search result was found. >+ - >+ - Block a patron's account if it reaches >+ - pref: FailedLoginAttempts >+ class: integer >+ - failed login attempts. >-- >2.7.4
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 18314
:
61630
|
61631
|
61632
|
61633
|
61634
|
62453
|
62454
|
62455
|
62456
|
62457
|
62872
|
62873
|
62874
|
62875
|
62876
|
62877
|
62878
|
62884
|
62885
|
62886
|
62887
|
62888
|
62889
|
62890
|
62891