generateAuthHash is already called earlier in index.php, so it will always be up to date. Just include it in the response.

pull/2077/head
Isaac Connor 2018-02-14 13:15:22 -05:00
parent 45bf4544ca
commit 002f22f685
1 changed files with 1 additions and 8 deletions

View File

@ -2,14 +2,7 @@
if ($_REQUEST['entity'] == 'navBar') {
$data = array();
if ( ZM_OPT_USE_AUTH && ZM_AUTH_RELAY == 'hashed' ) {
$time = time();
Logger::Debug("Using hashed auth, $time ? " . ( $time - (ZM_AUTH_HASH_TTL * 1800) ) . ' <? ' . $_SESSION['AuthHashGeneratedAt'] );
// Regenerate auth hash after half the lifetime of the hash
if ( (!isset($_SESSION['AuthHashGeneratedAt'])) or ( $_SESSION['AuthHashGeneratedAt'] < $time - (ZM_AUTH_HASH_TTL * 1800) ) ) {
session_start();
$data['auth'] = generateAuthHash( ZM_AUTH_HASH_IPS );
session_write_close();
}
$data['auth'] = generateAuthHash( ZM_AUTH_HASH_IPS );
}
$data['message'] = getNavBarHtml('reload');
ajaxResponse($data);