- withSession() - for auto authentication with Session/Cookie variables
- withOpenId() - for authentication with an OpenID account
- withPassword() - for authentication with Password
- setForUser() - for setting the user auth context of the current session
Refactor "Session" class - contains now "native" Session Management methods
- Remove extraneous parentheses around empty() calls
- Remove duplicate calls to intval(), count() or strlen() after empty()
- Replace ternary operators outputting binary value with empty() return value
- Rewrite defaults() without x()
- The LightOpenId class' constructor now requires the hostname from where the
requested started, added it now
- sometimes need to invoke get_app() as $a was not around
Signed-off-by: Roland Häder <roland@mxchange.org>
Closes#2432
NOTE: in order to obtain the same "cookie hash" it was required
to include unneeded fields in the user record structure, this would
be good to change in the future...
- added curly braces around conditional code blocks
- added space between if/foreach/... and brace
- rewrote a code block so if dbm::is_result() fails it will abort, else the id
is fetched from INSERT statement
- made some SQL keywords upper-cased and added back-ticks to columns/table names
Signed-off-by: Roland Haeder <roland@mxchange.org>
- count() returns very different results and never a boolean (not even false on
error condition).
- therefore you should NOT use it in boolean expressions. This still *can* be
done in PHP because of its lazyness. But it is discouraged if it comes to
more clean code.
Signed-off-by: Roland Häder <roland@mxchange.org>
The problem was that while openid was stored not-normalized in the database,
the checking code was looking for a normalized form instead.
The commit removing normalization step on saving user preferences
was 8367cad, which might have left old users with normalized openid
and new users with non-normalized one.
This commit makes the checking code look for both normalized and not
normalized form, to be backward compatible.