function getMySQL($error = "") { global $CONFIG; if (!empty($CONFIG["gl_db_host"])) { require LIVEZILLA_PATH . "_lib/functions.internal.man.inc.php"; $extension = !empty($CONFIG["gl_db_ext"]) ? $CONFIG["gl_db_ext"] : ""; $error = testDataBase($CONFIG["gl_db_host"], $CONFIG["gl_db_user"], $CONFIG["gl_db_pass"], $CONFIG["gl_db_name"], $CONFIG["gl_db_prefix"], $extension, true); } if (!function_exists("mysql_real_escape_string") && !function_exists("mysqli_real_escape_string")) { $error = "MySQL PHP extension is not available."; } if (empty($error)) { return null; } else { return "<span class=\"lz_index_error_cat\">MySQL:<br></span><span class=\"lz_index_red\">" . $error . "</span>"; } }
if ($_POST[POST_INTERN_SERVER_ACTION] == INTERN_ACTION_DOWNLOAD_TRANSLATION) { require LIVEZILLA_PATH . "_lib/functions.internal.man.inc.php"; getTranslationData(); } else { $RESPONSE->SetValidationError(AUTH_RESULT); } } } if (defined("VALIDATED") && LOGOFF) { $INTERNAL[CALLER_SYSTEM_ID]->GetExternalObjects(); foreach ($INTERNAL[CALLER_SYSTEM_ID]->ExternalChats as $chat) { $chat->InternalClose(); } } if (defined("VALIDATED") && !SERVERSETUP) { if (isset($_POST[POST_GLOBAL_TYPING])) { $INTERNAL[CALLER_SYSTEM_ID]->Typing = $_POST[POST_GLOBAL_TYPING]; } $INTERNAL[CALLER_SYSTEM_ID]->Save(); } if (LOGIN && DB_ACCESS_REQUIRED) { require LIVEZILLA_PATH . "_lib/functions.internal.man.inc.php"; $res = testDataBase($CONFIG["gl_db_host"], $CONFIG["gl_db_user"], $CONFIG["gl_db_pass"], $CONFIG["gl_db_name"], $CONFIG["gl_db_prefix"]); if (!empty($res)) { $RESPONSE->SetValidationError(LOGIN_REPLY_DB, $res); } } $RESPONSE->GlobalHash = empty($RESPONSE->Messages) && empty($RESPONSE->Ratings) && empty($RESPONSE->Resources) && empty($RESPONSE->Archive) ? substr(md5($RESPONSE->XML), 0, 5) : ""; $RESPONSE->XML = $_POST[POST_INTERN_SERVER_ACTION] != INTERN_ACTION_LISTEN || isset($_POST[POST_GLOBAL_XMLCLIP_HASH_ALL]) && $_POST[POST_GLOBAL_XMLCLIP_HASH_ALL] != $RESPONSE->GlobalHash ? str_replace("<!--gl_all-->", base64_encode(substr(md5($RESPONSE->XML), 0, 5)), $RESPONSE->XML) : ""; $response = strlen($RESPONSE->XML) > 0 ? $RESPONSE->GetXML() : ""; $response = str_replace("<!--execution_time-->", base64_encode(floor((microtimeFloat(microtime()) - microtimeFloat(ACCESSTIME)) * 1000)), $response);
function dataBaseTest($id = 0) { global $RESPONSE; $res = testDataBase($_POST[POST_INTERN_DATABASE_HOST], $_POST[POST_INTERN_DATABASE_USER], $_POST[POST_INTERN_DATABASE_PASS], $_POST[POST_INTERN_DATABASE_NAME], $_POST[POST_INTERN_DATABASE_PREFIX]); if (empty($res)) { $RESPONSE->SetStandardResponse(1, base64_encode("")); } else { $RESPONSE->SetStandardResponse(2, base64_encode($res)); } }