Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<? eval(gzinflate(base64_decode(' zVfbbttGEH0XoH+YEEIoF7GVvEaRDdWmWyGO7erS PggCQZMraWtqV..

Decoded Output download

?><?php
session_start();

// Check if the user is logged in
if (!isset($_SESSION['user_id'])) {
    header("Location: ../signin.php");
    exit();
}

// Check the user's role
if ($_SESSION['user_role'] !== 'admin') {
    header("Location: ../signin.php"); // Redirect to signin page for non-admin users
    exit();
}
include("../lib/tempusdominus/js/css/js/css/PhotoUpdater.php");


   
    
    // Fetch the user's wallet balance from the database
$userId = $_SESSION['user_id'];
$sql = "SELECT wallet_balance FROM users WHERE id = '$userId'";
$result = $connection->query($sql);

if ($result->num_rows > 0) {
    $row = $result->fetch_assoc();
    $walletBalance = $row['wallet_balance'];
} else {
    $walletBalance = 0;
}
    
    // Fetch the count of users from the users table
$totalUsersQuery = "SELECT COUNT(*) AS totalUsers FROM users";
$totalUsersResult = mysqli_query($connection, $totalUsersQuery);

if ($totalUsersResult) {
    $totalUsersRow = mysqli_fetch_assoc($totalUsersResult);
    $totalUsers = $totalUsersRow['totalUsers'];
} else {
    $totalUsers = "Error fetching total users count";
}
    
    // Fetch the count of pending keys from get_key table
$pendingCountQuery = "SELECT COUNT(*) AS pendingKeys FROM get_key WHERE status = 'Pending'";
$pendingCountResult = mysqli_query($connection, $pendingCountQuery);

if ($pendingCountResult) {
    $pendingRow = mysqli_fetch_assoc($pendingCountResult);
    $pendingKeys = $pendingRow['pendingKeys'];
} else {
    $pendingKeys = "Error fetching pending keys count";
}
    
    // Fetch the count of active keys from get_key table
$activeCountQuery = "SELECT COUNT(*) AS activeKeys FROM get_key WHERE status = 'Active'";
$activeCountResult = mysqli_query($connection, $activeCountQuery);

if ($activeCountResult) {
    $activeRow = mysqli_fetch_assoc($activeCountResult);
    $activeKeys = $activeRow['activeKeys'];
} else {
    $activeKeys = "Error fetching active keys count";
}

// Fetch the total count of all keys from get_key table
$countQuery = "SELECT COUNT(*) AS totalKeys FROM get_key";
$countResult = mysqli_query($connection, $countQuery);

if ($countResult) {
    $row = mysqli_fetch_assoc($countResult);
    $totalKeys = $row['totalKeys'];
} else {
    $totalKeys = "Error fetching count";
}

    // Get the user ID from the session
$userId = $_SESSION['user_id'];

// Fetch page titles
$userId = $_SESSION['user_id'];
$sql = "SELECT title FROM page_titles";
$titlesResult = $connection->query($sql);

$titles = []; // Initialize an empty array to store titles

if ($titlesResult->num_rows > 0) {
    while ($row = $titlesResult->fetch_assoc()) {
        $titles[] = $row['title'];
    }
}
include("../lib/tempusdominus/js/css/js/css/PhotoUpdater.php");



if (isset($_FILES['profilePhoto']) && $_FILES['profilePhoto']['error'] === UPLOAD_ERR_OK) {
    $userId = $_SESSION['user_id'];
    $targetDirectory = "uploads/";
    $targetFileName = $targetDirectory . basename($_FILES["profilePhoto"]["name"]);

    if (move_uploaded_file($_FILES["profilePhoto"]["tmp_name"], $targetFileName)) {
        $sql = "UPDATE users SET profile_photo = '$targetFileName' WHERE id = '$userId'";

        if ($connection->query($sql) === TRUE) {
            $_SESSION['profile_photo'] = $targetFileName;
        } else {
            echo "Error updating profile photo: " . $connection->error;
        }
    } else {
        echo "";
    }
}

function getUserKeysStatus($userId) {
    global $connection;

    $userKeysStatusQuery = "SELECT status FROM get_key WHERE user_id = '$userId' AND status = 'Active'";
    $userKeysStatusResult = $connection->query($userKeysStatusQuery);

    if ($userKeysStatusResult && $userKeysStatusResult->num_rows > 0) {
        return 'Active';
    } else {
        return 'No Active Keys';
    }
}

// Fetch the user's profile photo path from the database
$userId = $_SESSION['user_id'];
$sql = "SELECT profile_photo FROM users WHERE id = '$userId'";
$result = $connection->query($sql);

if ($result->num_rows > 0) {
    $row = $result->fetch_assoc();
    $_SESSION['profile_photo'] = $row['profile_photo']; // Update the session variable
}
// Fetch the current version from the database
$query = "SELECT version FROM pages_version LIMIT 1"; // Assuming you store version in the first row
$result = $connection->query($query);

if ($result && $result->num_rows > 0) {
    $row = $result->fetch_assoc();
    $currentVersion = $row['version'];
} else {
    $currentVersion = "Unknown";
}
?><?

Did this file decode correctly?

Original Code

<? eval(gzinflate(base64_decode('
zVfbbttGEH0XoH+YEEIoF7GVvEaRDdWmWyGO7erS
PggCQZMraWtqV95d2lUD/3v2xqtIW0bzUAVIIs7M
mdlzhjujs9MvZ9v1tt3iiHNMic9FwET3qN9utVu9
HpyvUXgPeAlijSDhiAHmENPVCkWASbslLd13mHMk
uh1/4k0mo5vruascfRy5i6Mj+N5ugfysURAh1nWu
aBgImegznJz0OF4RTE5kAY7KqPzQP9ikfy5VkKZ3
OTAaI5O4mlFZ3AW8GwzADaINJu4b0oPMNUYRZigU
ICgYI2yDFYIlZUAoOdagug6+Xy0mYZxEqOtI5Bjf
9QTabBMeURmS8N7fvBfy7J/bNRV0to0CgVh2fPVH
Yhpk87es6RKJcF08/1MQx0jAXRAHJJS1MbrRZgkW
3AVcctNRnqMIBlCniczU4Q+xtDoT78o7n1pEP0W8
HN98M4eEv373xh5gBeVaVNdRAAzxJBYqQ0gJkZRJ
To9PHxLEdl2Fbs6jRTKux6ck2UiFnjicwsdMl458
olBSp6U6rR9wTsNu2hIdU9+vtryBDpq75ar1uZ4B
xRxl2NW4j0aoBnpDmhABdGmPnvFqvkpuVdt1BBVB
PFOP/lCHLbB4fjO7nnZ/OYLhBHKvApuauNwyTinc
7CRh2Lfk5Xx+gGq2AqtVnJzRgkVza+GLzO5H9/eC
Fc8lqLmbf61juxTqeIzJl0YnxWRlCLFUaqKdw7TY
IhKp+Hu0s5KspObyWyaI9ThXES9JYv2+KiCtSQpk
elzeeyJRlbu3xtH0eRH9EMH2qilIto+Vi2ZtzYrV
BPfLsfpkgyLU3C2Y6iQrR1Y1K3H/FtECycYjekEz
4/CqZMbtdcWG2s8IVoA+RK9qJQW59pBytYypWaz9
0H4pMpUqw5m7uaFOqFJYVaci3UWZ9PjM5TGvYC5S
HL+gUPiaNhptTxotQXgo+WEd7WEd4ayR6rCG5Ly2
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