move view to the form action so that it is part of get request instead of post

This commit is contained in:
Isaac Connor
2020-10-20 12:31:38 -04:00
parent bb5646baac
commit 41ed267b71

View File

@@ -56,6 +56,7 @@ while ( $row = $result->fetch(PDO::FETCH_ASSOC) ) {
ZM\Warning('Failed to decode ' . $row['data']);
continue;
}
ZM\Debug(print_r($_SESSION, true));
if ( isset($_SESSION['last_time']) ) {
# This is a dead session
continue;
@@ -91,12 +92,11 @@ $_SESSION = $current_session;
<?php } # end if canView(System) ?>
</div>
<div class="modal-footer">
<form name="logoutForm" id="logoutForm" method="post" action="?">
<form name="logoutForm" id="logoutForm" method="post" action="?view=logout">
<?php
// We have to manually insert the csrf key into the form when using a modal generated via ajax call
echo getCSRFinputHTML();
?>
<input type="hidden" name="view" value="logout"/>
<button type="submit" name="action" value="logout"><?php echo translate('Logout') ?></button>
<?php if ( ZM_USER_SELF_EDIT ) echo '<button type="submit" name="action" value="config">'.translate('Config').'</button>'.PHP_EOL; ?>
<button type="button" data-dismiss="modal"><?php echo translate('Cancel') ?></button>