mirror of
https://github.com/myvesta/vesta
synced 2025-07-05 20:41:53 -07:00
Preventing admin to do loginas action without token
This is useless issue and useless fix too.
This commit is contained in:
parent
00b4267afd
commit
292d933f88
1 changed files with 6 additions and 0 deletions
|
@ -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 ) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue