Created attachment 129705 [details] [review] Bug 29924: Database updates
Created attachment 129706 [details] [review] Bug 29924: DO NOT PUSH - Schema updates
Created attachment 129707 [details] [review] Bug 29924: Add password expiration feature This patch adds the ability to define password_expiry_days for a patron category. When defined a patron's password will expire after X days and they will be required to reset their password. If OPAC resets are enabled for the catgeory they may do so on their own, otherwise they will need to contact the library To test: 1 - Apply patch, updatedatabase 2 - Set 'Password expiration' for a patron category Home->Administration->Patron categories->Edit 3 - Create a new patron in this category with a userid/password set, and an email 4 - Confirm their password_expiration field is set SELECT password_expiration FROM borrowers WHERE borrowernumber=51; 5 - Create a new patron, do not set a password 6 - Confirm their password_expiration field is NULL 7 - Update the patron with an expiration to be expired UPDATE borrowers SET password_expiration='2022-01-01' WHERE borrowernumber=51; 8 - Give the borrower catalogue permission 9 - Attempt to log in to Straff interface 10 - Confirm you are signed out and notified that password must be reset 11 - Attempt to sign in to OPAC 12 - Confirm you are signed out and notified password must be reset 13 - Enable password reset for the patron's category and perform a password reset Note: you will have to find the link in the message_queue unless you have emails setup on your test environment SELECT * FROM message_queue WHERE borrowernumber=51; 14 - Confirm that you cna now sign in and password_expiration field is set 10 days in the future 15 - Expire the patron's password again 16 - Chaneg the patron's password via the staff interface 17 - Confirm they can sign in and the expiration is updated
Created attachment 129708 [details] [review] Bug 29924: Unit tests
Created attachment 129762 [details] [review] Bug 29924: Database updates Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Created attachment 129763 [details] [review] Bug 29924: DO NOT PUSH - Schema updates Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Created attachment 129764 [details] [review] Bug 29924: Add password expiration feature This patch adds the ability to define password_expiry_days for a patron category. When defined a patron's password will expire after X days and they will be required to reset their password. If OPAC resets are enabled for the catgeory they may do so on their own, otherwise they will need to contact the library To test: 1 - Apply patch, updatedatabase 2 - Set 'Password expiration' for a patron category Home-> Administration-> Patron categories-> Edit 3 - Create a new patron in this category with a userid/password set, and an email 4 - Confirm their password_expiration_date field is set SELECT password_expiration_date FROM borrowers WHERE borrowernumber=51; 5 - Create a new patron, do not set a password 6 - Confirm their password_expiration_date field is NULL 7 - Update the patron with an expiration to be expired UPDATE borrowers SET password_expiration_date='2022-01-01' WHERE borrowernumber=51; 8 - Give the borrower catalogue permission 9 - Attempt to log in to Straff interface 10 - Confirm you are signed out and notified that password must be reset 11 - Attempt to sign in to OPAC 12 - Confirm you are signed out and notified password must be reset 13 - Enable password reset for the patron's category and perform a password reset Note: you will have to find the link in the message_queue unless you have emails setup on your test environment SELECT * FROM message_queue WHERE borrowernumber=51; 14 - Confirm that you can now sign in and password_expiration_date field is set 10 days in the future 15 - Expire the patron's password again 16 - Change the patron's password via the staff interface 17 - Confirm they can sign in and the expiration is updated Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Created attachment 129765 [details] [review] Bug 29924: Unit tests Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Created attachment 129766 [details] [review] Bug 29924: (follow-up) Add bug number to atomicupdate; Style OPAC message - The atomicupdate didn't have "bug_number" defined. - The "Your password has expired" message is now styled with the same class as other OPAC login messages.
Some thoughts: - Why is the "Your password has expired" page in the OPAC empty, whereas the "Incorrect password" page shows the search bar and the other search links? - Should we show the password expiration on the patron detail page? Under the password line? - Should we show a (non-blocking) warning on the checkout page when a patron's password has expired like we do when their account has expired?
Created attachment 129823 [details] [review] Bug 29924: (follow-up) Generate necessary template variables before output
(In reply to Owen Leonard from comment #10) > Some thoughts: > > - Why is the "Your password has expired" page in the OPAC empty, whereas the > "Incorrect password" page shows the search bar and the other search links? Fixed - we generate a lot of necessary content for the template in the routine, so I delay the output until the end > - Should we show the password expiration on the patron detail page? Under > the password line? > > - Should we show a (non-blocking) warning on the checkout page when a > patron's password has expired like we do when their account has expired? I am not sure on these, on other systems where my password expires I don't see these. It is debatable whether general staff need to know this, I think these options would need to be configurable, open a follow-up bug?
Created attachment 129953 [details] [review] Bug 29924: Database updates Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Created attachment 129954 [details] [review] Bug 29924: DO NOT PUSH - Schema updates Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Created attachment 129955 [details] [review] Bug 29924: Add password expiration feature This patch adds the ability to define password_expiry_days for a patron category. When defined a patron's password will expire after X days and they will be required to reset their password. If OPAC resets are enabled for the catgeory they may do so on their own, otherwise they will need to contact the library To test: 1 - Apply patch, updatedatabase 2 - Set 'Password expiration' for a patron category Home-> Administration-> Patron categories-> Edit 3 - Create a new patron in this category with a userid/password set, and an email 4 - Confirm their password_expiration_date field is set SELECT password_expiration_date FROM borrowers WHERE borrowernumber=51; 5 - Create a new patron, do not set a password 6 - Confirm their password_expiration_date field is NULL 7 - Update the patron with an expiration to be expired UPDATE borrowers SET password_expiration_date='2022-01-01' WHERE borrowernumber=51; 8 - Give the borrower catalogue permission 9 - Attempt to log in to Straff interface 10 - Confirm you are signed out and notified that password must be reset 11 - Attempt to sign in to OPAC 12 - Confirm you are signed out and notified password must be reset 13 - Enable password reset for the patron's category and perform a password reset Note: you will have to find the link in the message_queue unless you have emails setup on your test environment SELECT * FROM message_queue WHERE borrowernumber=51; 14 - Confirm that you can now sign in and password_expiration_date field is set 10 days in the future 15 - Expire the patron's password again 16 - Change the patron's password via the staff interface 17 - Confirm they can sign in and the expiration is updated
Created attachment 129956 [details] [review] Bug 29924: Unit tests
Created attachment 129957 [details] [review] Bug 29924: (follow-up) Add bug number to atomicupdate; Style OPAC message - The atomicupdate didn't have "bug_number" defined. - The "Your password has expired" message is now styled with the same class as other OPAC login messages.
Created attachment 130116 [details] [review] Bug 29924: Database updates Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Created attachment 130117 [details] [review] Bug 29924: DO NOT PUSH - Schema updates Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Created attachment 130118 [details] [review] Bug 29924: Add password expiration feature This patch adds the ability to define password_expiry_days for a patron category. When defined a patron's password will expire after X days and they will be required to reset their password. If OPAC resets are enabled for the catgeory they may do so on their own, otherwise they will need to contact the library To test: 1 - Apply patch, updatedatabase 2 - Set 'Password expiration' for a patron category Home-> Administration-> Patron categories-> Edit 3 - Create a new patron in this category with a userid/password set, and an email 4 - Confirm their password_expiration_date field is set SELECT password_expiration_date FROM borrowers WHERE borrowernumber=51; 5 - Create a new patron, do not set a password 6 - Confirm their password_expiration_date field is NULL 7 - Update the patron with an expiration to be expired UPDATE borrowers SET password_expiration_date='2022-01-01' WHERE borrowernumber=51; 8 - Give the borrower catalogue permission 9 - Attempt to log in to Straff interface 10 - Confirm you are signed out and notified that password must be reset 11 - Attempt to sign in to OPAC 12 - Confirm you are signed out and notified password must be reset 13 - Enable password reset for the patron's category and perform a password reset Note: you will have to find the link in the message_queue unless you have emails setup on your test environment SELECT * FROM message_queue WHERE borrowernumber=51; 14 - Confirm that you can now sign in and password_expiration_date field is set 10 days in the future 15 - Expire the patron's password again 16 - Change the patron's password via the staff interface 17 - Confirm they can sign in and the expiration is updated
Created attachment 130119 [details] [review] Bug 29924: Unit tests
Created attachment 130120 [details] [review] Bug 29924: (follow-up) Add bug number to atomicupdate; Style OPAC message - The atomicupdate didn't have "bug_number" defined. - The "Your password has expired" message is now styled with the same class as other OPAC login messages.
Created attachment 130495 [details] [review] Bug 29924: (follow-up) Add password_expiration_date to API
Created attachment 130500 [details] [review] Bug 29924: Database updates Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Created attachment 130501 [details] [review] Bug 29924: DO NOT PUSH - Schema updates Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Created attachment 130502 [details] [review] Bug 29924: Add password expiration feature This patch adds the ability to define password_expiry_days for a patron category. When defined a patron's password will expire after X days and they will be required to reset their password. If OPAC resets are enabled for the catgeory they may do so on their own, otherwise they will need to contact the library To test: 1 - Apply patch, updatedatabase 2 - Set 'Password expiration' for a patron category Home-> Administration-> Patron categories-> Edit 3 - Create a new patron in this category with a userid/password set, and an email 4 - Confirm their password_expiration_date field is set SELECT password_expiration_date FROM borrowers WHERE borrowernumber=51; 5 - Create a new patron, do not set a password 6 - Confirm their password_expiration_date field is NULL 7 - Update the patron with an expiration to be expired UPDATE borrowers SET password_expiration_date='2022-01-01' WHERE borrowernumber=51; 8 - Give the borrower catalogue permission 9 - Attempt to log in to Straff interface 10 - Confirm you are signed out and notified that password must be reset 11 - Attempt to sign in to OPAC 12 - Confirm you are signed out and notified password must be reset 13 - Enable password reset for the patron's category and perform a password reset Note: you will have to find the link in the message_queue unless you have emails setup on your test environment SELECT * FROM message_queue WHERE borrowernumber=51; 14 - Confirm that you can now sign in and password_expiration_date field is set 10 days in the future 15 - Expire the patron's password again 16 - Change the patron's password via the staff interface 17 - Confirm they can sign in and the expiration is updated Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Created attachment 130503 [details] [review] Bug 29924: Unit tests Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Created attachment 130504 [details] [review] Bug 29924: (follow-up) Add bug number to atomicupdate; Style OPAC message - The atomicupdate didn't have "bug_number" defined. - The "Your password has expired" message is now styled with the same class as other OPAC login messages.
Created attachment 130505 [details] [review] Bug 29924: (follow-up) Add password_expiration_date to API Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Created attachment 130557 [details] [review] Bug 29924: Database updates Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Created attachment 130558 [details] [review] Bug 29924: DO NOT PUSH - Schema updates Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Created attachment 130559 [details] [review] Bug 29924: Add password expiration feature This patch adds the ability to define password_expiry_days for a patron category. When defined a patron's password will expire after X days and they will be required to reset their password. If OPAC resets are enabled for the catgeory they may do so on their own, otherwise they will need to contact the library To test: 1 - Apply patch, updatedatabase 2 - Set 'Password expiration' for a patron category Home-> Administration-> Patron categories-> Edit 3 - Create a new patron in this category with a userid/password set, and an email 4 - Confirm their password_expiration_date field is set SELECT password_expiration_date FROM borrowers WHERE borrowernumber=51; 5 - Create a new patron, do not set a password 6 - Confirm their password_expiration_date field is NULL 7 - Update the patron with an expiration to be expired UPDATE borrowers SET password_expiration_date='2022-01-01' WHERE borrowernumber=51; 8 - Give the borrower catalogue permission 9 - Attempt to log in to Straff interface 10 - Confirm you are signed out and notified that password must be reset 11 - Attempt to sign in to OPAC 12 - Confirm you are signed out and notified password must be reset 13 - Enable password reset for the patron's category and perform a password reset Note: you will have to find the link in the message_queue unless you have emails setup on your test environment SELECT * FROM message_queue WHERE borrowernumber=51; 14 - Confirm that you can now sign in and password_expiration_date field is set 10 days in the future 15 - Expire the patron's password again 16 - Change the patron's password via the staff interface 17 - Confirm they can sign in and the expiration is updated Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Created attachment 130560 [details] [review] Bug 29924: Unit tests Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Created attachment 130561 [details] [review] Bug 29924: (follow-up) Add bug number to atomicupdate; Style OPAC message - The atomicupdate didn't have "bug_number" defined. - The "Your password has expired" message is now styled with the same class as other OPAC login messages. Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Created attachment 130562 [details] [review] Bug 29924: (follow-up) Add password_expiration_date to API Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Created attachment 130563 [details] [review] Bug 29924: (follow-up) Adjust test count
Created attachment 130677 [details] [review] Bug 29924: Database updates Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Bob Bennhoff <bbennhoff@clicweb.org>
Created attachment 130678 [details] [review] Bug 29924: DO NOT PUSH - Schema updates Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Bob Bennhoff <bbennhoff@clicweb.org>
Created attachment 130679 [details] [review] Bug 29924: Add password expiration feature This patch adds the ability to define password_expiry_days for a patron category. When defined a patron's password will expire after X days and they will be required to reset their password. If OPAC resets are enabled for the catgeory they may do so on their own, otherwise they will need to contact the library To test: 1 - Apply patch, updatedatabase 2 - Set 'Password expiration' for a patron category Home-> Administration-> Patron categories-> Edit 3 - Create a new patron in this category with a userid/password set, and an email 4 - Confirm their password_expiration_date field is set SELECT password_expiration_date FROM borrowers WHERE borrowernumber=51; 5 - Create a new patron, do not set a password 6 - Confirm their password_expiration_date field is NULL 7 - Update the patron with an expiration to be expired UPDATE borrowers SET password_expiration_date='2022-01-01' WHERE borrowernumber=51; 8 - Give the borrower catalogue permission 9 - Attempt to log in to Straff interface 10 - Confirm you are signed out and notified that password must be reset 11 - Attempt to sign in to OPAC 12 - Confirm you are signed out and notified password must be reset 13 - Enable password reset for the patron's category and perform a password reset Note: you will have to find the link in the message_queue unless you have emails setup on your test environment SELECT * FROM message_queue WHERE borrowernumber=51; 14 - Confirm that you can now sign in and password_expiration_date field is set 10 days in the future 15 - Expire the patron's password again 16 - Change the patron's password via the staff interface 17 - Confirm they can sign in and the expiration is updated Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Bob Bennhoff <bbennhoff@clicweb.org>
Created attachment 130680 [details] [review] Bug 29924: Unit tests Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Bob Bennhoff <bbennhoff@clicweb.org>
Created attachment 130681 [details] [review] Bug 29924: (follow-up) Add bug number to atomicupdate; Style OPAC message - The atomicupdate didn't have "bug_number" defined. - The "Your password has expired" message is now styled with the same class as other OPAC login messages. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Bob Bennhoff <bbennhoff@clicweb.org>
Created attachment 130682 [details] [review] Bug 29924: (follow-up) Add password_expiration_date to API Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Bob Bennhoff <bbennhoff@clicweb.org>
Created attachment 130683 [details] [review] Bug 29924: (follow-up) Adjust test count Signed-off-by: Bob Bennhoff <bbennhoff@clicweb.org>
Created attachment 131128 [details] [review] Bug 29924: (follow-up) Add default value undef for TestBuilder
Created attachment 132059 [details] [review] Bug 29924: Database updates Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Bob Bennhoff <bbennhoff@clicweb.org>
Created attachment 132060 [details] [review] Bug 29924: Add password expiration feature This patch adds the ability to define password_expiry_days for a patron category. When defined a patron's password will expire after X days and they will be required to reset their password. If OPAC resets are enabled for the catgeory they may do so on their own, otherwise they will need to contact the library To test: 1 - Apply patch, updatedatabase 2 - Set 'Password expiration' for a patron category Home-> Administration-> Patron categories-> Edit 3 - Create a new patron in this category with a userid/password set, and an email 4 - Confirm their password_expiration_date field is set SELECT password_expiration_date FROM borrowers WHERE borrowernumber=51; 5 - Create a new patron, do not set a password 6 - Confirm their password_expiration_date field is NULL 7 - Update the patron with an expiration to be expired UPDATE borrowers SET password_expiration_date='2022-01-01' WHERE borrowernumber=51; 8 - Give the borrower catalogue permission 9 - Attempt to log in to Straff interface 10 - Confirm you are signed out and notified that password must be reset 11 - Attempt to sign in to OPAC 12 - Confirm you are signed out and notified password must be reset 13 - Enable password reset for the patron's category and perform a password reset Note: you will have to find the link in the message_queue unless you have emails setup on your test environment SELECT * FROM message_queue WHERE borrowernumber=51; 14 - Confirm that you can now sign in and password_expiration_date field is set 10 days in the future 15 - Expire the patron's password again 16 - Change the patron's password via the staff interface 17 - Confirm they can sign in and the expiration is updated Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Bob Bennhoff <bbennhoff@clicweb.org>
Created attachment 132061 [details] [review] Bug 29924: Unit tests Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Bob Bennhoff <bbennhoff@clicweb.org>
Created attachment 132062 [details] [review] Bug 29924: (follow-up) Add bug number to atomicupdate; Style OPAC message - The atomicupdate didn't have "bug_number" defined. - The "Your password has expired" message is now styled with the same class as other OPAC login messages. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Bob Bennhoff <bbennhoff@clicweb.org>
Created attachment 132063 [details] [review] Bug 29924: (follow-up) Add password_expiration_date to API Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Bob Bennhoff <bbennhoff@clicweb.org>
Created attachment 132064 [details] [review] Bug 29924: (follow-up) Add default value undef for TestBuilder
Created attachment 132065 [details] [review] Bug 29924: DO NOT PUSH - Schema updates
Created attachment 132066 [details] [review] Bug 29924: Update ILSDI to be aware of expired passwords To test: 1 - Enable ILSDI 2 - Set a patron password with expired password 3 - http://localhost:8080/cgi-bin/koha/ilsdi.pl?service=AuthenticatePatron&username=usernam&password=password 4 - Confirm 'PasswordExpired' returned
Created attachment 132084 [details] [review] Bug 29924: Update ILSDI to be aware of expired passwords To test: 1 - Enable ILSDI 2 - Set a patron password with expired password 3 - http://localhost:8080/cgi-bin/koha/ilsdi.pl?service=AuthenticatePatron&username=usernam&password=password 4 - Confirm 'PasswordExpired' returned
Created attachment 132085 [details] [review] Bug 29924: Database updates Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Bob Bennhoff <bbennhoff@clicweb.org> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Created attachment 132086 [details] [review] Bug 29924: Add password expiration feature This patch adds the ability to define password_expiry_days for a patron category. When defined a patron's password will expire after X days and they will be required to reset their password. If OPAC resets are enabled for the catgeory they may do so on their own, otherwise they will need to contact the library To test: 1 - Apply patch, updatedatabase 2 - Set 'Password expiration' for a patron category Home-> Administration-> Patron categories-> Edit 3 - Create a new patron in this category with a userid/password set, and an email 4 - Confirm their password_expiration_date field is set SELECT password_expiration_date FROM borrowers WHERE borrowernumber=51; 5 - Create a new patron, do not set a password 6 - Confirm their password_expiration_date field is NULL 7 - Update the patron with an expiration to be expired UPDATE borrowers SET password_expiration_date='2022-01-01' WHERE borrowernumber=51; 8 - Give the borrower catalogue permission 9 - Attempt to log in to Straff interface 10 - Confirm you are signed out and notified that password must be reset 11 - Attempt to sign in to OPAC 12 - Confirm you are signed out and notified password must be reset 13 - Enable password reset for the patron's category and perform a password reset Note: you will have to find the link in the message_queue unless you have emails setup on your test environment SELECT * FROM message_queue WHERE borrowernumber=51; 14 - Confirm that you can now sign in and password_expiration_date field is set 10 days in the future 15 - Expire the patron's password again 16 - Change the patron's password via the staff interface 17 - Confirm they can sign in and the expiration is updated Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Bob Bennhoff <bbennhoff@clicweb.org> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Created attachment 132087 [details] [review] Bug 29924: Unit tests Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Bob Bennhoff <bbennhoff@clicweb.org> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Created attachment 132088 [details] [review] Bug 29924: (follow-up) Add bug number to atomicupdate; Style OPAC message - The atomicupdate didn't have "bug_number" defined. - The "Your password has expired" message is now styled with the same class as other OPAC login messages. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Bob Bennhoff <bbennhoff@clicweb.org> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Created attachment 132089 [details] [review] Bug 29924: (follow-up) Add password_expiration_date to API Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Bob Bennhoff <bbennhoff@clicweb.org> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Created attachment 132090 [details] [review] Bug 29924: (follow-up) Add default value undef for TestBuilder Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Created attachment 132091 [details] [review] Bug 29924: DO NOT PUSH - Schema updates Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Created attachment 132092 [details] [review] Bug 29924: Update ILSDI to be aware of expired passwords To test: 1 - Enable ILSDI 2 - Set a patron password with expired password 3 - http://localhost:8080/cgi-bin/koha/ilsdi.pl?service=AuthenticatePatron&username=usernam&password=password 4 - Confirm 'PasswordExpired' returned Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Nick, do you *need* the password expiration on the API response? Can we remove it and have a separate route for dealing with that? It will become tricky with security, and also in light of the discussion on bug 28786 and friends, I think we should expose it in some other way if required.
Please rebase.
Also interesting in testing this once rebased :)
Created attachment 133741 [details] [review] Bug 29924: Database updates Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Bob Bennhoff <bbennhoff@clicweb.org> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Created attachment 133742 [details] [review] Bug 29924: Add password expiration feature This patch adds the ability to define password_expiry_days for a patron category. When defined a patron's password will expire after X days and they will be required to reset their password. If OPAC resets are enabled for the catgeory they may do so on their own, otherwise they will need to contact the library To test: 1 - Apply patch, updatedatabase 2 - Set 'Password expiration' for a patron category Home-> Administration-> Patron categories-> Edit 3 - Create a new patron in this category with a userid/password set, and an email 4 - Confirm their password_expiration_date field is set SELECT password_expiration_date FROM borrowers WHERE borrowernumber=51; 5 - Create a new patron, do not set a password 6 - Confirm their password_expiration_date field is NULL 7 - Update the patron with an expiration to be expired UPDATE borrowers SET password_expiration_date='2022-01-01' WHERE borrowernumber=51; 8 - Give the borrower catalogue permission 9 - Attempt to log in to Straff interface 10 - Confirm you are signed out and notified that password must be reset 11 - Attempt to sign in to OPAC 12 - Confirm you are signed out and notified password must be reset 13 - Enable password reset for the patron's category and perform a password reset Note: you will have to find the link in the message_queue unless you have emails setup on your test environment SELECT * FROM message_queue WHERE borrowernumber=51; 14 - Confirm that you can now sign in and password_expiration_date field is set 10 days in the future 15 - Expire the patron's password again 16 - Change the patron's password via the staff interface 17 - Confirm they can sign in and the expiration is updated Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Bob Bennhoff <bbennhoff@clicweb.org> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Created attachment 133743 [details] [review] Bug 29924: Unit tests Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Bob Bennhoff <bbennhoff@clicweb.org> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Created attachment 133744 [details] [review] Bug 29924: (follow-up) Add bug number to atomicupdate; Style OPAC message - The atomicupdate didn't have "bug_number" defined. - The "Your password has expired" message is now styled with the same class as other OPAC login messages. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Bob Bennhoff <bbennhoff@clicweb.org> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Created attachment 133745 [details] [review] Bug 29924: (follow-up) Add password_expiration_date to API Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Bob Bennhoff <bbennhoff@clicweb.org> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Created attachment 133746 [details] [review] Bug 29924: (follow-up) Add default value undef for TestBuilder Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Created attachment 133747 [details] [review] Bug 29924: Update ILSDI to be aware of expired passwords To test: 1 - Enable ILSDI 2 - Set a patron password with expired password 3 - http://localhost:8080/cgi-bin/koha/ilsdi.pl?service=AuthenticatePatron&username=usernam&password=password 4 - Confirm 'PasswordExpired' returned Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Created attachment 133748 [details] [review] Bug 29924: DO NOT PUSH - Schema updates
Created attachment 133801 [details] [review] Bug 29924: Database updates Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Bob Bennhoff <bbennhoff@clicweb.org> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 133802 [details] [review] Bug 29924: Add password expiration feature This patch adds the ability to define password_expiry_days for a patron category. When defined a patron's password will expire after X days and they will be required to reset their password. If OPAC resets are enabled for the catgeory they may do so on their own, otherwise they will need to contact the library To test: 1 - Apply patch, updatedatabase 2 - Set 'Password expiration' for a patron category Home-> Administration-> Patron categories-> Edit 3 - Create a new patron in this category with a userid/password set, and an email 4 - Confirm their password_expiration_date field is set SELECT password_expiration_date FROM borrowers WHERE borrowernumber=51; 5 - Create a new patron, do not set a password 6 - Confirm their password_expiration_date field is NULL 7 - Update the patron with an expiration to be expired UPDATE borrowers SET password_expiration_date='2022-01-01' WHERE borrowernumber=51; 8 - Give the borrower catalogue permission 9 - Attempt to log in to Straff interface 10 - Confirm you are signed out and notified that password must be reset 11 - Attempt to sign in to OPAC 12 - Confirm you are signed out and notified password must be reset 13 - Enable password reset for the patron's category and perform a password reset Note: you will have to find the link in the message_queue unless you have emails setup on your test environment SELECT * FROM message_queue WHERE borrowernumber=51; 14 - Confirm that you can now sign in and password_expiration_date field is set 10 days in the future 15 - Expire the patron's password again 16 - Change the patron's password via the staff interface 17 - Confirm they can sign in and the expiration is updated Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Bob Bennhoff <bbennhoff@clicweb.org> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 133803 [details] [review] Bug 29924: Unit tests Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Bob Bennhoff <bbennhoff@clicweb.org> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 133804 [details] [review] Bug 29924: (follow-up) Add bug number to atomicupdate; Style OPAC message - The atomicupdate didn't have "bug_number" defined. - The "Your password has expired" message is now styled with the same class as other OPAC login messages. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Bob Bennhoff <bbennhoff@clicweb.org> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 133805 [details] [review] Bug 29924: (follow-up) Add password_expiration_date to API Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Bob Bennhoff <bbennhoff@clicweb.org> Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 133806 [details] [review] Bug 29924: (follow-up) Add default value undef for TestBuilder Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 133807 [details] [review] Bug 29924: Update ILSDI to be aware of expired passwords To test: 1 - Enable ILSDI 2 - Set a patron password with expired password 3 - http://localhost:8080/cgi-bin/koha/ilsdi.pl?service=AuthenticatePatron&username=usernam&password=password 4 - Confirm 'PasswordExpired' returned Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 133808 [details] [review] Bug 29924: DO NOT PUSH - Schema updates Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 133809 [details] [review] Bug 29924: (QA follow-up) Remove password_expiration_date from API Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 133810 [details] [review] Bug 29924: Add tests for API Basic auth behavior Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 133989 [details] [review] Bug 29924: Avoid leaking information on wrong credentials If the passed credentials are wrong, we shouldn't expose things like the password is expired. This patch takes care of that. To test: 1. Have a known patron with password_expiration_date set so its password is expired. Can be done like: $ koha-mysql kohadev > UPDATE borrowers \ SET password_expiration_date='2022-04-25' \ WHERE borrowernumber=132; Note: change the borrowernumber 2. Attempt to login to the OPAC with wrong credentials => SUCCESS: You are rejected, with a message telling credentials are wrong => FAIL: You are told the password is expired. 3. Apply this patch and restart Plack 4. Repeat 2 => SUCCESS: You are rejected, credentials are wrong and no mention to password being expired. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Great new feature. Sorry it is too short to be in 22.05 release. Will be in good hands during next cycle :D
Created attachment 134758 [details] [review] Bug 29924: (follow-up) Fix t/db_dependent/Koha/Patron.t number of tests
(In reply to Fridolin Somers from comment #84) > Great new feature. > Sorry it is too short to be in 22.05 release. > Will be in good hands during next cycle :D I've been asked to reconsider. Since it applies and is by default disabled I change my mind and push ;)
Pushed to master for 22.05, thanks to everybody involved [U+1F984]