mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-10-25 15:58:24 -04:00
if no AuthHashGEneratedAt then generate one instead of outputting an error
This commit is contained in:
1 parent
f66b606e34
commit
fd90de5952
1 file changed
+2
-2
+2
-2
@@ -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();
|
||||
|
||||
Reference in new issue
Block a user