public static function readdSiteResponseProcessor($historyID, $responseData) { responseDirectErrorHandler($historyID, $responseData); if (empty($responseData['success'])) { return false; } if (!empty($responseData['success']['error'])) { //There is no variable "$responseData['error_data']" exists in plugin. especially, in add_site task. Error wont come in success array ... DB::update("?:history_additional_data", array('status' => 'error', 'errorMsg' => $responseData['success']['error'], 'error' => $responseData['success']['error_code']), "historyID='" . $historyID . "'"); } elseif (!empty($responseData['success'])) { DB::update("?:history_additional_data", array('status' => 'success'), "historyID='" . $historyID . "'"); $privateKey = $GLOBALS['storage']['oldSite']['readdSitePrivateKey']; $isOpenSSLActive = '1'; if ($responseData['success']['no_openssl']) { $privateKey = NULL; $isOpenSSLActive = '0'; } $URLParts = explode('/', $responseData['success']['site_home']); $siteData = array("privateKey" => $privateKey, "randomSignature" => $responseData['success']['no_openssl']); $siteID = DB::getField("?:history", "siteID", "historyID = '" . $historyID . "'"); DB::update("?:sites", $siteData, "siteID = '" . $siteID . "'"); DB::replace("?:user_access", array('userID' => $GLOBALS['userID'], 'siteID' => $siteID)); unset($GLOBALS['storage']['oldSite']); //---------------------------post process------------------------> $allParams = array('action' => 'getStats', 'args' => array('siteIDs' => array($siteID), 'extras' => array('directExecute' => true, 'doNotShowUser' => true))); panelRequestManager::handler($allParams); setHook('postReaddSite', $siteID); //check this once } }
public static function managePluginsThemesResponseProcessor($historyID, $responseData) { responseDirectErrorHandler($historyID, $responseData); if (empty($responseData['success'])) { return false; } if (!empty($responseData['success']['error'])) { DB::update("?:history_additional_data", array('status' => 'error', 'errorMsg' => $responseData['success']['error'], 'error' => $responseData['success']['error_code']), "historyID='" . $historyID . "'"); return false; } $type = DB::getField("?:history", "type", "historyID='" . $historyID . "'"); $siteID = DB::getField("?:history", "siteID", "historyID='" . $historyID . "'"); $successUniqueName = array(); $pluginsThemes = $responseData['success'][$type]; if (!empty($pluginsThemes)) { foreach ($pluginsThemes as $name => $status) { if ($status == 'OK') { $successUniqueName[] = $name; } else { if (!empty($status['error'])) { if ($status['error'] == 'The plugin generated unexpected output.') { //This was replicated from wordpress 3.8.3 $successUniqueName[] = $name; } else { DB::update("?:history_additional_data", array('status' => 'error', 'errorMsg' => $status['error'], 'error' => $status['error_code']), "historyID='" . $historyID . "' AND uniqueName = '" . $name . "'"); } } } } DB::update("?:history_additional_data", array('status' => 'success'), "historyID='" . $historyID . "' AND uniqueName IN ('" . implode("', '", $successUniqueName) . "')"); } $allParams = array('action' => 'getStats', 'args' => array('siteIDs' => array($siteID), 'extras' => array('sendAfterAllLoad' => false, 'doNotShowUser' => true))); panelRequestManager::handler($allParams); }
<?php /************************************************************ * InfiniteWP Admin panel * * Copyright (c) 2012 Revmakx * * www.revmakx.com * * * ************************************************************/ $ajaxPageTimeStart = $timeStart = microtime(true); define('IS_AJAX_FILE', true); require 'includes/app.php'; $result = panelRequestManager::handler($_REQUEST); if (Reg::get('settings.executeUsingBrowser') != 1) { if (!headers_sent()) { @ob_start("ob_gzhandler"); } echo $result; } else { outputStringAndCloseConnection($result); } function outputStringAndCloseConnection($stringToOutput) { @set_time_limit(3600); @ignore_user_abort(true); ini_set('zlib.output_compression', 'Off'); if (ini_get('zlib.output_compression') == 1 || ini_get('zlib.output_compression') == 'On' || ini_get('zlib.output_compression') === true) { $isGzipped = false; } else { $isGzipped = true; $stringToOutput = gzencode($stringToOutput, 9, FORCE_GZIP); }
public static function removeBackupResponseProcessor($historyID, $responseData) { responseDirectErrorHandler($historyID, $responseData); if (empty($responseData['success'])) { return false; } if (!empty($responseData['success']['error'])) { DB::update("?:history_additional_data", array('status' => 'error', 'errorMsg' => $responseData['success']['error'], 'error' => $responseData['success']['error_code']), "historyID='" . $historyID . "'"); return; } if (!empty($responseData['success'])) { DB::update("?:history_additional_data", array('status' => 'success'), "historyID='" . $historyID . "'"); } //---------------------------post process------------------------> $siteID = DB::getField("?:history", "siteID", "historyID='" . $historyID . "'"); $allParams = array('action' => 'getStats', 'args' => array('siteIDs' => array($siteID), 'extras' => array('sendAfterAllLoad' => false, 'doNotShowUser' => true))); panelRequestManager::handler($allParams); }
public static function updateClientResponseProcessor($historyID, $responseData) { responseDirectErrorHandler($historyID, $responseData); if (empty($responseData['success'])) { return false; } foreach ($responseData['success'] as $key => $value) { DB::update("?:history_additional_data", array('status' => $key, 'errorMsg' => $value), "historyID='" . $historyID . "' AND uniqueName = 'clientPlugin'"); if ($key == 'success') { //---------------------------callback process------------------------> $siteID = DB::getField("?:history", "siteID", "historyID='" . $historyID . "'"); // 'directExecute'=>true for client plugin update notification $allParams = array('action' => 'getStats', 'args' => array('siteIDs' => array($siteID), 'extras' => array('sendAfterAllLoad' => false, 'directExecute' => true, 'doNotShowUser' => true))); panelRequestManager::handler($allParams); } } }