check users.txt
This commit is contained in:
@@ -2,6 +2,14 @@
|
|||||||
session_start();
|
session_start();
|
||||||
header('Content-Type: application/json');
|
header('Content-Type: application/json');
|
||||||
|
|
||||||
|
// Check if users.txt is empty or doesn't exist
|
||||||
|
$usersFile = __DIR__ . '/users.txt';
|
||||||
|
if (!file_exists($usersFile) || trim(file_get_contents($usersFile)) === '') {
|
||||||
|
// Return JSON indicating setup mode
|
||||||
|
echo json_encode(["setup" => true]);
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
if (!isset($_SESSION['authenticated']) || $_SESSION['authenticated'] !== true) {
|
if (!isset($_SESSION['authenticated']) || $_SESSION['authenticated'] !== true) {
|
||||||
echo json_encode(["authenticated" => false]);
|
echo json_encode(["authenticated" => false]);
|
||||||
exit;
|
exit;
|
||||||
|
|||||||
Reference in New Issue
Block a user