--- Comment #69 from Jonathan Druart <> 
Created attachment 71506
Bug 18403: Add sub output_and_exit_if_error - unknown_patron &

Test plan:
Login with a patron that is not allowed to see patron's information for patrons
outside of his group. Try to access patron's information from scripts of the
module (members/*) and circ/
You should be able to access patron's information of patrons outside of your
and get "You are not allowed to see the information of this patron."
If you try and access a patron page with a borrowernumber that does not exist,
should get "This patron does not exist"

Technical note:
A new C4::Output subroutine is created in this patch:
Executed at the beginning of the script it will permit not to copy/paste all
different checks to know if the logged in user is authorised to see patron's
The design here can be discussed, but I did not find an alternative with as
less changes.
On the way I refactor what we did with 'unknowuser' previously: it will now
work with all
patron pages, not only the few that used it.
Note that the 'or die "Not logged in";' part should not be needed, but... who
I think it could be used as a safeguard later. I am willing to sed and remove
if required.

Changes in are mainly indentation changes.

With this patch we should now have a $patron variable that refer to the patron
want to access. That will be very useful to remove plenty of code in members/*
only pass this variable to the template (instead of 1 variable per patron's

Signed-off-by: Signed-off-by: Jon McGowan <>

Signed-off-by: Jonathan Druart <>

You are receiving this mail because:
You are watching all bug changes.
Koha-bugs mailing list
website :
git :
bugs :

Reply via email to