]> git.koha-community.org Git - koha.git/commit
Bug 18275: Do not rely on CGI param userid to log a user in if auth is not required
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 15 Mar 2017 17:52:49 +0000 (14:52 -0300)
committerMason James <mtj@kohaaloha.com>
Fri, 17 Mar 2017 13:24:06 +0000 (02:24 +1300)
commita35b28943a590c07e0f796163618ab238c82a98f
treed49026a21c0f521c0be3112fee8fbf19f64da300
parentc8fc80862496e0b779ff38c90632e7266b9c25bc
Bug 18275: Do not rely on CGI param userid to log a user in if auth is not required

From opac/opac-memberentry.pl, authnotrequired is set.
That means a patron can access the page without being logged in. It is
used on this page for the self registration feature.

From C4::Auth::get_template_and_user, we have
  $userid = $q_userid;
$q_userid is previously set to the 'userid' CGI param.

We end up here if authonotrequired is set AND CGISESSID does not exist.

Test plan:
- Run:
  $ prove t/db_dependent/Auth.t
=> FAIL: Regression test for checkauth fails
- Apply this patch
- Run:
  $ prove t/db_dependent/Auth.t
=> SUCCESS: Tests pass.
- Sign off :-D

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Mason James <mtj@kohaaloha.com>
C4/Auth.pm