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/atomicupdate/skeleton.pl (-39 lines)
Lines 1-39 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  => "BUG_NUMBER",
6
    description => "A single line description",
7
    up          => sub {
8
        my ($args) = @_;
9
        my ( $dbh, $out ) = @$args{qw(dbh out)};
10
11
        # Do you stuffs here
12
        $dbh->do(q{});
13
14
        # Print useful stuff here
15
        # tables
16
        say $out "Added new table 'XXX'";
17
        say $out "Added column 'XXX.YYY'";
18
19
        # sysprefs
20
        say $out "Added new system preference 'XXX'";
21
        say $out "Updated system preference 'XXX'";
22
        say $out "Removed system preference 'XXX'";
23
24
        # permissions
25
        say $out "Added new permission 'XXX'";
26
27
        # letters
28
        say $out "Added new letter 'XXX' (TRANSPORT)";
29
30
        # HTML customizations
31
        say $out "Added 'XXX' HTML customization";
32
33
        # Other information
34
        say_failure( $out, "Use red for danger/failure" );
35
        say_success( $out, "Use green for success" );
36
        say_warning( $out, "Use yellow for warning/a call to action" );
37
        say_info( $out, "Use blue for further information" );
38
    },
39
};
(-)a/installer/data/mysql/kohastructure.sql (+1 lines)
Lines 1806-1811 CREATE TABLE `categories` ( Link Here
1806
  `min_password_length` smallint(6) DEFAULT NULL COMMENT 'set minimum password length for patrons in this category',
1806
  `min_password_length` smallint(6) DEFAULT NULL COMMENT 'set minimum password length for patrons in this category',
1807
  `require_strong_password` tinyint(1) DEFAULT NULL COMMENT 'set required password strength for patrons in this category',
1807
  `require_strong_password` tinyint(1) DEFAULT NULL COMMENT 'set required password strength for patrons in this category',
1808
  `exclude_from_local_holds_priority` tinyint(1) DEFAULT NULL COMMENT 'Exclude patrons of this category from local holds priority',
1808
  `exclude_from_local_holds_priority` tinyint(1) DEFAULT NULL COMMENT 'Exclude patrons of this category from local holds priority',
1809
  `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',
1809
  PRIMARY KEY (`categorycode`),
1810
  PRIMARY KEY (`categorycode`),
1810
  UNIQUE KEY `categorycode` (`categorycode`)
1811
  UNIQUE KEY `categorycode` (`categorycode`)
1811
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1812
) 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 468-473 Patrons: Link Here
468
         - pref: FailedLoginAttempts
468
         - pref: FailedLoginAttempts
469
           class: integer
469
           class: integer
470
         - failed login attempts.
470
         - failed login attempts.
471
     -
472
         - pref: ForcePasswordResetWhenSetByStaff
473
           choices:
474
               1: "Force"
475
               0: "Don't force"
476
         - a staff created patron account to reset its password after its first OPAC login.
471
     -
477
     -
472
         - pref: Pseudonymization
478
         - pref: Pseudonymization
473
           choices:
479
           choices:
474
- 

Return to bug 33462