Commit db407597 authored by Nigel McNie's avatar Nigel McNie
Browse files

Ensure that we retrieve timestamps from the database in the correct form when...

Ensure that we retrieve timestamps from the database in the correct form when trying to log in a user, otherwise they get stored in the object in the wrong form, leading to pain later.
parent f4444644
......@@ -523,7 +523,16 @@ class LiveUser extends User {
* @return bool
*/
public function login($username, $password) {
$user = get_record_select('usr', 'LOWER(username) = ?', array(strtolower($username)), '*');
$sql = 'SELECT
*,
' . db_format_tsfield('expiry') . ',
' . db_format_tsfield('lastlogin') . ',
' . db_format_tsfield('suspendedctime') . '
FROM
{usr}
WHERE
LOWER(username) = ?';
$user = get_record_sql($sql, array(strtolower($username)));
if ($user == false) {
throw new AuthUnknownUserException("\"$username\" is not known");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment