mirror of
https://github.com/myronblair/jarvis
synced 2026-06-30 17:50:23 -05:00
16 lines
610 B
PHP
16 lines
610 B
PHP
<?php
|
|
ini_set('session.cache_limiter', '');
|
|
header('Cache-Control: no-store, no-cache, must-revalidate, no-transform');
|
|
session_name('jarvis_main');
|
|
session_start();
|
|
if (empty($_SESSION['jarvis_token'])) {
|
|
header('Location: /login.php');
|
|
exit;
|
|
}
|
|
$token = $_SESSION['jarvis_token'];
|
|
$name = $_SESSION['jarvis_name'] ?? '';
|
|
$html = file_get_contents(__DIR__ . '/index.html');
|
|
$inject = '<script>sessionStorage.setItem("jarvis_token",' . json_encode($token)
|
|
. ');sessionStorage.setItem("jarvis_user",' . json_encode($name) . ');</script>';
|
|
echo str_replace('<head>', '<head>' . $inject, $html);
|