View | Details | Raw Unified | Return to bug 33462
Collapse All | Expand All

(-)a/installer/data/mysql/atomicupdate/bug_33462.pl (+23 lines)
Line 0 Link Here
1
use Modern::Perl;
2
use Koha::Installer::Output qw(say_warning say_failure say_success say_info);
3
4
return {
5
    bug_number  => "33462",
6
    description => "Force password reset for new patrons entered by staff",
7
    up          => sub {
8
        my ($args) = @_;
9
        my ( $dbh, $out ) = @$args{qw(dbh out)};
10
        $dbh->do(q{
11
        INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` )
12
VALUES ('ForcePasswordResetWhenSetByStaff', '0', NULL,'Force a staff created patron account to reset its password after its first OPAC login.', 'YesNo')
13
        });
14
        say $out "Added new system preference 'ForcePasswordResetWhenSetByStaff'";
15
16
        if( !column_exists( 'categories', 'force_password_reset_when_set_by_staff' ) ) {
17
            $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");
18
        }
19
20
        say $out "Added column to categories 'force_password_reset_when_set_by_staff'";
21
22
    },
23
};
(-)a/installer/data/mysql/kohastructure.sql (+1 lines)
Lines 1810-1815 CREATE TABLE `categories` ( Link Here
1810
  `noissuescharge` int(11) DEFAULT NULL COMMENT 'define maximum amount outstanding before checkouts are blocked',
1810
  `noissuescharge` int(11) DEFAULT NULL COMMENT 'define maximum amount outstanding before checkouts are blocked',
1811
  `noissueschargeguarantees` int(11) DEFAULT NULL COMMENT 'define maximum amount that the guarantees of a patron in this category can have outstanding before checkouts are blocked',
1811
  `noissueschargeguarantees` int(11) DEFAULT NULL COMMENT 'define maximum amount that the guarantees of a patron in this category can have outstanding before checkouts are blocked',
1812
  `noissueschargeguarantorswithguarantees` int(11) DEFAULT NULL COMMENT 'define maximum amount that the guarantors with guarantees of a patron in this category can have outstanding before checkouts are blocked',
1812
  `noissueschargeguarantorswithguarantees` int(11) DEFAULT NULL COMMENT 'define maximum amount that the guarantors with guarantees of a patron in this category can have outstanding before checkouts are blocked',
1813
  `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',
1813
  PRIMARY KEY (`categorycode`),
1814
  PRIMARY KEY (`categorycode`),
1814
  UNIQUE KEY `categorycode` (`categorycode`)
1815
  UNIQUE KEY `categorycode` (`categorycode`)
1815
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1816
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref (-2 / +7 lines)
Lines 1-4 Link Here
1
Patrons:
1
fPatrons:
2
    General:
2
    General:
3
     -
3
     -
4
         - pref: CheckPrevCheckout
4
         - pref: CheckPrevCheckout
Lines 472-477 Patrons: Link Here
472
         - pref: FailedLoginAttempts
472
         - pref: FailedLoginAttempts
473
           class: integer
473
           class: integer
474
         - failed login attempts.
474
         - failed login attempts.
475
     -
476
         - pref: ForcePasswordResetWhenSetByStaff
477
           choices:
478
               1: "Force"
479
               0: "Don't force"
480
         - a staff created patron account to reset its password after its first OPAC login.
475
     -
481
     -
476
         - pref: Pseudonymization
482
         - pref: Pseudonymization
477
           choices:
483
           choices:
478
- 

Return to bug 33462