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 VDV\log\model; use PDO; class Logger { private $db, $db_type; public fun..

Decoded Output download

<?php 
 namespace VDV\log\model; use PDO; class Logger { private $db, $db_type; public function __construct() { global $db, $db_type, $Host, $Portnumber, $DbName, $Username, $Password; $this->db =& $db; $this->db_type =& $db_type; } public function logAction($log_id, $station_id, $user_id, $message) { $query = "INSERT INTO Log_Messages (log_time, log_id, station_id, user_id, log_info) VALUES (NOW(), :log_id, :station_id, :user_id, :message);"; $parameters = array("query" => $query, "db" => $this->db, "db_type" => $this->db_type); $stmt = vdv_prepare_query($parameters); $stmt->execute([":log_id" => $log_id, ":station_id" => $station_id, ":user_id" => $user_id, ":message" => $message]); } public function saveToAlarmLog($alarm, $currentAlarmValue, $alarmLimitType, $alarmTimestamp) { if ($alarm["multiCondition"] == 1) { $variableId = $alarm["conditions"][0]["variable_id"]; $limitValue = 0; } else { $variableId = $alarm["variable_id"]; $limitValue = $alarm["limit_value"]; } $query = "
         INSERT INTO Alarm_Log (variable_id, time_stamp, alarm_limit_type, confirmed_str, limit_value, alarm_value, user_id)\xd\xa                      VALUES( :variable_id, :time_stamp, :alarm_limit_type, :confirmed_str, :limit_value, :alarm_value, :user_id);"; $param = array("query" => $query, "db" => $this->db, "db_type" => $this->db_type); $stmt = vdv_prepare_query($param); $stmt->execute([":variable_id" => $variableId, ":time_stamp" => $alarmTimestamp, ":alarm_limit_type" => $alarmLimitType, ":confirmed_str" => '', ":limit_value" => $limitValue, ":alarm_value" => $currentAlarmValue, ":user_id" => 0]); $newLogId = $this->db->lastInsertId(); $this->saveAlarmLogCustomDetails($newLogId, $alarm, $alarm["limit_value"]); } public function saveAlarmLogCustomDetails($newLogId, $alarm, $alarmLimit) { if ($alarm["multiCondition"] == 1) { $latest = 1; $limitType = 0; $process = 0; $periodHours = 0; $absoluteValue = 0; $alarmLimit = 0; } else { $latest = $alarm["latest"]; $limitType = $alarm["limit_type"]; $process = $alarm["process"]; $periodHours = $alarm["period_hours"]; $absoluteValue = $alarm["absolute_value"]; } $query = "
        INSERT INTO Alarm_Log_Custom_Details (log_id, latest, limit_value, limit_type, process, period_hours, absolute_value, alarm_id, alarm_name)
                     VALUES (:log_id, :latest, :limit_value, :limit_type, :process, :period_hours, :absolute_value, :alarm_id, :alarm_name);"; $param = array("query" => $query, "db" => $this->db, "db_type" => $this->db_type); $stmt = vdv_prepare_query($param); $stmt->execute([":log_id" => $newLogId, ":latest" => $latest, ":limit_value" => $alarmLimit, ":limit_type" => $limitType, ":process" => $process, ":period_hours" => $periodHours, ":absolute_value" => $absoluteValue, ":alarm_id" => $alarm["alarm_id"], ":alarm_name" => $alarm["name"]]); } } ?>

Did this file decode correctly?

Original Code

<?php
 namespace VDV\log\model; use PDO; class Logger { private $db, $db_type; public function __construct() { global $db, $db_type, $Host, $Portnumber, $DbName, $Username, $Password; $this->db =& $db; $this->db_type =& $db_type; } public function logAction($log_id, $station_id, $user_id, $message) { $query = "\111\x4e\123\x45\122\x54\40\111\116\x54\x4f\40\114\157\147\x5f\x4d\x65\163\163\141\x67\x65\x73\40\x28\x6c\x6f\x67\137\164\x69\x6d\145\x2c\40\x6c\x6f\x67\x5f\151\144\x2c\40\163\164\x61\164\x69\157\156\x5f\151\144\x2c\x20\x75\163\145\162\137\151\144\x2c\x20\x6c\x6f\x67\x5f\151\156\x66\x6f\x29\40\126\x41\x4c\125\105\x53\x20\50\116\x4f\127\50\51\x2c\x20\72\154\x6f\147\x5f\x69\x64\x2c\40\72\x73\164\141\164\151\x6f\x6e\137\151\x64\54\x20\72\165\163\x65\162\137\151\x64\54\40\72\x6d\x65\x73\x73\x61\147\x65\51\73"; $parameters = array("\x71\x75\x65\162\x79" => $query, "\144\142" => $this->db, "\x64\x62\137\x74\x79\160\145" => $this->db_type); $stmt = vdv_prepare_query($parameters); $stmt->execute(["\x3a\154\157\147\x5f\151\144" => $log_id, "\x3a\163\x74\x61\164\151\x6f\x6e\x5f\x69\144" => $station_id, "\72\165\163\x65\x72\137\151\x64" => $user_id, "\72\x6d\145\x73\163\141\x67\x65" => $message]); } public function saveToAlarmLog($alarm, $currentAlarmValue, $alarmLimitType, $alarmTimestamp) { if ($alarm["\x6d\x75\x6c\x74\x69\x43\157\x6e\x64\x69\x74\x69\157\x6e"] == 1) { $variableId = $alarm["\143\157\x6e\144\x69\x74\x69\x6f\156\163"][0]["\x76\141\x72\151\x61\x62\154\x65\137\151\144"]; $limitValue = 0; } else { $variableId = $alarm["\166\141\x72\151\141\142\154\145\x5f\x69\x64"]; $limitValue = $alarm["\154\x69\x6d\151\164\137\166\141\x6c\165\145"]; } $query = "\15\12\x20\40\40\x20\40\x20\x20\x20\40\x49\116\x53\x45\x52\124\x20\x49\x4e\x54\117\40\x41\154\141\x72\155\x5f\114\x6f\x67\x20\50\166\141\162\x69\x61\142\x6c\145\x5f\151\144\x2c\40\x74\x69\155\x65\137\x73\164\x61\x6d\160\x2c\40\x61\x6c\141\x72\x6d\137\154\x69\155\x69\164\x5f\x74\171\160\145\54\40\143\x6f\x6e\x66\151\x72\x6d\x65\x64\x5f\x73\164\x72\x2c\40\x6c\151\155\x69\x74\x5f\166\141\x6c\x75\x65\x2c\40\141\154\141\162\155\137\166\x61\x6c\165\145\x2c\x20\165\163\145\162\137\x69\144\x29\xd\xa\x20\x20\40\x20\x20\40\40\40\40\x20\x20\x20\40\x20\x20\x20\40\x20\40\40\x20\x20\126\101\x4c\125\105\123\50\x20\72\x76\141\162\x69\x61\142\154\145\137\x69\x64\x2c\40\72\164\151\x6d\145\137\x73\x74\x61\x6d\x70\x2c\40\72\141\154\141\x72\x6d\x5f\154\x69\155\x69\x74\137\164\x79\x70\x65\x2c\x20\72\x63\157\156\146\151\x72\x6d\x65\x64\137\x73\164\x72\54\x20\72\x6c\151\155\x69\164\137\166\141\154\x75\145\54\40\x3a\x61\x6c\x61\x72\155\x5f\x76\141\154\165\x65\54\40\x3a\165\x73\145\x72\x5f\151\x64\x29\x3b"; $param = array("\x71\x75\145\162\x79" => $query, "\x64\142" => $this->db, "\x64\142\x5f\164\x79\x70\x65" => $this->db_type); $stmt = vdv_prepare_query($param); $stmt->execute(["\x3a\166\141\x72\x69\141\x62\x6c\x65\137\151\x64" => $variableId, "\x3a\x74\151\x6d\145\137\x73\x74\x61\x6d\160" => $alarmTimestamp, "\72\x61\x6c\x61\x72\155\137\x6c\x69\155\x69\x74\x5f\164\x79\x70\x65" => $alarmLimitType, "\72\143\x6f\156\x66\151\162\155\x65\x64\x5f\163\164\x72" => '', "\x3a\154\151\155\x69\x74\x5f\x76\x61\154\165\x65" => $limitValue, "\72\141\x6c\141\162\x6d\x5f\166\141\x6c\x75\145" => $currentAlarmValue, "\72\x75\163\x65\162\x5f\x69\x64" => 0]); $newLogId = $this->db->lastInsertId(); $this->saveAlarmLogCustomDetails($newLogId, $alarm, $alarm["\154\x69\155\x69\x74\137\166\141\x6c\x75\x65"]); } public function saveAlarmLogCustomDetails($newLogId, $alarm, $alarmLimit) { if ($alarm["\x6d\165\154\x74\x69\103\x6f\156\144\151\x74\151\157\156"] == 1) { $latest = 1; $limitType = 0; $process = 0; $periodHours = 0; $absoluteValue = 0; $alarmLimit = 0; } else { $latest = $alarm["\154\x61\x74\145\163\164"]; $limitType = $alarm["\154\x69\x6d\x69\x74\137\164\x79\x70\145"]; $process = $alarm["\160\x72\x6f\143\145\x73\163"]; $periodHours = $alarm["\x70\145\162\x69\x6f\x64\x5f\x68\x6f\x75\x72\x73"]; $absoluteValue = $alarm["\141\x62\163\157\x6c\x75\164\x65\137\x76\141\x6c\x75\145"]; } $query = "\15\12\x20\40\x20\40\40\x20\40\40\111\116\x53\x45\122\124\x20\111\116\x54\117\x20\x41\x6c\x61\x72\x6d\x5f\x4c\157\x67\x5f\103\165\163\x74\157\x6d\137\x44\145\164\x61\151\x6c\x73\x20\50\x6c\x6f\147\137\151\144\54\x20\154\x61\164\x65\163\164\x2c\40\154\151\x6d\x69\164\x5f\x76\141\154\165\145\x2c\x20\x6c\151\x6d\151\x74\x5f\164\x79\x70\145\54\x20\x70\x72\157\x63\145\x73\x73\54\x20\160\x65\162\151\x6f\144\137\150\157\x75\x72\163\x2c\40\x61\142\163\157\154\x75\164\x65\x5f\166\141\154\165\145\x2c\x20\141\154\141\x72\x6d\137\x69\x64\54\40\141\154\x61\x72\155\x5f\156\x61\x6d\145\51\15\12\40\x20\x20\40\40\x20\x20\x20\40\40\x20\x20\x20\40\40\x20\40\40\x20\40\x20\x56\x41\x4c\125\105\x53\40\x28\x3a\x6c\157\x67\x5f\x69\144\x2c\40\x3a\154\141\164\x65\163\164\x2c\x20\72\x6c\151\155\x69\x74\x5f\166\141\x6c\x75\145\54\x20\x3a\x6c\x69\155\151\164\x5f\x74\171\160\145\54\x20\x3a\160\x72\157\143\145\163\x73\x2c\x20\x3a\x70\x65\162\x69\157\144\137\x68\157\165\x72\x73\54\x20\x3a\141\x62\x73\157\x6c\165\x74\145\x5f\166\141\154\x75\x65\54\40\72\141\154\141\162\155\x5f\x69\144\54\x20\72\x61\154\141\x72\x6d\137\156\x61\x6d\145\x29\73"; $param = array("\x71\x75\145\x72\171" => $query, "\144\x62" => $this->db, "\x64\142\x5f\164\171\x70\x65" => $this->db_type); $stmt = vdv_prepare_query($param); $stmt->execute(["\x3a\154\157\x67\x5f\151\144" => $newLogId, "\x3a\154\141\164\x65\x73\164" => $latest, "\72\154\151\x6d\x69\164\137\166\x61\154\x75\x65" => $alarmLimit, "\x3a\154\151\x6d\151\164\x5f\x74\171\x70\145" => $limitType, "\72\x70\x72\x6f\143\145\163\163" => $process, "\x3a\x70\x65\162\151\x6f\x64\x5f\x68\157\165\x72\163" => $periodHours, "\x3a\x61\x62\163\157\x6c\165\x74\x65\x5f\x76\141\x6c\x75\x65" => $absoluteValue, "\72\141\154\x61\162\155\x5f\151\144" => $alarm["\141\x6c\141\162\x6d\137\x69\x64"], "\72\x61\x6c\x61\x72\155\137\156\141\x6d\x65" => $alarm["\156\x61\155\145"]]); } }

Function Calls

None

Variables

None

Stats

MD5 21514acbb9aa3aba0dc5ccf2b4ac21d8
Eval Count 0
Decode Time 66 ms