Preventing admin to do loginas action without token

This is useless issue and useless fix too.
This commit is contained in:
myvesta 2020-12-12 13:48:51 +01:00 committed by GitHub
parent 00b4267afd
commit 292d933f88
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -16,6 +16,12 @@ if (isset($_GET['logout'])) {
// Login as someone else
if (isset($_SESSION['user'])) {
if ((!isset($_GET['token'])) || ($_SESSION['token'] != $_GET['token'])) {
session_destroy();
session_start();
header('Location: /login/');
exit();
}
if ($_SESSION['user'] == 'admin' && !empty($_GET['loginas'])) {
exec (VESTA_CMD . "v-list-user ".escapeshellarg($_GET['loginas'])." json", $output, $return_var);
if ( $return_var == 0 ) {