It doesn't seem like the .php file ever attached
Hi, Here's the code form the offending PHP file:
<?php
//need to run installation wizard
if(!file_exists('../Connections/installed.txt') && (!file_exists('Connections/installed.txt'))) {
if(file_exists('../install/index.php')) {
header('Location: ../install/index.php');
} else {
header('Location: install/index.php');
}
exit();
}
?>
<?php
function replaceTokens($encodedVal,$Arr) {
$tokens = preg_match("/\\[([^\\]]*)\\]/",$encodedVal,$subMatch);
$retVal = $encodedVal;
if (sizeof($subMatch)>0) {
$ArrIndex = $subMatch[1];
$ArrPos = explode(":",$ArrIndex);
if (isset($Arr[$ArrPos[0]])) {
for ($x=0; $x<sizeof($Arr[$ArrPos[0]]); $x++) {
if ($Arr[$ArrPos[0]][$x][0] == $ArrPos[1]) {
$retVal = str_replace($subMatch[0],$Arr[$ArrPos[0]][$x][1],$retVal);
}
}
}
}
return $retVal;
}
?>
<?php
$thisDir = realpath(dirname(__FILE__));
if(strpos($thisDir,"/") !== false) {
$thisDir = substr($thisDir,0,strrpos($thisDir,"/"));
} else {
$thisDir = substr($thisDir,0,strrpos($thisDir,"\\"));
}
require_once($thisDir."/Connections/PowerStoreConnection.php");
mysql_select_db($database_PowerStoreConnection, $PowerStoreConnection);
$query_WAGlobals = "SELECT * FROM wa_settings";
$WAGlobals = mysql_query($query_WAGlobals, $PowerStoreConnection);
$row_WAGlobals = mysql_fetch_assoc($WAGlobals);
$tabs = array();
while ($row_WAGlobals) {
if ($row_WAGlobals['grp'] != "None") {
if (!isset($tabs[$row_WAGlobals['grp']])) {
$tabs[$row_WAGlobals['grp']] = array();
}
$tabs[$row_WAGlobals['grp']][] = array($row_WAGlobals['name'],$row_WAGlobals['value'],$row_WAGlobals['type'],$row_WAGlobals['options'],$row_WAGlobals['variable']);
}
$row_WAGlobals = mysql_fetch_assoc($WAGlobals);
}
foreach ($tabs as $key => $value) {
for ($x=0; $x<sizeof($value); $x++) {
eval("\$WAGLOBAL_".$value[$x][4]."='".replaceTokens($value[$x][1],$tabs)."';");
}
}
//root url
$WAGLOBAL_Root_URL = ((isset($_SERVER['SERVER_PROTOCOL']) && strpos($_SERVER['SERVER_PROTOCOL'], 'HTTPS') !== false) ? 'https://' : 'http://') . $_SERVER['SERVER_NAME'] . $WAGLOBAL_localRoot;
mysql_free_result($WAGlobals);
?>