Bug 33905 - Username and cardnumber should be unique respectively
Summary: Username and cardnumber should be unique respectively
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-06-06 13:39 UTC by Nick Clemens (kidclamp)
Modified: 2024-04-24 15:26 UTC (History)
6 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens (kidclamp) 2023-06-06 13:39:11 UTC
Currently Koha allows a user to sign in with either their cardnumber or userid

Confusion can arise when a user has a username that is another users cardnumber, and vice versa

We should check uniqueness across both of these fields.
Comment 1 David Cook 2023-06-07 00:21:42 UTC
We have a lot of patrons whose userid and cardnumber are the same, so I'd want to preserve that.

But it does make sense to prevent a userid/cardnumber that belongs to the cardnumber/userid of another borrower...
Comment 2 Jonathan Druart 2023-06-07 08:09:43 UTC
Can you remind me the good reason behind the 2 login fields? :)

If you want to use cardnumber to login why not set userid=cardnumber and always use userid as login?
Comment 3 Katrin Fischer 2023-06-07 09:43:23 UTC
(In reply to Nick Clemens from comment #0)
> Currently Koha allows a user to sign in with either their cardnumber or
> userid
> 
> Confusion can arise when a user has a username that is another users
> cardnumber, and vice versa
> 
> We should check uniqueness across both of these fields.

We had definitely problems with that in the past and had solved it. Could this be a regression?

For our libraries Joubu's solution would not work. We have all different cases:

* Libraries where the self check reads the chip number that is long, complicated and unknown to the user. They user the userid for logging into the OPAC.
* Libraries that don't use the userid at all, but only use the cardnumber

Koha has always supported both - I think there is no step back from that. But uniqueness must be enforced.
Comment 4 David Cook 2023-06-08 01:04:22 UTC
(In reply to Jonathan Druart from comment #2)
> Can you remind me the good reason behind the 2 login fields? :)
> 
> If you want to use cardnumber to login why not set userid=cardnumber and
> always use userid as login?

Like Katrin was saying, I think the cardnumber is more for machines, and userid is more for humans. 

At my local public library, they used to only have cardnumber for logging in, but then they created "alias" which is similar to userid I think. When I log in to my account, I use that human-friendly alias/userid, but I validate myself on the self-checkout using my card. 

(As I say that, I realize that the Koha self-checkout could have an option to show both cardnumber and userid logins... as you might've forgotten your card but might have your userid/password...)
Comment 5 Tomás Cohen Arazi (tcohen) 2023-06-08 12:12:45 UTC
(In reply to Jonathan Druart from comment #2)
> Can you remind me the good reason behind the 2 login fields? :)
> 
> If you want to use cardnumber to login why not set userid=cardnumber and
> always use userid as login?

The idea is that you can get your card lost or stolen, and you ask for a new one. The number in it should be different to avoid impersonation or to identify the card is no longer valid, etc.