mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
Remove all usage of UNIX_TIMESTAMP in web interface
UNIX_TIMESTAMP is not part of the SQL standard. Instead, all usage in the web interface is changed to use PHP's time() function. Signed-off-by: Mark Weiman <mark.weiman@markzz.com> Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
This commit is contained in:
parent
c3f464f50f
commit
3e442a0f7d
4 changed files with 16 additions and 16 deletions
|
@ -38,7 +38,7 @@ function check_sid() {
|
|||
# the visitor is logged in, try and update the session
|
||||
#
|
||||
$dbh = DB::connect();
|
||||
$q = "SELECT LastUpdateTS, UNIX_TIMESTAMP() FROM Sessions ";
|
||||
$q = "SELECT LastUpdateTS, " . strval(time()) . " FROM Sessions ";
|
||||
$q.= "WHERE SessionID = " . $dbh->quote($_COOKIE["AURSID"]);
|
||||
$result = $dbh->query($q);
|
||||
$row = $result->fetch(PDO::FETCH_NUM);
|
||||
|
@ -77,7 +77,7 @@ function check_sid() {
|
|||
# This keeps 'remembered' sessions from being
|
||||
# overwritten.
|
||||
if ($last_update < time() + $timeout) {
|
||||
$q = "UPDATE Sessions SET LastUpdateTS = UNIX_TIMESTAMP() ";
|
||||
$q = "UPDATE Sessions SET LastUpdateTS = " . strval(time()) . " ";
|
||||
$q.= "WHERE SessionID = " . $dbh->quote($_COOKIE["AURSID"]);
|
||||
$dbh->exec($q);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue