if no AuthHashGEneratedAt then generate one instead of outputting an error

This commit is contained in:
Isaac Connor committed 2017-05-05 16:47:50 -04:00
1 parent f66b606e34
commit fd90de5952
1 file changed
+2 -2
+2 -2
View File
@@ -116,7 +116,7 @@ switch ( $data['type'] )
session_start();
$time = time();
// Regenerate auth hash after half the lifetime of the hash
if ( $_SESSION['AuthHashGeneratedAt'] < $time - (ZM_AUTH_HASH_TTL * 1800) ) {
if ( (!isset($_SESSION['AuthHashGeneratedAt'])) or ( $_SESSION['AuthHashGeneratedAt'] < $time - (ZM_AUTH_HASH_TTL * 1800) ) ) {
$data['auth'] = generateAuthHash( ZM_AUTH_HASH_IPS );
}
session_write_close();
@@ -134,7 +134,7 @@ switch ( $data['type'] )
session_start();
$time = time();
// Regenerate auth hash after half the lifetime of the hash
if ( $_SESSION['AuthHashGeneratedAt'] < $time - (ZM_AUTH_HASH_TTL * 1800) ) {
if ( (!isset($_SESSION['AuthHashGeneratedAt'])) or ( $_SESSION['AuthHashGeneratedAt'] < $time - (ZM_AUTH_HASH_TTL * 1800) ) ) {
$data['auth'] = generateAuthHash( ZM_AUTH_HASH_IPS );
}
session_write_close();