Bug 28947: Prevent OPAC user to create new users

This patch prevents an existing user from exploiting the patron edit form in order to
force create new patrons

To test:
Try all combinations of PatronSelfRegistration and PatronSelfRegistrationVerifyByEmail
with and without this patch.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
This commit is contained in:
Jonathan Druart 2021-09-03 12:01:12 +02:00 committed by Wainui Witika-Park
parent 1a50ee4917
commit 03b06780fd
1 changed files with 5 additions and 0 deletions

View File

@ -64,6 +64,11 @@ unless ( C4::Context->preference('PatronSelfRegistration') || $borrowernumber )
}
my $action = $cgi->param('action') || q{};
if ( $borrowernumber && ( $action eq 'create' || $action eq 'new' ) ) {
print $cgi->redirect("/cgi-bin/koha/opac-main.pl");
exit;
}
if ( $action eq q{} ) {
if ($borrowernumber) {
$action = 'edit';