|
|
|
<?php
|
|
|
|
|
|
|
|
include "config/includes.php";
|
|
|
|
|
|
|
|
use app\Provider\Crypt;
|
|
|
|
|
|
|
|
$files = getconfig('app')['FILES'];
|
|
|
|
$crypt = new Crypt('aes-256-cbc', getconfig('app')['PASSWORD']);
|
|
|
|
$geturl = bootstrap();
|
|
|
|
$connected = false;
|
|
|
|
|
|
|
|
if($geturl['t'] == 'gerar' && ($_SERVER['SERVER_NAME'] == 'localhost' || $geturl['password'] == 'S1MPL3S1P_CH4T')){
|
|
|
|
$expireToken = strtotime( '+1 days', time());
|
|
|
|
$json_info = '{"servidor": "http://192.168.115.244:8081", "websocket": "ws://192.168.115.244:8081/wss", "matricula": "2424", "fila": "1", "expire": "'.$expireToken.'"}';
|
|
|
|
echo $json_info;
|
|
|
|
echo "<br/><br/>";
|
|
|
|
echo "Token: <input type='text' value='{$crypt->encrypt($json_info)}' size='90'>";
|
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
|
|
|
$json = json_decode($crypt->decrypt(str_replace(' ', '+', $geturl['t'])), true);
|
|
|
|
if($geturl['t'] && $json ){
|
|
|
|
$json = json_decode($crypt->decrypt(str_replace(' ', '+', $geturl['t'])), true);
|
|
|
|
$objs = [
|
|
|
|
'id_empresa' => $json['id_empresa'],
|
|
|
|
'obj_server' => $json['servidor'],
|
|
|
|
'my_uniqueid' => $json['matricula'],
|
|
|
|
'obj_queue' => $json['fila'],
|
|
|
|
'obj_ws' => $json['websocket'],
|
|
|
|
'supervisor_api' => $json['api'],
|
|
|
|
'session_uniqueid' => null,
|
|
|
|
'obj_notification' => null,
|
|
|
|
'obj_contact' => null,
|
|
|
|
'obj_status' => null,
|
|
|
|
'session_window' => null
|
|
|
|
];
|
|
|
|
|
|
|
|
foreach($objs as $key => $val){
|
|
|
|
$jsStartup[] = "localStorage.removeItem('{$key}')";
|
|
|
|
if($val){
|
|
|
|
$jsStartup[] = sprintf("localStorage.setItem('{$key}', '%s')", $val);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$connected = true;
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
|
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<?php include "app/view/header.php" ?>
|
|
|
|
<body>
|
|
|
|
<?php include "app/view/content.php" ?>
|
|
|
|
</body>
|
|
|
|
</html>
|