Bug 21992

Summary: Remove Koha::Patron::update_password
Product: Koha Reporter: Tomás Cohen Arazi <tomascohen>
Component: Architecture, internals, and plumbingAssignee: Tomás Cohen Arazi <tomascohen>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: jonathan.druart, martin.renvoize, nick
Version: master   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 21178, 22048    
Bug Blocks:    
Attachments: Bug 21992: Use ->set_password in onboarding.pl
Bug 21992: Use ->set_password in member-password.pl
Bug 21992: Use set_password in memberentry.pl
Bug 21992: Remove use of update_password in create_superlibrarian.pl
Bug 21992: Use set_password opac/opac-password-recovery.pl
Bug 21992: Remove uses of update_password in tests
Bug 21992: Remove unused Koha::Patron->update_password method
Bug 21992: Remove unused Koha::Patron->update_password method
Bug 21992: Remove unused Koha::Patron->update_password method

Description Tomás Cohen Arazi 2018-12-12 16:35:50 UTC
With 21178, we should be using set_password everywhere instead.
Comment 1 Tomás Cohen Arazi 2018-12-26 15:50:30 UTC
Created attachment 83494 [details] [review]
Bug 21992: Use ->set_password in onboarding.pl

To test, verify the onboarding process sets the password correctly.
Comment 2 Tomás Cohen Arazi 2018-12-26 15:50:33 UTC
Created attachment 83495 [details] [review]
Bug 21992: Use ->set_password in member-password.pl

This patch makes member-password.pl use $patron->set_password instead of
update_password. The side effect is that setting password and userid
become separate steps in the code.

For the password all the initial checks are the same, but password
strength is checked on calling set_password and an exception is thrown.
So instead of checking the password quality, we just wait for exceptions
and behave the same as before.

Bonus: you will notice I reused the initially fetched $patron object.
Things get simpler :-D

To test:
- Verify that changing the password / userid for a patron works as usual
Comment 3 Tomás Cohen Arazi 2018-12-26 15:50:37 UTC
Created attachment 83496 [details] [review]
Bug 21992: Use set_password in memberentry.pl

To test:
- Verify that changing the password and userid of a patron by globally
editing they works,
Comment 4 Tomás Cohen Arazi 2018-12-26 15:50:40 UTC
Created attachment 83497 [details] [review]
Bug 21992: Remove use of update_password in create_superlibrarian.pl

In this case we are not using $patron->set_password, because we want to
keep the current behaviour: no checks on the password quality.
Comment 5 Tomás Cohen Arazi 2018-12-26 15:50:43 UTC
Created attachment 83498 [details] [review]
Bug 21992: Use set_password opac/opac-password-recovery.pl
Comment 6 Tomás Cohen Arazi 2018-12-26 15:50:46 UTC
Created attachment 83499 [details] [review]
Bug 21992: Remove uses of update_password in tests
Comment 7 Tomás Cohen Arazi 2018-12-26 16:28:50 UTC
Created attachment 83500 [details] [review]
Bug 21992: Remove unused Koha::Patron->update_password method

This patch removes the no longer used method.

To test:
- Apply this patch
- Run:
  $ git grep update_password
=> SUCCESS: Only references are in Auth_with_ldap.pm and not related
- Sign off :-D
Comment 8 Kyle M Hall 2019-01-02 14:04:24 UTC
Created attachment 83592 [details] [review]
Bug 21992: Remove unused Koha::Patron->update_password method

This patch removes the no longer used method.

To test:
- Apply this patch
- Run:
  $ git grep update_password
=> SUCCESS: Only references are in Auth_with_ldap.pm and not related
- Sign off :-D

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 9 Josef Moravec 2019-01-02 20:39:45 UTC
Created attachment 83604 [details] [review]
Bug 21992: Remove unused Koha::Patron->update_password method

This patch removes the no longer used method.

To test:
- Apply this patch
- Run:
  $ git grep update_password
=> SUCCESS: Only references are in Auth_with_ldap.pm and not related
- Sign off :-D

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 10 Nick Clemens 2019-01-25 20:51:02 UTC
Awesome work all!

Pushed to master for 19.05
Comment 11 Martin Renvoize 2019-01-31 16:57:41 UTC
Enhancement, will not be backported at this time to 18.11.x series.