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); }
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 } }
$sitesData = json_encode(panelRequestManager::getSites()); $sitesListData = json_encode(panelRequestManager::getSitesList()); $groupData = json_encode(panelRequestManager::getGroupsSites()); $updateAvailable = json_encode(checkUpdate(false, false)); $updateAvailableNotify = json_encode(panelRequestManager::isUpdateHideNotify()); $totalSettings = json_encode(array("data" => panelRequestManager::requiredData(array("getSettingsAll" => 1)))); $fixedNotifications = json_encode(getNotifications(true)); $cronFrequency = json_encode(getRealSystemCronRunningFrequency()); $clientUpdatesAvailable = json_encode(panelRequestManager::getClientUpdateAvailableSiteIDs()); $purchasedAddons = json_encode(Reg::get('purchasedAddons')); $allAddonsBought = json_encode(Reg::get('addonDetails')); //$allAddonsBought = json_encode(Reg::get('activeAddons')); //$allAddonsBought = json_encode(Reg::get('allPurchasedAddonsNameAndSlug')); $multiUserAllowAccess = json_encode(panelRequestManager::requiredData(array("multiUserAllowAccess" => 1))); //for notification center html $notifCenterData = json_encode(panelRequestManager::requiredData(array("updateNotificationContent" => 1))); $min = '.min'; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "//www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="//www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="robots" content="noindex"> <title>InfiniteWP</title> <link href='//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,700italic,800italic,400,300,700,800' rel='stylesheet' type='text/css'> <link rel="stylesheet" href="css/select2.css?<?php echo APP_VERSION; ?> " type="text/css" /> <link rel="stylesheet" href="css/core<?php echo $min;
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); }
function cronNotRunAlert() { if (manageEasyCron::isActive()) { return; //if easyCron is active no need of following check and alert } //cron job should run every 20 mins $cronLastRun = getOption('cronLastRun'); if ($cronLastRun > time() - 40 * 60) { //checking for 40 mins instead of 20 mins here return; } $requiredFor = array(); $settings = panelRequestManager::getSettings(); $updatesNotificationMail = $settings['notifications']['updatesNotificationMail']; //check setting if (!($updatesNotificationMail['frequency'] == 'never' || empty($updatesNotificationMail['coreUpdates']) && empty($updatesNotificationMail['pluginUpdates']) && empty($updatesNotificationMail['themeUpdates']))) { $requiredFor[] = 'Email Update Notification'; } setHook('cronRequiredAlert', $requiredFor); if (!empty($requiredFor)) { addNotification($type = 'E', $title = 'CRON JOB IS NOT RUNNING', $message = 'Please set the cron job to run every 20 minutes.<div class="droid700" style="white-space: pre; word-wrap: break-word;">' . APP_PHP_CRON_CMD . APP_ROOT . '/cron.php >/dev/null 2>&1</div><br>It is required for the following -<br>' . @implode('<br>', $requiredFor), $state = 'U', $callbackOnClose = '', $callbackReference = ''); } }
public static function getTimeZones() { $timezones = panelRequestManager::generate_timezone_list(); return array('timeZones' => $timezones); }
$result = self::$easyCronAPIObj->disable(self::$taskCronID); return $result; } /* * To enable manage cron (30 mins) */ public static function manageCronEnable() { self::loadAPIDetails(); $result = self::$easyCronAPIObj->enable(self::$manageCronID); return $result; } /* * To get API token from DB */ private static function loadAPIDetails() { self::$easyCronAPIObj = new easyCronAPI(); self::$token = getOption("easyCronToken"); self::$easyCronAPIObj->setToken(self::$token); $jobIDs = array(); $easyCronJobIDs = getOption("easyCronJobIDs"); if (!empty($easyCronJobIDs)) { $jobIDs = unserialize($easyCronJobIDs); } self::$manageCronID = $jobIDs['manageCronID']; self::$taskCronID = $jobIDs['taskCronID']; } } panelRequestManager::addFunctions('manageEasyCron::activate', 'manageEasyCron::deactivate', 'manageEasyCron::isActive', 'manageEasyCron::taskCronEnable', 'manageEasyCron::taskCronDisable', 'manageEasyCron::manageCronEnable', 'manageEasyCron::getTokenFromDB');
<?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 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); } } }