mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-14 10:37:39 -07:00
Integrated new api interface.
This commit is contained in:
parent
4a9bfc94ad
commit
4306a4fb4f
116 changed files with 10371 additions and 0 deletions
34
web/api/v1/logout/index.php
Normal file
34
web/api/v1/logout/index.php
Normal file
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
header('Content-Type: application/json');
|
||||
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
|
||||
require_once($_SERVER['DOCUMENT_ROOT'].'/inc/i18n/'.$_SESSION['language'].'.php');
|
||||
session_start();
|
||||
|
||||
$response = '';
|
||||
|
||||
if (!empty($_SESSION['look'])) {
|
||||
unset($_SESSION['look']);
|
||||
$response = 'logged_out_as';
|
||||
$v_user = empty($_SESSION['look']) ? $_SESSION['user'] : $_SESSION['look'];
|
||||
top_panel($v_user, $TAB);
|
||||
exec (VESTA_CMD . "v-list-user ".$v_user." json", $output, $return_var);
|
||||
$users = json_decode(implode('', $output), true);
|
||||
} else {
|
||||
$response = 'logged_out';
|
||||
session_destroy();
|
||||
}
|
||||
|
||||
$result = array(
|
||||
'logout_response' => $response,
|
||||
'userName' => $v_user,
|
||||
'token' => $_SESSION['token'],
|
||||
'user' => $users[$v_user],
|
||||
'panel' => $panel,
|
||||
'session' => $_SESSION,
|
||||
'i18n' => $LANG[$_SESSION['language']],
|
||||
'error' => $_SESSION['error_msg']
|
||||
);
|
||||
|
||||
echo json_encode($result);
|
||||
unset($_SESSION['error_msg']);
|
Loading…
Add table
Add a link
Reference in a new issue