Always set auth_hash and always set auth_relay, using our handy new get_auth_relay function

This commit is contained in:
Isaac Connor 2020-08-25 12:39:14 -04:00
parent f1fab6361f
commit b0f5f3617a
1 changed files with 2 additions and 20 deletions

View File

@ -70,23 +70,5 @@ var focusWindow = <?php echo !empty($focusWindow)?'true':'false' ?>;
var imagePrefix = "<?php echo '?view=image&eid=' ?>";
var auth_hash;
var auth_relay;
<?php
if ( ZM_OPT_USE_AUTH ) {
if ( ZM_AUTH_RELAY == 'hashed' ) {
echo ' auth_hash = \''.generateAuthHash(ZM_AUTH_HASH_IPS).'\';
';
} else if ( ZM_AUTH_RELAY == 'plain' ) {
// password probably needs to be escaped
echo ' auth_relay=\'username='.$_SESSION['username'].'&password='.$_SESSION['password'].'\';
';
} else if ( ZM_AUTH_RELAY == 'none' ) {
// password probably needs to be escaped
echo ' auth_relay=\'username='.$_SESSION['username'].'\';
';
} else {
ZM\Error('Unknown value for ZM_AUTH_RELAY ' . ZM_AUTH_RELAY);
}
}
?>
var auth_hash = '<?php echo generateAuthHash(ZM_AUTH_HASH_IPS) ?>';
var auth_relay = '<?php echo get_auth_relay() ?>';