if (STATS_ACTIVE && !LOGIN) { $STATS->ProcessAction(ST_ACTION_LOG_STATUS, array($INTERNAL[CALLER_SYSTEM_ID])); } } else { if ($_POST[POST_INTERN_SERVER_ACTION] == INTERN_ACTION_INIT_UPLOAD) { initUpload(); } else { if ($_POST[POST_INTERN_SERVER_ACTION] == INTERN_ACTION_SEND_FILE) { receiveFile(); } else { if ($_POST[POST_INTERN_SERVER_ACTION] == INTERN_ACTION_REMOVE_FILE) { removeFile(); } else { if ($_POST[POST_INTERN_SERVER_ACTION] == INTERN_ACTION_SET_IDLE) { require LIVEZILLA_PATH . "_lib/functions.internal.man.inc.php"; setIdle($_POST[POST_INTERN_SERVER_IDLE]); } else { if ($_POST[POST_INTERN_SERVER_ACTION] == INTERN_ACTION_SEND_RESOURCES) { require LIVEZILLA_PATH . "_lib/functions.internal.process.inc.php"; processUpdateReport(); processArchiveChats(); processResources(); } else { if ($_POST[POST_INTERN_SERVER_ACTION] == INTERN_ACTION_REPORTS) { require LIVEZILLA_PATH . "_lib/functions.internal.process.inc.php"; require LIVEZILLA_PATH . "_lib/functions.internal.build.inc.php"; processUpdateReport(); buildReports(); } else { if ($_POST[POST_INTERN_SERVER_ACTION] == INTERN_ACTION_DATABASE_TEST) { require LIVEZILLA_PATH . "_lib/functions.internal.man.inc.php";
function error($msg) { // TMP: return HTTP 500 http_response_code(404); die; global $imgSrc, $imgThumb, $imgFile, $thWidth, $thHeight; if (!$thWidth || !$thHeight) { $thWidth = 640; $thHeight = 200; } if ($imgSrc) { imagedestroy($imgSrc); } if ($ImgThumb) { imagedestroy($ImgThumb); } // Create a 300x100 image $im = imagecreatetruecolor($thWidth, $thHeight); $black = imagecolorallocate($im, 0x0, 0x0, 0x0); $white = imagecolorallocate($im, 0xff, 0xff, 0xff); // Make the background red imagefilledrectangle($im, 0, 0, 500, 100, $black); // Path to our ttf font file $font_file = './arial.ttf'; // Draw the text imagefttext($im, 7, 0, 2, 10, $white, $font_file, "rgThumb.Err:\n{$msg}\n" . $imgFile . "\n" . date("Ymd")); // Output image to the browser header('Content-Type: image/png'); imagepng($im); imagedestroy($im); setIdle(); die; }
imagejpeg($imgThumb, NULL, $thQuality); break; } // Cleanup imagedestroy($imgSrc); imagedestroy($imgThumb); if ($tmpfilepath) { unlink($tmpfilepath); } if ($deleteTmpImage) { unlink("tmp.image"); } setIdle(); ?>
function setConfig($id = 0) { global $INTERNAL, $RESPONSE, $STATS; if (SERVERSETUP && $INTERNAL[CALLER_SYSTEM_ID]->Level == USER_LEVEL_ADMIN) { if (STATS_ACTIVE && isset($_POST[POST_INTERN_RESET_STATS]) && $_POST[POST_INTERN_RESET_STATS] == "1") { $STATS->ResetAll(); } $id = createFile(FILE_CONFIG, base64_decode($_POST[POST_INTERN_UPLOAD_VALUE]), true); if (isset($_POST[POST_INTERN_SERVER_AVAILABILITY])) { setAvailability($_POST[POST_INTERN_SERVER_AVAILABILITY]); } if (isset($_POST[POST_INTERN_FILE_CARRIER_LOGO]) && strlen($_POST[POST_INTERN_FILE_CARRIER_LOGO]) > 0) { base64ToFile(FILE_CARRIERLOGO, $_POST[POST_INTERN_FILE_CARRIER_LOGO]); } else { if (isset($_POST[POST_INTERN_FILE_CARRIER_LOGO]) && file_exists(FILE_CARRIERLOGO)) { @unlink(FILE_CARRIERLOGO); } } if (isset($_POST[POST_INTERN_FILE_CARRIER_HEADER]) && strlen($_POST[POST_INTERN_FILE_CARRIER_HEADER]) > 0) { base64ToFile(FILE_CARRIERHEADER, $_POST[POST_INTERN_FILE_CARRIER_HEADER]); } else { if (isset($_POST[POST_INTERN_FILE_CARRIER_HEADER]) && file_exists(FILE_CARRIERHEADER)) { @unlink(FILE_CARRIERHEADER); } } if (isset($_POST[POST_INTERN_FILE_INVITATION_LOGO]) && strlen($_POST[POST_INTERN_FILE_INVITATION_LOGO]) > 0) { base64ToFile(FILE_INVITATIONLOGO, $_POST[POST_INTERN_FILE_INVITATION_LOGO]); } else { if (isset($_POST[POST_INTERN_FILE_INVITATION_LOGO]) && file_exists(FILE_INVITATIONLOGO)) { @unlink(FILE_INVITATIONLOGO); } } $int = 1; while (isset($_POST[POST_INTERN_DOWNLOAD_TRANSLATION_ISO . "_" . $int]) && strpos($_POST[POST_INTERN_DOWNLOAD_TRANSLATION_ISO . "_" . $int], "..") === false) { if (!isset($_POST[POST_INTERN_DOWNLOAD_TRANSLATION_DELETE . "_" . $int])) { createFile("./_language/lang" . strtolower($_POST[POST_INTERN_DOWNLOAD_TRANSLATION_ISO . "_" . $int]) . ".php", slashesStrip($_POST[POST_INTERN_DOWNLOAD_TRANSLATION_CONTENT . "_" . $int]), true); } else { @unlink("./_language/lang" . strtolower($_POST[POST_INTERN_DOWNLOAD_TRANSLATION_ISO . "_" . $int]) . ".php"); } $int++; } } removeSSpanFile(true); setIdle(0); $RESPONSE->SetStandardResponse($id, ""); }
function setConfig($id = 0) { global $INTERNAL, $RESPONSE, $STATS, $CONFIG; administrationLog("setConfig", "", CALLER_SYSTEM_ID); if (isValidated() && ($INTERNAL[CALLER_SYSTEM_ID]->Level == USER_LEVEL_ADMIN || in_array($CONFIG["gl_host"], $INTERNAL[CALLER_SYSTEM_ID]->WebsitesConfig))) { if (is("STATS_ACTIVE") && !empty($_POST["p_reset_stats"])) { $STATS->ResetAll(); } $int = 0; $file = ISSUBSITE || $INTERNAL[CALLER_SYSTEM_ID]->Level != USER_LEVEL_ADMIN ? str_replace("config.inc", "config." . SUBSITEHOST . ".inc", FILE_CONFIG) : FILE_CONFIG; if (DB_CONNECTION && (!ISSUBSITE || file_exists($file))) { queryDB(true, "UPDATE `" . DB_PREFIX . DATABASE_COMMERCIAL_CHAT_TYPES . "` SET `delete`='1';"); queryDB(true, "DELETE FROM `" . DB_PREFIX . DATABASE_COMMERCIAL_CHAT_LOCALIZATIONS . "`;"); while (!empty($_POST["p_cfg_cct_id_" . $int])) { $cct = new CommercialChatBillingType($_POST["p_cfg_cct_id_" . $int], $_POST["p_cfg_cct_mnoc_" . $int], $_POST["p_cfg_cct_mtloc_" . $int], $_POST["p_cfg_cct_tae_" . $int], $_POST["p_cfg_cct_tvbo_" . $int], $_POST["p_cfg_cct_svbo_" . $int], $_POST["p_cfg_cct_evbo_" . $int], $_POST["p_cfg_cct_citl_" . $int], $_POST["p_cfg_cct_p_" . $int]); $cct->Save(); $iint = 0; while (!empty($_POST["p_cfg_cctli_id_" . $int . "_" . $iint])) { $cctl = new CommercialChatVoucherLocalization($_POST["p_cfg_cctli_id_" . $int . "_" . $iint], $_POST["p_cfg_cctli_itl_" . $int . "_" . $iint], $_POST["p_cfg_cctli_t_" . $int . "_" . $iint], $_POST["p_cfg_cctli_d_" . $int . "_" . $iint], $_POST["p_cfg_cctli_terms_" . $int . "_" . $iint], $_POST["p_cfg_cctli_emvc_" . $int . "_" . $iint], $_POST["p_cfg_cctli_emvp_" . $int . "_" . $iint], $_POST["p_cfg_cctli_emvu_" . $int . "_" . $iint], $_POST["p_cfg_cctli_exr_" . $int . "_" . $iint]); $cctl->Save($_POST["p_cfg_cct_id_" . $int]); $iint++; } $int++; } $int = 0; queryDB(true, "DELETE FROM `" . DB_PREFIX . DATABASE_COMMERCIAL_CHAT_PROVIDERS . "`;"); while (!empty($_POST["p_cfg_ccpp_id_" . $int])) { $ccpp = new CommercialChatPaymentProvider($_POST["p_cfg_ccpp_id_" . $int], $_POST["p_cfg_ccpp_n_" . $int], $_POST["p_cfg_ccpp_a_" . $int], $_POST["p_cfg_ccpp_u_" . $int], $_POST["p_cfg_ccpp_l_" . $int]); $ccpp->Save(); $int++; } $int = 0; queryDB(true, "DELETE FROM `" . DB_PREFIX . DATABASE_MAILBOXES . "`;"); while (!empty($_POST["p_cfg_es_i_" . $int])) { $acc = new Mailbox($int, true); $acc->Save(); $int++; } queryDB(true, "DELETE FROM `" . DB_PREFIX . DATABASE_COMMERCIAL_CHAT_TYPES . "` WHERE `delete`='1';"); queryDB(true, "DELETE FROM `" . DB_PREFIX . DATABASE_CONFIG . "`;"); foreach ($_POST as $key => $value) { if (strpos($key, "p_cfg_g_") === 0) { $skey = str_replace("p_cfg_g_", "", $key); $value = base64_decode($value); queryDB(true, "REPLACE INTO `" . DB_PREFIX . DATABASE_CONFIG . "` (`key`,`value`) VALUES ('" . DBManager::RealEscape($skey) . "','" . DBManager::RealEscape($value) . "');"); } } } if (isset($_POST["p_available"])) { setAvailability(!empty($_POST["p_available"])); } $id = createFile($file, base64_decode($_POST["p_upload_value"]), true); $int = 1; $delete = false; while (isset($_POST["p_int_trans_iso_" . $int]) && strpos($_POST["p_int_trans_iso_" . $int], "..") === false) { $file = getLocalizationFileString($_POST["p_int_trans_iso_" . $int], false); if (!isset($_POST["p_int_trans_delete_" . $int])) { createFile($file, $_POST["p_int_trans_content_" . $int], true); } else { $delete = true; if (file_exists($file)) { @unlink($file); } if (empty($CONFIG["gl_root"])) { createFile($file, "", true); } } $int++; } if (!$delete && (!@file_exists($file) || @file_exists($file) && @filemtime($file) !== false && @filemtime($file) < time() - 10)) { header("HTTP/1.1 502 Bad Gateway"); exit("HTTP/1.1 502 Bad Gateway"); } } removeSSpanFile(true); setIdle(0); $RESPONSE->SetStandardResponse($id, ""); }
function setConfig($id = 0) { global $INTERNAL, $RESPONSE; if (SERVERSETUP) { $id = createFile(FILE_CONFIG, base64_decode($_POST[POST_INTERN_UPLOAD_VALUE]), true); if (isset($_POST[POST_INTERN_SERVER_AVAILABILITY])) { setAvailability($_POST[POST_INTERN_SERVER_AVAILABILITY]); } if (isset($_POST[POST_INTERN_FILE_CARRIER_LOGO]) && strlen($_POST[POST_INTERN_FILE_CARRIER_LOGO]) > 0) { base64ToFile(FILE_CARRIERLOGO, $_POST[POST_INTERN_FILE_CARRIER_LOGO]); } else { if (isset($_POST[POST_INTERN_FILE_CARRIER_LOGO]) && file_exists(FILE_CARRIERLOGO)) { @unlink(FILE_CARRIERLOGO); } } if (isset($_POST[POST_INTERN_FILE_INVITATION_LOGO]) && strlen($_POST[POST_INTERN_FILE_INVITATION_LOGO]) > 0) { base64ToFile(FILE_INVITATIONLOGO, $_POST[POST_INTERN_FILE_INVITATION_LOGO]); } else { if (isset($_POST[POST_INTERN_FILE_INVITATION_LOGO]) && file_exists(FILE_INVITATIONLOGO)) { @unlink(FILE_INVITATIONLOGO); } } } removeSSpanFile(true); setIdle(0); $RESPONSE->SetStandardResponse($id, ""); }