403Webshell
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 :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/thelittlebigshow/self-hosted/self_hosted_login.php
<?php
require_once __DIR__ . '/brand_header.php';
require_once __DIR__ . '/self_hosted_activation_helpers.php';

if (!selfHostedModeEnabled()) {
    http_response_code(404);
    echo 'Self-hosted mode is not enabled.';
    exit;
}

if (session_status() !== PHP_SESSION_ACTIVE) {
    session_start();
}

if (!empty($_GET['logout'])) {
    unset($_SESSION['self_hosted_app_logged_in'], $_SESSION['self_hosted_app_email'], $_SESSION['self_hosted_app_last_activity_at']);
    header('Location: /app/self_hosted_login.php');
    exit;
}

$error = '';
$info = '';
$setupRequired = !empty($_GET['setup_required']);
$sessionExpired = !empty($_GET['session_expired']);

if ($sessionExpired) {
    $info = 'Your self-hosted app session expired after inactivity. Please log in again.';
}

if (!selfHostedDbConfigured()) {
    $error = 'This self-hosted install still needs its local database configuration. Finish the installer first.';
} else {
    $conn = selfHostedConnectDb();

    if ($_SERVER['REQUEST_METHOD'] === 'POST') {
        $action = trim((string) ($_POST['action'] ?? 'login'));
        $email = trim((string) ($_POST['email'] ?? ''));
        $password = (string) ($_POST['password'] ?? '');

        try {
            if ($action === 'setup_login') {
                $confirm = (string) ($_POST['confirm_password'] ?? '');
                if ($password !== $confirm) {
                    throw new RuntimeException('Passwords do not match.');
                }

                selfHostedSetAppCredentials($conn, $email, $password);
                $_SESSION['self_hosted_app_logged_in'] = true;
                $_SESSION['self_hosted_app_email'] = $email;
                $_SESSION['self_hosted_app_last_activity_at'] = time();
                header('Location: /app/index.php');
                exit;
            }

            if (!selfHostedAuthenticateAppUser($conn, $email, $password)) {
                throw new RuntimeException('Invalid email or password.');
            }

            $_SESSION['self_hosted_app_logged_in'] = true;
            $_SESSION['self_hosted_app_email'] = $email;
            $_SESSION['self_hosted_app_last_activity_at'] = time();
            header('Location: /app/index.php');
            exit;
        } catch (Throwable $e) {
            $error = $e->getMessage();
        }
    }

    $credentialsConfigured = selfHostedAppCredentialsConfigured($conn);
    $conn->close();
}

$showSetupForm = !empty($setupRequired) || (!isset($credentialsConfigured) ? false : !$credentialsConfigured);
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Self-Hosted App Login</title>
    <style>
        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            margin: 0;
            padding: 30px;
            background: #f8fafc;
            color: #1f2937;
        }

        .container {
            max-width: 620px;
            margin: 0 auto;
            background: #fff;
            padding: 28px;
            border-radius: 14px;
            box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
        }

        h1 { margin-top: 0; }
        label { display: block; margin: 16px 0 8px; font-weight: 700; }
        input {
            width: 100%;
            padding: 12px 14px;
            border: 1px solid #cbd5e1;
            border-radius: 10px;
            box-sizing: border-box;
            font-size: 16px;
        }
        .msg {
            padding: 12px 14px;
            border-radius: 10px;
            margin-bottom: 16px;
        }
        .msg.error {
            background: #fef2f2;
            border: 1px solid #fecaca;
            color: #b91c1c;
        }
        .msg.info {
            background: #eff6ff;
            border: 1px solid #bfdbfe;
            color: #1d4ed8;
        }
        .submit-btn {
            display: inline-block;
            margin-top: 18px;
            padding: 12px 18px;
            border-radius: 10px;
            border: none;
            cursor: pointer;
            font-size: 15px;
            font-weight: 700;
            background: #2563eb;
            color: #fff;
        }
    </style>
    <?php echo appBrandStyles(); ?>
</head>
<body>
<div class="container">
    <?php renderAppBrandHeader(); ?>
    <h1><?php echo $showSetupForm ? 'Set Up App Login' : 'App Login'; ?></h1>
    <p><?php echo $showSetupForm ? 'Create the local login for this self-hosted install.' : 'Log in to access this self-hosted HouseTab Pro app.'; ?></p>

    <?php if ($info !== ''): ?>
        <div class="msg info"><?php echo htmlspecialchars($info, ENT_QUOTES, 'UTF-8'); ?></div>
    <?php endif; ?>

    <?php if ($error !== ''): ?>
        <div class="msg error"><?php echo htmlspecialchars($error, ENT_QUOTES, 'UTF-8'); ?></div>
    <?php endif; ?>

    <form method="post">
        <input type="hidden" name="action" value="<?php echo $showSetupForm ? 'setup_login' : 'login'; ?>">

        <label for="email">Admin Email</label>
        <input type="email" id="email" name="email" value="<?php echo htmlspecialchars((string) ($_SESSION['self_hosted_app_email'] ?? ''), ENT_QUOTES, 'UTF-8'); ?>" required>

        <label for="password"><?php echo $showSetupForm ? 'Create Password' : 'Password'; ?></label>
        <input type="password" id="password" name="password" required>

        <?php if ($showSetupForm): ?>
            <label for="confirm_password">Confirm Password</label>
            <input type="password" id="confirm_password" name="confirm_password" required>
        <?php endif; ?>

        <button type="submit" class="submit-btn"><?php echo $showSetupForm ? 'Save App Login' : 'Log In'; ?></button>
    </form>
</div>
</body>
</html>

Youez - 2016 - github.com/yon3zu
LinuXploit