Bug 10796 - Allow password changes for logged in OPAC users by patron category
Summary: Allow password changes for logged in OPAC users by patron category
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Tomás Cohen Arazi (tcohen)
QA Contact: Martin Renvoize (ashimema)
URL:
Keywords:
Depends on: 21890
Blocks: 29272
  Show dependency treegraph
 
Reported: 2013-08-28 08:48 UTC by Katrin Fischer
Modified: 2021-10-19 13:27 UTC (History)
8 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Libraries can now specify which patrons are allowed to change their password when logged into the OPAC, per patron category. A common use case for this would be a system that combines LDAP (or other external authentication) patrons and local Koha patrons. This feature will allow libraries to present a better user experience for password management to all of their patrons, no matter how they are authenticated.
Version(s) released in:
19.05.00
Circulation function:


Attachments
Bug 10796: DB update (2.63 KB, patch)
2019-02-20 17:09 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 10796: Add Koha::Patron::Category->effective_change_password method (3.95 KB, patch)
2019-02-20 17:09 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 10796: Handle can_change_password on the staff interface (4.81 KB, patch)
2019-02-20 17:09 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 10796: Use $category->effective_change_password in the OPAC (6.72 KB, patch)
2019-02-20 17:09 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 10796: DBIC update (1.32 KB, patch)
2019-02-20 17:10 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 10796: DB update (2.68 KB, patch)
2019-03-27 19:28 UTC, Liz Rea
Details | Diff | Splinter Review
Bug 10796: Add Koha::Patron::Category->effective_change_password method (4.00 KB, patch)
2019-03-27 19:28 UTC, Liz Rea
Details | Diff | Splinter Review
Bug 10796: Handle can_change_password on the staff interface (4.86 KB, patch)
2019-03-27 19:28 UTC, Liz Rea
Details | Diff | Splinter Review
Bug 10796: Use $category->effective_change_password in the OPAC (6.81 KB, patch)
2019-03-27 19:28 UTC, Liz Rea
Details | Diff | Splinter Review
Bug 10796: (QA Follow-up) Changing password recovery verbiage for users who are disallowed online password resets (1.40 KB, patch)
2019-03-27 19:28 UTC, Liz Rea
Details | Diff | Splinter Review
Bug 10796: DB update (2.73 KB, patch)
2019-04-01 18:23 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 10796: Add Koha::Patron::Category->effective_change_password method (4.06 KB, patch)
2019-04-01 18:23 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 10796: Handle can_change_password on the staff interface (4.91 KB, patch)
2019-04-01 18:23 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 10796: Use $category->effective_change_password in the OPAC (6.69 KB, patch)
2019-04-01 18:23 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 10796: (QA follow-up) Changing password recovery verbiage for users who are disallowed online password resets (1.46 KB, patch)
2019-04-01 18:23 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2013-08-28 08:48:07 UTC
When using LDAP or another central authentication you don't want patrons to change passwords in the OPAC, but at the same time you might have local users that should be allowed to change their password.

I think it would be nice if we could move OpacPasswordChange from a global system preference to the patron category confguration page.

This is similar to bug 3032 - but would not be per patron, but only per patron category.
Comment 1 Tomás Cohen Arazi (tcohen) 2019-02-20 17:09:47 UTC
Created attachment 85389 [details] [review]
Bug 10796: DB update
Comment 2 Tomás Cohen Arazi (tcohen) 2019-02-20 17:09:50 UTC
Created attachment 85390 [details] [review]
Bug 10796: Add Koha::Patron::Category->effective_change_password method

This method checks whether the local $self->change_password is set to
override the OpacPasswordChange syspref (i.e. if it is set to a
bool) or undef, in which case it falls back to the value of the syspref

To test:
- Apply this patches
- Make sure the DB is updated:
  $ updatedatabase
- Update the schema files:
  $ dbic
- Run:
  $ kshell
 k$ prove t/db_dependent/Koha/Patron/Category.t
=> SUCCESS: Tests pass!
- Sign off :-D
Comment 3 Tomás Cohen Arazi (tcohen) 2019-02-20 17:09:54 UTC
Created attachment 85391 [details] [review]
Bug 10796: Handle can_change_password on the staff interface

This patch makes the staff interface handle the new flag when editing
the categories. I didn't add the flag to the list of categories table
because it makes it too big, but can be easily added if required by
users or QA.

To test:
- Along with other patches from this bug, edit patron categories
=> SUCCESS: Notice the changes are correctly stored
- Sign off :-D
Comment 4 Tomás Cohen Arazi (tcohen) 2019-02-20 17:09:57 UTC
Created attachment 85392 [details] [review]
Bug 10796: Use $category->effective_change_password in the OPAC

This patch makes the OPAC pages that rely on OpacPasswordChange use the
current patron's category to make the decision to allow password change
or not.

It does so by making sure all the places in which OpacPasswordChange was
used, use $logged_in_user->category->effective_change_password instead.

Special attention is required on the case of opac-registration-verify.pl
in which the use of an unblessed Koha::Patron object is changed in
favour of the blessed object, so we can actually use the new method to
make a decision on the text to display.

To test:
- Go through the OPAC pages, check that the password change strings and
links are displayed only whne appropriate.
- Sign off :-D
Comment 5 Tomás Cohen Arazi (tcohen) 2019-02-20 17:10:01 UTC
Created attachment 85393 [details] [review]
Bug 10796: DBIC update
Comment 6 Tomás Cohen Arazi (tcohen) 2019-03-21 14:27:24 UTC
Obsoleted the DBIC update as well, as it is counter-productive.
Comment 7 Liz Rea 2019-03-27 19:28:45 UTC
Created attachment 87117 [details] [review]
Bug 10796: DB update

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Comment 8 Liz Rea 2019-03-27 19:28:48 UTC
Created attachment 87118 [details] [review]
Bug 10796: Add Koha::Patron::Category->effective_change_password method

This method checks whether the local $self->change_password is set to
override the OpacPasswordChange syspref (i.e. if it is set to a
bool) or undef, in which case it falls back to the value of the syspref

To test:
- Apply this patches
- Make sure the DB is updated:
  $ updatedatabase
- Update the schema files:
  $ dbic
- Run:
  $ kshell
 k$ prove t/db_dependent/Koha/Patron/Category.t
=> SUCCESS: Tests pass!
- Sign off :-D

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Comment 9 Liz Rea 2019-03-27 19:28:51 UTC
Created attachment 87119 [details] [review]
Bug 10796: Handle can_change_password on the staff interface

This patch makes the staff interface handle the new flag when editing
the categories. I didn't add the flag to the list of categories table
because it makes it too big, but can be easily added if required by
users or QA.

To test:
- Along with other patches from this bug, edit patron categories
=> SUCCESS: Notice the changes are correctly stored
- Sign off :-D

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Comment 10 Liz Rea 2019-03-27 19:28:53 UTC
Created attachment 87120 [details] [review]
Bug 10796: Use $category->effective_change_password in the OPAC

This patch makes the OPAC pages that rely on OpacPasswordChange use the
current patron's category to make the decision to allow password change
or not.

It does so by making sure all the places in which OpacPasswordChange was
used, use $logged_in_user->category->effective_change_password instead.

Special attention is required on the case of opac-registration-verify.pl
in which the use of an unblessed Koha::Patron object is changed in
favour of the blessed object, so we can actually use the new method to
make a decision on the text to display.

To test:
- Go through the OPAC pages, check that the password change strings and
links are displayed only whne appropriate.
- Sign off :-D

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Comment 11 Liz Rea 2019-03-27 19:28:56 UTC
Created attachment 87121 [details] [review]
Bug 10796: (QA Follow-up) Changing password recovery verbiage for users who are disallowed online password resets
Comment 12 Tomás Cohen Arazi (tcohen) 2019-03-27 19:37:19 UTC
(In reply to Liz Rea from comment #11)
> Created attachment 87121 [details] [review] [review]
> Bug 10796: (QA Follow-up) Changing password recovery verbiage for users who
> are disallowed online password resets

Thank you!!!
Comment 13 Martin Renvoize (ashimema) 2019-04-01 18:23:26 UTC
Created attachment 87296 [details] [review]
Bug 10796: DB update

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 14 Martin Renvoize (ashimema) 2019-04-01 18:23:29 UTC
Created attachment 87297 [details] [review]
Bug 10796: Add Koha::Patron::Category->effective_change_password method

This method checks whether the local $self->change_password is set to
override the OpacPasswordChange syspref (i.e. if it is set to a
bool) or undef, in which case it falls back to the value of the syspref

To test:
- Apply this patches
- Make sure the DB is updated:
  $ updatedatabase
- Update the schema files:
  $ dbic
- Run:
  $ kshell
 k$ prove t/db_dependent/Koha/Patron/Category.t
=> SUCCESS: Tests pass!
- Sign off :-D

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 15 Martin Renvoize (ashimema) 2019-04-01 18:23:32 UTC
Created attachment 87298 [details] [review]
Bug 10796: Handle can_change_password on the staff interface

This patch makes the staff interface handle the new flag when editing
the categories. I didn't add the flag to the list of categories table
because it makes it too big, but can be easily added if required by
users or QA.

To test:
- Along with other patches from this bug, edit patron categories
=> SUCCESS: Notice the changes are correctly stored
- Sign off :-D

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 16 Martin Renvoize (ashimema) 2019-04-01 18:23:35 UTC
Created attachment 87299 [details] [review]
Bug 10796: Use $category->effective_change_password in the OPAC

This patch makes the OPAC pages that rely on OpacPasswordChange use the
current patron's category to make the decision to allow password change
or not.

It does so by making sure all the places in which OpacPasswordChange was
used, use $logged_in_user->category->effective_change_password instead.

Special attention is required on the case of opac-registration-verify.pl
in which the use of an unblessed Koha::Patron object is changed in
favour of the blessed object, so we can actually use the new method to
make a decision on the text to display.

To test:
- Go through the OPAC pages, check that the password change strings and
links are displayed only whne appropriate.
- Sign off :-D

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 17 Martin Renvoize (ashimema) 2019-04-01 18:23:38 UTC
Created attachment 87300 [details] [review]
Bug 10796: (QA follow-up) Changing password recovery verbiage for users who are disallowed online password resets

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 18 Martin Renvoize (ashimema) 2019-04-01 18:25:07 UTC
Nice useful enhancement.

No regressions found, QA scripts pass (with the exception of a false failure in the template check)

Passing QA
Comment 19 Nick Clemens (kidclamp) 2019-04-12 13:00:09 UTC
Awesome work all!

Pushed to master for 19.05
Comment 20 Martin Renvoize (ashimema) 2019-04-25 13:19:20 UTC
Enhancement will not be backported to 18.11.x series.