You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

53 lines
1.6 KiB

<?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:8080", "websocket": "ws://192.168.115.244:8080/wss", "matricula": "1000", "fila": "144", "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 = [
'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>