mirror of
https://github.com/postfixadmin/postfixadmin.git
synced 2024-09-19 19:22:14 +02:00
use PHP date for comparison - see #254 and https://sourceforge.net/p/postfixadmin/discussion/676076/thread/70ed9843c0/?limit=25#685c and #240
This commit is contained in:
parent
c08973f54a
commit
f9fd24aecd
@ -857,7 +857,11 @@ abstract class PFAHandler {
|
||||
|
||||
$table = table_by_key($this->db_table);
|
||||
$active = db_get_boolean(true);
|
||||
$query = "SELECT token FROM $table WHERE " . $this->id_field . "='$username' AND token <> '' AND active='$active' AND NOW() < token_validity";
|
||||
|
||||
// Use PHP date for token check; this avoids a timezone issue between MySQL and PHP producing different dates.
|
||||
$now = escape_string(date('Y-m-d H:i:s'));
|
||||
|
||||
$query = "SELECT token FROM $table WHERE " . $this->id_field . "='$username' AND token <> '' AND active='$active' AND '$now' < token_validity";
|
||||
|
||||
$result = db_query($query);
|
||||
if ($result['rows'] == 1) {
|
||||
|
Loading…
Reference in New Issue
Block a user