if (!empty($sAction)) { set_time_limit(100); $sStart = new $sVPS->sType(); $sDBAction = "database_{$sVPS->sType}_{$sAction}"; $sServerAction = "{$sVPS->sType}_{$sAction}"; if (method_exists($sStart, $sDBAction) === true && method_exists($sStart, $sServerAction) === true) { $sDBResult = $sStart->{$sDBAction}($sUser, $sVPS, $sRequested); if (is_array($sDBResult)) { echo json_encode($sDBResult); die; } $sServerResult = $sStart->{$sServerAction}($sUser, $sVPS, $sRequested); if (!empty($sServerResult["json"])) { echo json_encode($sServerResult); die; } } else { echo json_encode(array("json" => 1, "type" => "error", "result" => "Invalid action requested. Please try again.", "reload" => 1)); die; } } // Check to make sure VPS isn't rebuilding. if ($sVPS->sRebuilding == 1) { $sUserView .= Templater::AdvancedParse($sTemplate->sValue . '/rebuild', $locale->strings, array("VPS" => array("data" => $sVPS->uData))); echo Templater::AdvancedParse($sTemplate->sValue . '/master', $locale->strings, array("Content" => $sUserView, "Page" => "main")); die; } $sVPSOwner = new User($sVPS->sUserId); $sUserView .= Templater::AdvancedParse($sTemplate->sValue . '/' . $sVPS->sType . '.view', $locale->strings, array("VPS" => array("data" => $sVPS->uData), "IPs" => VPS::list_ipspace($sVPS), "Templates" => VPS::list_templates($sVPS), "Servers" => VPS::list_servers($sVPS), "User" => array("data" => $sVPSOwner->uData), "UserVPSList" => VPS::list_uservps($sVPS))); echo Templater::AdvancedParse($sTemplate->sValue . '/master', $locale->strings, array("Content" => $sUserView, "Page" => "main")); die;