Generate(); if(!$groupbuilder->GroupAvailable) exit(""); } else initData(false,false,false,true); if((isset($_POST["company"]) && !empty($_POST["company"])) || (isset($_POST["email"]) && !empty($_POST["email"])) || (isset($_POST["name"]) && !empty($_POST["name"])) || (isset($_POST["text"]) && !empty($_POST["text"]))) exit(createFloodFilter(getIP(),null)); } if(!isset($_GET[GET_EXTERN_TEMPLATE])) { define("IS_FLOOD",isFlood(getIP(),null,true)); define("IS_FILTERED",$FILTERS->Match($_SERVER["REMOTE_ADDR"],formLanguages(((!empty($_SERVER["HTTP_ACCEPT_LANGUAGE"])) ? $_SERVER["HTTP_ACCEPT_LANGUAGE"] : "")),SESSION)); initData(true,false,false,false); $html = getFile(TEMPLATE_HTML_EXTERN); $html = str_replace("",getFile(TEMPLATE_SCRIPT_EXTERN).getFile(TEMPLATE_SCRIPT_DATA).getFile(TEMPLATE_SCRIPT_CHAT).getFile(TEMPLATE_SCRIPT_FRAME),$html); $html = str_replace("",substr(md5($CONFIG["gl_lzid"]),5,5),$html); $html = str_replace("",getFile(TEMPLATE_SCRIPT_CONNECTOR),$html); $html = str_replace("",getFile(TEMPLATE_SCRIPT_GROUPS),$html); $html = str_replace("",getFile(TEMPLATE_SCRIPT_GLOBAL),$html); $html = str_replace("",$browserId,$html); $html = str_replace("",$CONFIG["timeout_clients"],$html); $html = str_replace("",parseBool($CONFIG["gl_uret"] && $CONFIG["gl_soct"]),$html); $html = str_replace("",parseBool($CONFIG["gl_otrs"]),$html); $html = str_replace("",$CONFIG["poll_frequency_clients"],$html); $html = str_replace("",parseBool($CONFIG["gl_cbcd"]),$html); $html = str_replace("",base64_encode($CONFIG["gl_site_name"]),$html); $html = str_replace("",SESSION,$html); $html = str_replace("",CONNECTION_ERROR_SPAN,$html); $html = replaceLoginDetails($html); $html = geoReplacements($html); $html = str_replace("",((!empty($_GET[GET_EXTERN_INTERN_USER_ID]) && isset($INTERNAL[getInternalSystemIdByUserId(base64UrlDecode($_GET[GET_EXTERN_INTERN_USER_ID]))])) ? (base64UrlDecode($_GET[GET_EXTERN_INTERN_USER_ID])):""),$html); $html = str_replace("",parseBool(!isSSpanFile() && !empty($CONFIG["gl_pr_ngl"]) && !(getCookieValue("geo_data") != null && getCookieValue("geo_data") > (time()-2592000))),$html); $html = str_replace("",((isset($_GET[GET_TRACK_SPECIAL_AREA_CODE])) ? "&code=" . getParam(GET_TRACK_SPECIAL_AREA_CODE) : ""),$html); $html = str_replace("",base64_encode(getFile(TEMPLATE_HTML_MESSAGE_INTERN)),$html); $html = str_replace("",base64_encode(getFile(TEMPLATE_HTML_MESSAGE_EXTERN)),$html); $html = str_replace("",base64_encode(getFile(TEMPLATE_HTML_MESSAGE_ADD)),$html); $html = str_replace("",base64_encode(getFile(TEMPLATE_HTML_MESSAGE_ADD_ALTERNATE)),$html); $html = str_replace("",parseBool((isset($_GET[GET_EXTERN_USER_NAME]) && !isset($_GET[GET_EXTERN_RESET]))),$html); $html = str_replace("",parseBool((!empty($_SERVER['HTTP_USER_AGENT']) && (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false))),$html); $html = str_replace("",base64_encode(buildLoginErrorField()),$html); $html = str_replace("",$CONFIG["gl_om_mode"],$html); $html = str_replace("",$CONFIG["gl_om_http"],$html); $html = str_replace("",parseBool($CONFIG["gl_no_om_sp"]==1),$html); $html = str_replace("",(($CONFIG["gl_sho_qu_inf"]==1)?$LZLANG["client_queue_message"]:$LZLANG["client_ints_are_busy"]),$html); } else { if($_GET[GET_EXTERN_TEMPLATE] == "lz_chat_frame.3.2.login.1.0") { initData(true,true,false,false); $html = getFile(PATH_FRAMES.$_GET[GET_EXTERN_TEMPLATE].".tpl"); $html = (isset($CONFIG["gl_site_name"])) ? str_replace("",$CONFIG["gl_site_name"],$html) : str_replace("","LiveZilla",$html); $html = getChatLoginInputs($html); $html = replaceLoginDetails($html); $html = str_replace("",getAlertTemplate(),$html); $html = str_replace("",$CONFIG["gl_info"],$html); $html = str_replace("",getFile(TEMPLATE_LOGIN_TRAP),$html); $html = str_replace("",((defined("HideChatGroupSelection") || count($GROUPS)<2) ? "display:none;" : ""),$html); } else if($_GET[GET_EXTERN_TEMPLATE] == "lz_chat_frame.3.2.login.0.0") { $html = getFile(PATH_FRAMES.$_GET[GET_EXTERN_TEMPLATE].".tpl"); $html = str_replace("",($CONFIG["gl_no_om_sp"]) ? "" : getFile(TEMPLATE_HTML_BUTTON_MESSAGE),$html); } else if($_GET[GET_EXTERN_TEMPLATE] == "lz_chat_frame.3.2.chat" && isset($_POST[GET_EXTERN_GROUP])) { $html = getFile(PATH_FRAMES.$_GET[GET_EXTERN_TEMPLATE].".tpl"); $html = str_replace("",base64_encode($_POST[GET_EXTERN_GROUP]),$html); $html = str_replace("",(($CONFIG["gl_uret"] && $CONFIG["gl_otrs"]) ? 52 : (($CONFIG["gl_uret"] || $CONFIG["gl_otrs"]) ? 31 : 0)),$html); } else if($_GET[GET_EXTERN_TEMPLATE] == "lz_chat_frame.3.2.mail") { initData(false,true,false,false); $groupbuilder = new GroupBuilder(NULL,$GROUPS,NULL); $html = getFile(PATH_FRAMES.$_GET[GET_EXTERN_TEMPLATE].".tpl"); $html = getTicketInputs($html); if(isset($_POST["form_111"]) && !empty($_POST["form_111"])) setCookieValue("form_111",$_POST["form_111"]); if(isset($_POST["form_112"]) && !empty($_POST["form_112"])) setCookieValue("form_112",$_POST["form_112"]); if(isset($_POST["form_113"]) && !empty($_POST["form_113"])) setCookieValue("form_113",$_POST["form_113"]); if(isset($_POST["form_114"]) && !empty($_POST["form_114"])) setCookieValue("form_114",$_POST["form_114"]); $html = str_replace("",getAlertTemplate(),$html); $html = str_replace("",(isset($_GET["ds"])) ? "top.lz_chat_check_ticket_inputs();" : "document.getElementById('lz_chat_loading').style.display='none';document.getElementById('lz_ticket_elements').style.display='';",$html); $html = replaceLoginDetails($html); $html = str_replace("",$groupbuilder->GetHTML(),$html); $html = str_replace("",getFile(TEMPLATE_LOGIN_TRAP),$html); $html = str_replace("",((defined("HideTicketGroupSelection") || count($GROUPS)<2) ? "display:none;" : ""),$html); } else if($_GET[GET_EXTERN_TEMPLATE] == "lz_chat_frame.1.1") { $html = getFile(PATH_FRAMES.$_GET[GET_EXTERN_TEMPLATE].".tpl"); if(isset($_GET[GET_EXTERN_USER_HEADER]) && !empty($_GET[GET_EXTERN_USER_HEADER])) $html = str_replace("","\"\"
",$html); else $html = str_replace("",((file_exists(FILE_CARRIERLOGO)) ? "\"livezilla.net\"
" : ""),$html); $html = str_replace("",((file_exists(FILE_CARRIERHEADER)) ? "\"livezilla.net\"
" : ""),$html); } else if($_GET[GET_EXTERN_TEMPLATE] == "lz_chat_frame.3.2.chat.0.0" && isset($_GET[GET_EXTERN_GROUP])) { initData(false,true,false,false); $groupid = base64_decode($_GET[GET_EXTERN_GROUP]); if(!isnull(trim($groupid)) && isset($GROUPS[$groupid])) { $html = getFile(PATH_FRAMES.$_GET[GET_EXTERN_TEMPLATE].".tpl"); $html = str_replace("",((empty($GROUPS[$groupid]->ChatFunctions[0])) ? " style=\"display:none;\"" : ""),$html); $html = str_replace("",((empty($GROUPS[$groupid]->ChatFunctions[1])) ? " style=\"display:none;\"" : ""),$html); $html = str_replace("",((empty($GROUPS[$groupid]->ChatFunctions[2])) ? " style=\"display:none;\"" : ""),$html); $html = str_replace("",((empty($GROUPS[$groupid]->ChatFunctions[3])) ? " style=\"display:none;\"" : ""),$html); $html = str_replace("",((empty($GROUPS[$groupid]->ChatFunctions[4])) ? " style=\"display:none;\"" : ""),$html); $html = str_replace("",((empty($GROUPS[$groupid]->ChatFunctions[5])) ? " style=\"display:none;\"" : ""),$html); } } else if($_GET[GET_EXTERN_TEMPLATE] == "lz_chat_frame.3.2.chat.1.0") { $html = getFile(PATH_FRAMES.$_GET[GET_EXTERN_TEMPLATE].".tpl"); if(isset($_POST[POST_EXTERN_USER_USERID])) { if(STATS_ACTIVE) initStatisticProvider(); $externalUser = new Visitor($_POST[POST_EXTERN_USER_USERID]); $externalChat = new VisitorChat($externalUser->UserId,$_POST[POST_EXTERN_USER_BROWSERID]); $externalChat->Load(); if(isset($_FILES["userfile"]) && $externalUser->StoreFile($_POST[POST_EXTERN_USER_BROWSERID],$externalChat->DesiredChatPartner,$externalChat->Fullname)) $command = "top.lz_chat_file_ready();"; else if(isset($_FILES['userfile'])) $command = "top.lz_chat_file_error(2);"; else $command = ""; } else if(isset($_GET["file"])) $command = "top.lz_chat_file_error(2);"; else $command = ""; $html = str_replace("",$command,$html); } else if($_GET[GET_EXTERN_TEMPLATE] == "lz_chat_frame.3.2.chat.2.0") { $html = getFile(PATH_FRAMES.$_GET[GET_EXTERN_TEMPLATE].".tpl"); $rate = new RatingGenerator(); $html = str_replace("",$rate->Fields[0],$html); $html = str_replace("",$rate->Fields[1],$html); $html = str_replace("",$rate->Fields[2],$html); $html = str_replace("",$rate->Fields[3],$html); } else if($_GET[GET_EXTERN_TEMPLATE] == "lz_chat_frame.3.2.chat.4.0") { $html = getFile(PATH_FRAMES.$_GET[GET_EXTERN_TEMPLATE].".tpl"); $html = str_replace("",getAlertTemplate(),$html); } else if($_GET[GET_EXTERN_TEMPLATE] == "lz_chat_frame.4.1") { $html = getFile(PATH_FRAMES.$_GET[GET_EXTERN_TEMPLATE].".tpl"); $html = str_replace("",$CONFIG["gl_c_param"],$html); } else if($_GET[GET_EXTERN_TEMPLATE] == "lz_chat_frame.3.2.chat.6.0") { $html = getFile(PATH_FRAMES.$_GET[GET_EXTERN_TEMPLATE].".tpl"); $tlanguages = ""; if(!empty($CONFIG["gl_otrs"])) { initData(false,false,false,false,false,true); require("./_lib/functions.external.inc.php"); $mylang = getBrowserLocalization(); foreach($LANGUAGES as $iso => $langar) if($langar[1]) $tlanguages .= ""; $html = str_replace("","",$html); } $html = str_replace("",(($CONFIG["gl_otrs"])?"":"none"),$html); $html = str_replace("",(($CONFIG["gl_uret"])?"":"none"),$html); $html = str_replace("",$tlanguages,$html); } else { $html = getFile(PATH_FRAMES.$_GET[GET_EXTERN_TEMPLATE].".tpl"); } } $html = str_replace("",".",$html); $html = str_replace("",getParams(),$html); unloadDataProvider(); exit(doReplacements($html)); ?>