| Server IP : 173.209.174.21 / Your IP : 216.73.216.89 Web Server : Apache/2.4.58 (Ubuntu) System : Linux wcfs-server 6.8.0-124-generic #124-Ubuntu SMP PREEMPT_DYNAMIC Tue May 26 13:00:45 UTC 2026 x86_64 User : nodor ( 1000) PHP Version : 8.3.6 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/thelittlebigshow/self-hosted/ |
Upload File : |
<?php
require_once __DIR__ . '/self_hosted_activation_helpers.php';
if (session_status() !== PHP_SESSION_ACTIVE) {
session_start();
}
if (selfHostedModeEnabled()) {
selfHostedRequireActivation();
selfHostedRequireAppLogin();
$dbConfigError = selfHostedDbConfigurationError();
if ($dbConfigError !== '') {
die($dbConfigError);
}
$_SESSION['store_name'] = SELF_HOSTED_STORE_NAME !== '' ? SELF_HOSTED_STORE_NAME : SELF_HOSTED_DB_NAME;
$_SESSION['store_db'] = SELF_HOSTED_DB_NAME;
$_SESSION['account_status'] = 'active';
$_SESSION['logged_in'] = true;
$conn = selfHostedConnectDb();
return;
}
$servername = "localhost";
$username = "housetab";
$password = "s9Q3slf6INCb62P7uT";
$accountId = (int) ($_SESSION['account_id'] ?? 0);
$database = $_SESSION['store_db'] ?? '';
if (!$accountId || !$database) {
header('Location: /login.php?session_expired=1');
exit;
}
$centralDb = new PDO("sqlite:/opt/housetabpro_saas/data/central.sqlite");
$centralDb->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$accountStmt = $centralDb->prepare("
SELECT store_name, email, status, trial_expires
FROM accounts
WHERE id = ?
LIMIT 1
");
$accountStmt->execute([$accountId]);
$account = $accountStmt->fetch(PDO::FETCH_ASSOC);
if (!$account) {
session_unset();
session_destroy();
header('Location: /login.php?session_expired=1');
exit;
}
$_SESSION['store_name'] = $account['store_name'];
$_SESSION['account_email'] = $account['email'];
$_SESSION['account_status'] = $account['status'];
$_SESSION['trial_expires'] = $account['trial_expires'];
$status = strtolower(trim((string) ($account['status'] ?? '')));
$trialExpires = trim((string) ($account['trial_expires'] ?? ''));
$trialExpired = $status === 'trial'
&& $trialExpires !== ''
&& strtotime($trialExpires) !== false
&& strtotime($trialExpires) < time();
if ($trialExpired) {
header('Location: /dashboard.php?trial_expired=1');
exit;
}
if (in_array($status, ['suspended', 'cancelled', 'canceled'], true)) {
header('Location: /dashboard.php?billing_issue=1');
exit;
}
$conn = new mysqli($servername, $username, $password, $database);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}