Add auth relay information when auth_relay is something other than hashed.

This commit is contained in:
Isaac Connor 2020-04-29 16:33:41 -04:00
parent 5e88181380
commit 9ec89f20d3
1 changed files with 19 additions and 3 deletions

View File

@ -71,6 +71,22 @@ var focusWindow = <?php echo !empty($focusWindow)?'true':'false' ?>;
var imagePrefix = "<?php echo '?view=image&eid=' ?>"; var imagePrefix = "<?php echo '?view=image&eid=' ?>";
var auth_hash; var auth_hash;
<?php if ( ZM_OPT_USE_AUTH && ZM_AUTH_HASH_LOGINS ) { ?> var auth_relay;
auth_hash = '<?php echo generateAuthHash(ZM_AUTH_HASH_IPS) ?>'; <?php
<?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);
}
}
?>