The Brown Hats Software Depot: F' Around & Find Out!

Login | Register (Invite Only)

pagetelegram's Profile

Title: Page Telegram of Amfile.org

Description: Brown Hats Collective F' Around and Find Out user of the Interwebs and Project Developer for a Cause Toward Insuring a Future of Liberty without Illusion.

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@=:---#@@@#%@@@*=+#@%====@@@@..:--@#====@-==#@@@+===#@%=-+@... -@@@@*@@@=+@%-*@
@@@.*@-.@@@.:@@==@:=@+ -..*@@@:# @:@=.=. #%.#@@@@ ::..@.%#.@@ %+ %@@% #@@-.@+ #@
@@@.*@+.@@@:.@@.#@%*@*.@.-*@@%@#.@.@=.%..#% *@@@@ %:+:+:@@=@@ #+ %@@+..@@= %: @@
@@@..-.=@@:* %@.%#=+@+..:@@@@@@*.@@@=..:@@@ %@%%% :.@@+-@:=#@ ...@@@:+ @@+ :- @@
@@@.+@@@@@.- =@.#@.-@*.@:=@@@@@+ @@@+:@-:@% @@*=@ @=%#+-@-.#@ @*.%@@.- #@=. + @@
@@@.+@@@@+.@..@:*%.*@*.@%.@@@@%- +@@=:@%.@@.%@:=@ @@=*#:@::@@ *# =@--% -@:- * @@
@@-::#@@%::+::*@-:=%@::.::@@@@+-::@*:.:::@::...%:::::#@*:==@#==@+:*.:=::%:-=::=@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@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@@@@@@@-    #@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@=    #@@@@@@@@@@@@@@%    -@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@.   .@@@@@@@@@@@@@@@@.   .@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@    -@@@@%##***#%@@@@+    %@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@*    %@#:..       .:+@%    *@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@=    =.               :    -@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@:                          .@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@.                          .@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@.       .=%@@@@@@@+:       .@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@#      .%@@@@@@@@@@@@@-      -@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@#     .*@@@@@@@@@@@@@@@@%:     -@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@%.    .@@@@@@*%@@@@%#@@@@@@=     *@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@.    :@@@@@@@@:-@@*.%@@@@@@@+     %@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@+    :@@@@@@@@@@---.@@@@@@@@@@=    :@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@.    @@@@@@@@@@@.   @@@@@@@@@@@:    #@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@=    #@@@+--#@@@@    #@@@@%#@@@@@.   .@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@.   :@%-     .%@@-  .@@@*.   .+@@=    #@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@#    *+.       .@@@#*@@@=       .#@    -@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@-   .#          =@@-.@@%.         +=   .@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@.   -@.          @@. %@:          #%    %@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@.   #@-          +%  =%          .@@.   *@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@%    %@%          :+  .+          +@@.   =@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@#    @@@:         .:  .-         .@@@:   -@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@*   .@@@%         #   .#         =@@@:   :@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@*   .@@@@=       -@    @-       .@@@@:   :@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@#    @@@@@.     .@@    @@.      %@@@@:   -@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@%    %@@@@@:   :@@@    @@@.   .*@@@@@.   =@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@.   #@@@@@@#+#@@@@    @@@@=.:%@@@@@@.   *@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@.   :@@@@@@-..:*@@    @@#-..:%@@@@@#    %@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@-   .@@@@@:     .@    @.     .@@@@@-   .@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@#    *@@@%       @.  .@       *@@@@    -@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@.   .@@@+       @-  .@.      -@@@=    #@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@+    +@@%.     .@*  :@-     .*@@%.   .@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@.    %@@@-    *@%  #@%.   :%@@@.    %@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@*    .@@@@%=-+@@@. @@@*--#@@@@-    -@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@:    .@@@@@@@@@@*=@@@@@@@@@@:     @@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@.    .%@@@@@@@@@@@@@@@@@@@-    .#@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@%.     +@@@@@@@@@@@@@@@@#.     +@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@%.     .+@@@@@@@@@@@@%:      +@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@%.       -*%@@@@@#=.      .*@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@:                      .%@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@#.                   +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+.              .=@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@=.        .-%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%%###%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

Repositories

Viewing: index.php.txt

<?php
date_default_timezone_set('America/Chicago');
session_start();

$correct_password = "hackme";
$messages_file = "messages.json";
$emails_file = "emails.csv";
$error = "";
$success = "";
$is_authenticated = isset($_SESSION['authenticated']) && $_SESSION['authenticated'] === true;

// SMTP settings
$smtp_settings = [
    'host' => 'mail.1984.is', // Replace with your SMTP host
    'port' => 587,
    'username' => 'notice@jim.pagetelegram.com', // Replace with your SMTP username
    'password' => 'hackme', // Replace with your SMTP password
    'from_email' => 'notice@jim.pagetelegram.com', // Replace with your from email
    'from_name' => 'Chat Room Notification with Jim/James'
];

// Load existing messages
$messages = [];
if (file_exists($messages_file)) {
    $messages = json_decode(file_get_contents($messages_file), true);
    if (!is_array($messages)) {
        $messages = [];
    }
}

// Load existing emails
$emails = [];
if (file_exists($emails_file)) {
    $handle = fopen($emails_file, 'r');
    while (($data = fgetcsv($handle)) !== false) {
        if (!empty($data[0])) {
            $emails[] = trim($data[0]);
        }
    }
    fclose($handle);
}

// Function to send email notification
function send_notification($smtp_settings, $emails, $new_message) {
    require 'vendor/autoload.php'; // Assumes PHPMailer is installed via Composer
    $mail = new PHPMailer\PHPMailer\PHPMailer();

    try {
        $mail->isSMTP();
        $mail->Host = $smtp_settings['host'];
        $mail->SMTPAuth = true;
        $mail->Username = $smtp_settings['username'];
        $mail->Password = $smtp_settings['password'];
        $mail->SMTPSecure = 'tls';
        $mail->Port = $smtp_settings['port'];

        $mail->setFrom($smtp_settings['from_email'], $smtp_settings['from_name']);
        foreach ($emails as $email) {
            $mail->addAddress($email);
        }

        $mail->isHTML(true);
        $mail->Subject = 'New Message in Chat Room';
        $mail->Body = "
            <h3>New Message Posted</h3>
            <p><strong>Name:</strong> {$new_message['name']}</p>
            <p><strong>Time:</strong> {$new_message['timestamp']} CST</p>
            <p><strong>Message:</strong><br>" . nl2br($new_message['message']) . "</p>
        ";

        $mail->send();
    } catch (Exception $e) {
        return "Email notification failed: {$mail->ErrorInfo}";
    }
    return true;
}

// Handle password submission
if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST["action"]) && $_POST["action"] == "login") {
    $password = $_POST["password"] ?? "";
    if ($password === $correct_password) {
        $_SESSION['authenticated'] = true;
        $is_authenticated = true;
    } else {
        $error = "Incorrect password";
    }
}

// Handle message submission
if ($is_authenticated && $_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST["action"]) && $_POST["action"] == "send_message") {
    $name = trim($_POST["name"] ?? "");
    $message = trim($_POST["message"] ?? "");

    if (empty($name) || empty($message)) {
        $error = "Name and message are required";
    } else {
        // Add new message
        $new_message = [
            "name" => htmlspecialchars($name),
            "message" => htmlspecialchars($message),
            "timestamp" => date("Y-m-d H:i:s")
        ];
        $messages[] = $new_message;

        // Save messages
        file_put_contents($messages_file, json_encode($messages, JSON_PRETTY_PRINT));
        
        // Send email notification
        if (!empty($emails)) {
            $email_result = send_notification($smtp_settings, $emails, $new_message);
            if ($email_result !== true) {
                $error = $email_result;
            } else {
                $success = "Message sent and notifications emailed";
            }
        } else {
            $success = "Message sent successfully";
        }
    }
}

// Handle email management
if ($is_authenticated && $_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST["action"]) && $_POST["action"] == "manage_emails") {
    if (isset($_POST["add_email"]) && !empty(trim($_POST["new_email"]))) {
        $new_email = filter_var(trim($_POST["new_email"]), FILTER_VALIDATE_EMAIL);
        if ($new_email && !in_array($new_email, $emails)) {
            $emails[] = $new_email;
            $success = "Email added successfully";
        } else {
            $error = "Invalid or duplicate email";
        }
    } elseif (isset($_POST["delete_email"])) {
        $email_to_delete = $_POST["delete_email"];
        if (($key = array_search($email_to_delete, $emails)) !== false) {
            unset($emails[$key]);
            $emails = array_values($emails);
            $success = "Email deleted successfully";
        } else {
            $error = "Email not found";
        }
    }

    // Save updated emails
    $handle = fopen($emails_file, 'w');
    foreach ($emails as $email) {
        fputcsv($handle, [$email]);
    }
    fclose($handle);
}

// Handle logout
if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST["action"]) && $_POST["action"] == "logout") {
    session_unset();
    session_destroy();
    $is_authenticated = false;
}
?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Private Messaging Room for Jim/James</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            max-width: 800px;
            margin: 0 auto;
            padding: 20px;
            background-color: #f5f5f5;
        }
        .chat-container {
            background-color: white;
            border-radius: 8px;
            padding: 20px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }
        .message {
            border-bottom: 1px solid #eee;
            padding: 10px 0;
            margin-bottom: 10px;
        }
        .message:last-child {
            border-bottom: none;
        }
        .timestamp {
            color: #666;
            font-size: 0.9em;
        }
        .name {
            font-weight: bold;
            color: #2c3e50;
        }
        form {
            margin-top: 20px;
            display: flex;
            flex-direction: column;
            gap: 10px;
        }
        input, textarea {
            padding: 8px;
            border: 1px solid #ddd;
            border-radius: 4px;
            font-size: 1em;
        }
        textarea {
            resize: vertical;
            min-height: 100px;
        }
        button {
            padding: 10px;
            background-color: #3498db;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-size: 1em;
        }
        button:hover {
            background-color: #2980b9;
        }
        .error {
            color: red;
            margin-bottom: 10px;
        }
        .success {
            color: green;
            margin-bottom: 10px;
        }
        .email-list {
            margin-top: 20px;
            padding: 10px;
            background-color: #f9f9f9;
            border-radius: 4px;
        }
        .email-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 5px 0;
        }
        .logout-button {
            background-color: #e74c3c;
            margin-top: 10px;
        }
        .logout-button:hover {
            background-color: #c0392b;
        }
    </style>
</head>
<body>
    <div class="chat-container">
        <h2>Private Messaging Room for James with Family and Friends</h2>

        <?php if (!$is_authenticated): ?>
            <?php if ($error): ?>
                <div class="error"><?php echo $error; ?></div>
            <?php endif; ?>
            <form method="post">
                <input type="hidden" name="action" value="login">
                <input type="password" name="password" placeholder="Enter password" required>
                <button type="submit">Enter Chat</button>
            </form>

        <?php else: ?>
            <?php if ($error): ?>
                <div class="error"><?php echo $error; ?></div>
            <?php endif; ?>
            <?php if ($success): ?>
                <div class="success"><?php echo $success; ?></div>
            <?php endif; ?>

            <div class="messages">
                <?php foreach ($messages as $msg): ?>
                    <div class="message">
                        <span class="name"><?php echo $msg['name']; ?></span>
                        <span class="timestamp">(<?php echo $msg['timestamp']; ?> CST)</span>
                        <p><?php echo nl2br($msg['message']); ?></p>
                    </div>
                <?php endforeach; ?>
            </div>

            <form method="post">
                <input type="hidden" name="action" value="send_message">
                <input type="text" name="name" placeholder="Your name" required>
                <textarea name="message" placeholder="Your message" required></textarea>
                <button type="submit">Send Message</button>
            </form>

            <div class="email-list">
                <h3>Manage Notification Emails</h3>
                <form method="post">
                    <input type="hidden" name="action" value="manage_emails">
                    <input type="email" name="new_email" placeholder="Add new email">
                    <button type="submit" name="add_email" value="1">Add Email</button>
                </form>
                <?php if (!empty($emails)): ?>
                    <?php foreach ($emails as $email): ?>
                        <div class="email-item">
                            <span><?php echo htmlspecialchars($email); ?></span>
                            <form method="post" style="display:inline;">
                                <input type="hidden" name="action" value="manage_emails">
                                <input type="hidden" name="delete_email" value="<?php echo htmlspecialchars($email); ?>">
                                <button type="submit" style="background-color: #e74c3c;">Delete</button>
                            </form>
                        </div>
                    <?php endforeach; ?>
                <?php else: ?>
                    <p>No notification emails configured.</p>
                <?php endif; ?>
            </div>

            <form method="post">
                <input type="hidden" name="action" value="logout">
                <button type="submit" class="logout-button">Logout</button>
            </form>
        <?php endif; ?>
    </div>
</body>
</html>