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

(-)a/installer/data/mysql/atomicupdate/bug_21890_pwd_reset_by_category.perl (+29 lines)
Line 0 Link Here
1
$DBversion = 'XXX';
2
if( CheckVersion( $DBversion ) ) {
3
4
    if ( !column_exists( 'categories', 'can_reset_password' ) ) {
5
        $dbh->do(q{
6
            ALTER TABLE categories
7
                ADD COLUMN can_reset_password TINYINT(1) NOT NULL DEFAULT 0
8
                AFTER checkprevcheckout
9
        });
10
11
        # only change the values if the table
12
        # didn't exits in the first place
13
        $dbh->do(q{
14
            UPDATE categories
15
                SET can_reset_password=(
16
                    SELECT COALESCE(value,'0')
17
                    FROM systempreferences
18
                    WHERE variable='OpacResetPassword')
19
        });
20
    }
21
22
    $dbh->do(q{
23
        DELETE FROM systempreferences
24
        WHERE variable='OpacResetPassword'
25
    });
26
27
    SetVersion( $DBversion );
28
    print "Upgrade to $DBversion done (Bug 21890 - Patron password reset by category)\n";
29
}
(-)a/installer/data/mysql/kohastructure.sql (+1 lines)
Lines 318-323 CREATE TABLE `categories` ( -- this table shows information related to Koha patr Link Here
318
  `BlockExpiredPatronOpacActions` tinyint(1) NOT NULL default '-1', -- wheither or not a patron of this category can renew books or place holds once their card has expired. 0 means they can, 1 means they cannot, -1 means use syspref BlockExpiredPatronOpacActions
318
  `BlockExpiredPatronOpacActions` tinyint(1) NOT NULL default '-1', -- wheither or not a patron of this category can renew books or place holds once their card has expired. 0 means they can, 1 means they cannot, -1 means use syspref BlockExpiredPatronOpacActions
319
  `default_privacy` ENUM( 'default', 'never', 'forever' ) NOT NULL DEFAULT 'default', -- Default privacy setting for this patron category
319
  `default_privacy` ENUM( 'default', 'never', 'forever' ) NOT NULL DEFAULT 'default', -- Default privacy setting for this patron category
320
  `checkprevcheckout` varchar(7) NOT NULL default 'inherit', -- produce a warning for this patron category if this item has previously been checked out to this patron if 'yes', not if 'no', defer to syspref setting if 'inherit'.
320
  `checkprevcheckout` varchar(7) NOT NULL default 'inherit', -- produce a warning for this patron category if this item has previously been checked out to this patron if 'yes', not if 'no', defer to syspref setting if 'inherit'.
321
  `can_reset_password` TINYINT(1) NOT NULL DEFAULT 0, -- if patrons of this category can do the password reset flow
321
  PRIMARY KEY  (`categorycode`),
322
  PRIMARY KEY  (`categorycode`),
322
  UNIQUE KEY `categorycode` (`categorycode`)
323
  UNIQUE KEY `categorycode` (`categorycode`)
323
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
324
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
(-)a/installer/data/mysql/sysprefs.sql (-1 lines)
Lines 397-403 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
397
('opacreadinghistory','1','','If ON, enables display of Patron Circulation History in OPAC','YesNo'),
397
('opacreadinghistory','1','','If ON, enables display of Patron Circulation History in OPAC','YesNo'),
398
('OpacRenewalAllowed','0',NULL,'If ON, users can renew their issues directly from their OPAC account','YesNo'),
398
('OpacRenewalAllowed','0',NULL,'If ON, users can renew their issues directly from their OPAC account','YesNo'),
399
('OpacRenewalBranch','checkoutbranch','itemhomebranch|patronhomebranch|checkoutbranch|null','Choose how the branch for an OPAC renewal is recorded in statistics','Choice'),
399
('OpacRenewalBranch','checkoutbranch','itemhomebranch|patronhomebranch|checkoutbranch|null','Choose how the branch for an OPAC renewal is recorded in statistics','Choice'),
400
('OpacResetPassword','0','','Shows the ''Forgot your password?'' link in the OPAC','YesNo'),
401
('OPACResultsLibrary', 'homebranch', 'homebranch|holdingbranch', 'Defines whether the OPAC displays the holding or home branch in search results when using XSLT', 'Choice'),
400
('OPACResultsLibrary', 'homebranch', 'homebranch|holdingbranch', 'Defines whether the OPAC displays the holding or home branch in search results when using XSLT', 'Choice'),
402
('OPACResultsSidebar','','70|10','Define HTML to be included on the search results page, underneath the facets sidebar','Textarea'),
401
('OPACResultsSidebar','','70|10','Define HTML to be included on the search results page, underneath the facets sidebar','Textarea'),
403
('OPACSearchForTitleIn','<li><a  href=\"http://worldcat.org/search?q={TITLE}\" target=\"_blank\">Other Libraries (WorldCat)</a></li>\n<li><a href=\"https://scholar.google.com/scholar?q={TITLE}\" target=\"_blank\">Other Databases (Google Scholar)</a></li>\n<li><a href=\"http://www.bookfinder.com/search/?author={AUTHOR}&amp;title={TITLE}&amp;st=xl&amp;ac=qr\" target=\"_blank\">Online Stores (Bookfinder.com)</a></li>\n<li><a href=\"https://openlibrary.org/search/?author=({AUTHOR})&title=({TITLE})\" target=\"_blank\">Open Library (openlibrary.org)</a></li>','70|10','Enter the HTML that will appear in the \'Search for this title in\' box on the detail page in the OPAC.  Enter {TITLE}, {AUTHOR}, or {ISBN} in place of their respective variables in the URL. Leave blank to disable \'More Searches\' menu.','Textarea'),
402
('OPACSearchForTitleIn','<li><a  href=\"http://worldcat.org/search?q={TITLE}\" target=\"_blank\">Other Libraries (WorldCat)</a></li>\n<li><a href=\"https://scholar.google.com/scholar?q={TITLE}\" target=\"_blank\">Other Databases (Google Scholar)</a></li>\n<li><a href=\"http://www.bookfinder.com/search/?author={AUTHOR}&amp;title={TITLE}&amp;st=xl&amp;ac=qr\" target=\"_blank\">Online Stores (Bookfinder.com)</a></li>\n<li><a href=\"https://openlibrary.org/search/?author=({AUTHOR})&title=({TITLE})\" target=\"_blank\">Open Library (openlibrary.org)</a></li>','70|10','Enter the HTML that will appear in the \'Search for this title in\' box on the detail page in the OPAC.  Enter {TITLE}, {AUTHOR}, or {ISBN} in place of their respective variables in the URL. Leave blank to disable \'More Searches\' menu.','Textarea'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (-9 lines)
Lines 365-378 OPAC: Link Here
365
                  yes: Allow
365
                  yes: Allow
366
                  no: "Don't allow"
366
                  no: "Don't allow"
367
            - patrons to change their own password on the OPAC. Note that this must be off to use LDAP authentication.
367
            - patrons to change their own password on the OPAC. Note that this must be off to use LDAP authentication.
368
        -
369
            - "Library users are "
370
            - pref: OpacResetPassword
371
              default: 1
372
              choices:
373
                  yes: "allowed"
374
                  no: "not allowed"
375
            - " to recover their password via e-mail in the OPAC"
376
        -
368
        -
377
            - pref: OPACPatronDetails
369
            - pref: OPACPatronDetails
378
              choices:
370
              choices:
379
- 

Return to bug 21890