Bug 11888 - Random password suggestion does not work twice
Summary: Random password suggestion does not work twice
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff interface (show other bugs)
Version: master
Hardware: All All
: P5 - low trivial (vote)
Assignee: Juhani Seppälä
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-04 13:46 UTC by Marc Véron
Modified: 2015-06-04 23:32 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 11888: Random password suggestion does not work twice (3.08 KB, patch)
2014-07-17 08:49 UTC, Juhani Seppälä
Details | Diff | Splinter Review
Bug 11888: Random password suggestion does not work twice (3.10 KB, patch)
2014-07-24 06:38 UTC, Juhani Seppälä
Details | Diff | Splinter Review
[Signed-off] Bug 11888: Random password suggestion does not work twice (3.27 KB, patch)
2014-07-26 16:13 UTC, Marc Véron
Details | Diff | Splinter Review
[PASSED QA] Bug 11888: Random password suggestion does not work twice (3.37 KB, patch)
2014-07-27 21:48 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Véron 2014-03-04 13:46:04 UTC
To reproduce:

Step 1:

In the staff client, view the details for any patron and click the "Change password" button: In the change password form click 

Result: New password displays (OK)

Step 2:
Delete new passwords from fields. Click again link to fill the password fields again with a random password.

Result: Nothing happens.
Expected: New password suggestion in password fields.

Console says: "Kein Element gefunden (No element found)"
file:///C:/Users/ApDAta/Roaming/Mozilla/Firefox/o1dv3kga.default/clipdat2.rdf

I tested with Chrome as well, same behaviour.

Workaround: Choose new password manually or reload form and click link to fill the password fields with a random password.
Comment 1 Isaac Brodsky 2014-03-19 14:25:11 UTC
Clicking on "Click to fill with a randomly generated suggestion. Passwords will be displayed as text." a second time without clearing the new password does not work.

Koha 3.14.04 on Debian.
Comment 2 Juhani Seppälä 2014-07-17 08:49:13 UTC Comment hidden (obsolete)
Comment 3 Owen Leonard 2014-07-23 12:43:56 UTC
This looks good except for a couple of really minor issues: The path to the "loading" image is hard-coded to the prog theme, and the image lacks an alt attribute.

<img src="/intranet-tmpl/prog/img/loading.gif" />

...should be:

<img src="[% interface %]/[% theme %]/img/loading.gif" alt="" />
Comment 4 Owen Leonard 2014-07-23 12:49:03 UTC
I see one other thing:

<strong>Processing...<strong>

The second <strong> should be </strong>
Comment 5 Juhani Seppälä 2014-07-24 06:38:10 UTC Comment hidden (obsolete)
Comment 6 Juhani Seppälä 2014-07-24 06:39:34 UTC
Newest patch corrects the broken page elements.
Comment 7 Marc Véron 2014-07-26 16:13:10 UTC Comment hidden (obsolete)
Comment 8 Katrin Fischer 2014-07-27 21:47:31 UTC
Hi Juhani, thx for the patch. :)

Just a note: Sometimes the length of the generated password is minPasswordLength+1. It never seems to be shorter or longer and it happens before and after the patch.
Comment 9 Katrin Fischer 2014-07-27 21:48:50 UTC
Created attachment 30163 [details] [review]
[PASSED QA] Bug 11888: Random password suggestion does not work twice

This patch adds a simple ajax-call to pull a new suggested password
from the same perl script.

To test:
1) Search for a patron and select "Change password" from the moremember-view.
2) In the member-password-view, click on "Click to fill with a randomly generated suggestion".
3) Confirm that you get a new suggested password and click the same link again.
4) Note that you do not get another suggested password - nothing is happening.
5) Apply patch.
6) Repeat steps 1-3 and confirm that you can keep clicking for a new suggested password.

Patch works as expected.
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes all tests and QA script. Works as desribed.
Comment 10 Juhani Seppälä 2014-07-28 06:38:15 UTC
(In reply to Katrin Fischer from comment #8)
> Hi Juhani, thx for the patch. :)
> 
> Just a note: Sometimes the length of the generated password is
> minPasswordLength+1. It never seems to be shorter or longer and it happens
> before and after the patch.

Hi,

I noticed this behaviour as well while looking at creating this small fix. As mentioned here: Bug 12617 (shameless ad), we've had some discussion at our library about being able to have more configuration choices with regards to patron passwords and I've done some preliminary work on changing the current custom password generation to use a cpan library for easy configurability and so forth. We also have a damning limitation with some of the appliances used by customers where the devices only have numeric keys for password input... Things I'm looking at:

- Making generated password complexity configurable
- Allow admins to enforce a separate password policy for regular patrons and employees (for example)

I would be interested in hearing any thoughts related to this and whether any of this would be useful in the community (we have some specific requirements here after all).
Comment 11 Tomás Cohen Arazi 2014-07-30 15:27:04 UTC
Patch pushed to master.

Thanks Juhani!