forked from hestiacp/hestiacp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
29 lines (27 loc) · 1 KB
/
index.php
File metadata and controls
29 lines (27 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
// Main include
include($_SERVER['DOCUMENT_ROOT'] . '/inc/main.php');
// Check token
verify_csrf($_GET);
if (!empty($_SESSION['look'])) {
$v_user = escapeshellarg($_SESSION['look']);
$v_impersonator = escapeshellarg($_SESSION['user']);
exec(HESTIA_CMD . "v-log-action system 'Warning' 'Security' 'User impersonation session ended (User: $v_user, Administrator: $v_impersonator)'", $output, $return_var);
unset($_SESSION['look']);
# Remove current path for filemanager
unset($_SESSION['_sf2_attributes']);
unset($_SESSION['_sf2_meta']);
header('Location: /');
} else {
if ($_SESSION['token'] && $_SESSION['user']) {
unset($_SESSION['userTheme']);
$v_user = escapeshellarg($_SESSION['user']);
$v_session_id = escapeshellarg($_SESSION['token']);
exec(HESTIA_CMD . 'v-log-user-logout ' . $v_user . ' ' . $v_session_id, $output, $return_var);
}
unset($_SESSION);
session_unset();
session_destroy();
header('Location: /login/');
}
exit;