Skip to content

Commit

Permalink
Merge branch 'xdmod8.1' into update-start-stop-events
Browse files Browse the repository at this point in the history
  • Loading branch information
plessbd authored Dec 21, 2018
2 parents ae52b0c + 8579517 commit 9066759
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions classes/XDUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -1133,9 +1133,20 @@ public function saveUser()
public function getLastLoginTimestamp()
{

$results = $this->_pdo->query("SELECT FROM_UNIXTIME(init_time) as lastLogin FROM SessionManager WHERE user_id=:user_id ORDER BY init_time DESC LIMIT 1", array(
':user_id' => $this->_id,
));
$results = $this->_pdo->query(
"SELECT
FROM_UNIXTIME(FLOOR(init_time)) AS lastLogin
FROM
SessionManager
WHERE
user_id = :user_id
ORDER BY
init_time DESC
LIMIT 1",
array(
':user_id' => $this->_id,
)
);

if (count($results) == 0) {
return "Never logged in";
Expand Down

0 comments on commit 9066759

Please sign in to comment.