Bugzilla – Attachment 167582 Details for
Bug 33462
Force password change for new patrons entered by staff
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33462: DB Updates
Bug-33462-DB-Updates.patch (text/plain), 5.20 KB, created by
Sam Lau
on 2024-06-07 19:42:37 UTC
(
hide
)
Description:
Bug 33462: DB Updates
Filename:
MIME Type:
Creator:
Sam Lau
Created:
2024-06-07 19:42:37 UTC
Size:
5.20 KB
patch
obsolete
>From ed870ef5304ea97b4edc10d755a3d266c371c16f Mon Sep 17 00:00:00 2001 >From: Sam Lau <samalau@gmail.com> >Date: Thu, 6 Jun 2024 18:52:13 +0000 >Subject: [PATCH] Bug 33462: DB Updates > >--- > .../data/mysql/atomicupdate/bug_33462.pl | 23 +++++++++++ > installer/data/mysql/atomicupdate/skeleton.pl | 39 ------------------- > installer/data/mysql/kohastructure.sql | 1 + > .../en/modules/admin/preferences/patrons.pref | 8 +++- > 4 files changed, 31 insertions(+), 40 deletions(-) > create mode 100755 installer/data/mysql/atomicupdate/bug_33462.pl > delete mode 100755 installer/data/mysql/atomicupdate/skeleton.pl > >diff --git a/installer/data/mysql/atomicupdate/bug_33462.pl b/installer/data/mysql/atomicupdate/bug_33462.pl >new file mode 100755 >index 0000000000..d74effdfec >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_33462.pl >@@ -0,0 +1,23 @@ >+use Modern::Perl; >+use Koha::Installer::Output qw(say_warning say_failure say_success say_info); >+ >+return { >+ bug_number => "33462", >+ description => "Force password reset for new patrons entered by staff", >+ up => sub { >+ my ($args) = @_; >+ my ( $dbh, $out ) = @$args{qw(dbh out)}; >+ $dbh->do(q{ >+ INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) >+VALUES ('ForcePasswordResetWhenSetByStaff', '0', NULL,'Force a staff created patron account to reset its password after its first OPAC login.', 'YesNo') >+ }); >+ say $out "Added new system preference 'ForcePasswordResetWhenSetByStaff'"; >+ >+ if( !column_exists( 'categories', 'force_password_reset_when_set_by_staff' ) ) { >+ $dbh->do("ALTER TABLE categories ADD COLUMN `force_password_reset_when_set_by_staff` TINYINT(1) NULL DEFAULT NULL AFTER `require_strong_password` -- if patrons of this category are required to reset password after being created by a staff member"); >+ } >+ >+ say $out "Added column to categories 'force_password_reset_when_set_by_staff'"; >+ >+ }, >+}; >diff --git a/installer/data/mysql/atomicupdate/skeleton.pl b/installer/data/mysql/atomicupdate/skeleton.pl >deleted file mode 100755 >index 9e5738136b..0000000000 >--- a/installer/data/mysql/atomicupdate/skeleton.pl >+++ /dev/null >@@ -1,39 +0,0 @@ >-use Modern::Perl; >-use Koha::Installer::Output qw(say_warning say_failure say_success say_info); >- >-return { >- bug_number => "BUG_NUMBER", >- description => "A single line description", >- up => sub { >- my ($args) = @_; >- my ( $dbh, $out ) = @$args{qw(dbh out)}; >- >- # Do you stuffs here >- $dbh->do(q{}); >- >- # Print useful stuff here >- # tables >- say $out "Added new table 'XXX'"; >- say $out "Added column 'XXX.YYY'"; >- >- # sysprefs >- say $out "Added new system preference 'XXX'"; >- say $out "Updated system preference 'XXX'"; >- say $out "Removed system preference 'XXX'"; >- >- # permissions >- say $out "Added new permission 'XXX'"; >- >- # letters >- say $out "Added new letter 'XXX' (TRANSPORT)"; >- >- # HTML customizations >- say $out "Added 'XXX' HTML customization"; >- >- # Other information >- say_failure( $out, "Use red for danger/failure" ); >- say_success( $out, "Use green for success" ); >- say_warning( $out, "Use yellow for warning/a call to action" ); >- say_info( $out, "Use blue for further information" ); >- }, >-}; >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 91c1bec42f..d958d84444 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -1806,6 +1806,7 @@ CREATE TABLE `categories` ( > `min_password_length` smallint(6) DEFAULT NULL COMMENT 'set minimum password length for patrons in this category', > `require_strong_password` tinyint(1) DEFAULT NULL COMMENT 'set required password strength for patrons in this category', > `exclude_from_local_holds_priority` tinyint(1) DEFAULT NULL COMMENT 'Exclude patrons of this category from local holds priority', >+ `force_password_reset_when_set_by_staff` tinyint(1) DEFAULT NULL COMMENT 'if patrons of this category are required to reset password after being created by a staff member', > PRIMARY KEY (`categorycode`), > UNIQUE KEY `categorycode` (`categorycode`) > ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; >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 0c280f302b..0cfe22de91 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 >@@ -1,4 +1,4 @@ >-Patrons: >+fPatrons: > General: > - > - pref: CheckPrevCheckout >@@ -468,6 +468,12 @@ Patrons: > - pref: FailedLoginAttempts > class: integer > - failed login attempts. >+ - >+ - pref: ForcePasswordResetWhenSetByStaff >+ choices: >+ 1: "Force" >+ 0: "Don't force" >+ - a staff created patron account to reset its password after its first OPAC login. > - > - pref: Pseudonymization > choices: >-- >2.39.2
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 33462
:
153687
|
153688
|
153689
|
154395
|
154396
|
154397
|
167582
|
167583
|
167584
|
167585
|
167586
|
167587
|
167981
|
167982
|
167983
|
167984
|
167985
|
167986
|
168413
|
168414
|
168415
|
168416
|
168417
|
168418
|
168452
|
168453
|
168454
|
168455
|
168456
|
168457
|
171634
|
171635
|
171636
|
171637
|
171638
|
171639
|
171640
|
172030
|
172031
|
172032
|
172033
|
172034
|
172035
|
172036
|
172064
|
172065
|
172066
|
172067
|
172068
|
172069
|
172070
|
172071
|
173864
|
173865