[Koha-bugs] [Bug 12548] New: Auth::checkauth() needs more in-line comments
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Thu Jul 10 05:32:23 CEST 2014
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12548
Bug ID: 12548
Summary: Auth::checkauth() needs more in-line comments
Change sponsored?: ---
Product: Koha
Version: master
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P5 - low
Component: Documentation
Assignee: nengard at gmail.com
Reporter: dcook at prosentient.com.au
QA Contact: testopia at bugs.koha-community.org
C4::Auth::checkauth() can be a bit difficult to read.
Take for instance the following code snippet
unless ($userid || $sessionID) {
...
}
That makes it seem like this block will be executed if we haven't sent a userid
in the CGI object passed to checkauth().
On the contrary, the userid in the CGI object has been defined as "$q_userid"
so this block of code is actually what will be executed when we're logging in
with a userid and password.
The $userid mentioned in this condition refers to the "id" retrieved from an
existing session or from "$userid = $ENV{'REMOTE_USER'}" (which is an
environmental variable set via SIP?).
So that's confusing.
The whitespace is also inconsistent with the actual flow of logic, so that
should be fixed up too.
There are all sorts of little bits that need some explanatory comments.
--
You are receiving this mail because:
You are watching all bug changes.
More information about the Koha-bugs
mailing list