function getSessionId()
{
    global $CONFIG;
    if (!isnull(getCookieValue("userid"))) {
        $session = getCookieValue("userid");
    } else {
        setCookieValue("userid", $session = getId(USER_ID_LENGTH));
    }
    return $session;
}
示例#2
0
    if (!isnull(getCookieValue("userid"))) {
        define("CALLER_BROWSER_ID", Visitor::IDValidate());
        define("CALLER_USER_ID", Visitor::IDValidate(getCookieValue("userid")));
    }
}
if (!defined("CALLER_USER_ID")) {
    if (!JAVASCRIPT) {
        define("CALLER_USER_ID", substr(md5(getIP()), 0, USER_ID_LENGTH));
        define("CALLER_BROWSER_ID", substr(strrev(md5(getIP())), 0, USER_ID_LENGTH));
    } else {
        define("CALLER_USER_ID", Visitor::IDValidate());
        define("CALLER_BROWSER_ID", Visitor::IDValidate());
    }
}
if (getCookieValue("userid") != CALLER_USER_ID) {
    setCookieValue("userid", CALLER_USER_ID);
}
$EXTERNALUSER = Visitor::FromCache(CALLER_USER_ID);
$EXTERNALUSER->AppendPersonalData();
$detector = new DeviceDetector();
$detector->DetectBrowser();
$MobileDetect = $detector->DetectOperatingSystem($EXTERNALUSER->Host);
$openChatExternal = !empty($CONFIG["gl_moce"]) && $MobileDetect->isMobile() && !$MobileDetect->isTablet();
$openTicketExternal = !empty($_GET["ovloe"]) || $openChatExternal;
$monitoringActive = !empty($CONFIG["gl_vmac"]) || !empty($_GET["ovlc"]) || !empty($_GET["fbpos"]);
if (isset($_GET[GET_TRACK_OUTPUT_TYPE]) && ($_GET[GET_TRACK_OUTPUT_TYPE] == "jscript" || $_GET[GET_TRACK_OUTPUT_TYPE] == "jcrpt")) {
    $fullname = base64UrlEncode($EXTERNALUSER->Fullname);
    $email = base64UrlEncode($EXTERNALUSER->Email);
    $company = base64UrlEncode($EXTERNALUSER->Company);
    $question = base64UrlEncode($EXTERNALUSER->Question);
    $phone = base64UrlEncode($EXTERNALUSER->Phone);
function triggerEvents()
{
    global $BROWSER, $EVENTS, $EXTERNALUSER, $STATS, $GROUPS;
    if (count($EVENTS) == 0) {
        return;
    }
    $actionData = "";
    $url = $BROWSER->History[count($BROWSER->History) - 1];
    $previous = count($BROWSER->History) > 1 ? $BROWSER->History[count($BROWSER->History) - 2]->Url->GetAbsoluteUrl() : "";
    $EXTERNALUSER->GetChatRequestResponses();
    foreach ($EVENTS->Events as $event) {
        if (!$event->IsActive || empty($url)) {
            continue;
        }
        $urlor = count($event->FunnelUrls) == 0 && $event->MatchesURLCriterias($url->Url->GetAbsoluteUrl(), $url->Referrer->GetAbsoluteUrl(), $previous, time() - $url->Entrance);
        $urlfunnel = count($event->FunnelUrls) > 0 && $event->MatchesURLFunnelCriterias($BROWSER->History);
        $global = $event->MatchesGlobalCriterias(count($BROWSER->History), $EXTERNALUSER->ExitTime - $EXTERNALUSER->FirstActive, $EXTERNALUSER->HasAcceptedChatRequest, $EXTERNALUSER->HasDeclinedChatRequest, $EXTERNALUSER->WasInChat(), $BROWSER->Query);
        if ($global && ($urlfunnel || $urlor)) {
            foreach (array($event->Goals, $event->Actions) as $elements) {
                foreach ($elements as $action) {
                    $EventTrigger = new EventTrigger(CALLER_USER_ID, CALLER_BROWSER_ID, $action->Id, time(), 1);
                    $EventTrigger->Load();
                    $aexists = $action->Exists(CALLER_USER_ID, CALLER_BROWSER_ID);
                    if (!$EventTrigger->Exists || $EventTrigger->Exists && $event->MatchesTriggerCriterias($EventTrigger)) {
                        if (!$aexists) {
                            if ($event->SaveInCookie) {
                                if (!isnull(getCookieValue("ea_" . $action->Id))) {
                                    continue;
                                } else {
                                    setCookieValue("ea_" . $action->Id, time());
                                }
                            }
                            $EventTrigger->Save($event->Id);
                            if ($action->Type < 2) {
                                foreach ($action->GetInternalReceivers() as $user_id) {
                                    $intaction = new EventActionInternal($user_id, $EventTrigger->Id);
                                    $intaction->Save();
                                }
                            } else {
                                if ($action->Type == 2 && !defined("EVENT_INVITATION")) {
                                    $sender = getActionSender($action->Invitation->Senders, true);
                                    initData(array("GROUPS"));
                                    if (!empty($sender) && !empty($GROUPS[$sender->GroupId]) && $GROUPS[$sender->GroupId]->IsHumanAvailable(false) && !($BROWSER->ChatRequest != null && !$BROWSER->ChatRequest->Closed) && !$EXTERNALUSER->IsInChat(false, null, true)) {
                                        define("EVENT_INVITATION", true);
                                        $chatrequest = new ChatRequest($sender->UserSystemId, $sender->GroupId, CALLER_USER_ID, CALLER_BROWSER_ID, getActionText($sender, $action));
                                        $chatrequest->EventActionId = $action->Id;
                                        $chatrequest->Save();
                                        if (!$chatrequest->Displayed) {
                                            $BROWSER->ForceUpdate();
                                        }
                                        $BROWSER->ChatRequest = $chatrequest;
                                    }
                                } else {
                                    if ($action->Type == 3 && !defined("EVENT_ALERT")) {
                                        define("EVENT_ALERT", true);
                                        $alert = new Alert(CALLER_USER_ID, CALLER_BROWSER_ID, $action->Value);
                                        $alert->EventActionId = $action->Id;
                                        $alert->Save();
                                        $BROWSER->LoadAlerts();
                                    } else {
                                        if ($action->Type == 4 && !defined("EVENT_WEBSITE_PUSH")) {
                                            define("EVENT_WEBSITE_PUSH", true);
                                            $sender = getActionSender($action->WebsitePush->Senders, false);
                                            $websitepush = new WebsitePush($sender->UserSystemId, $sender->GroupId, CALLER_USER_ID, CALLER_BROWSER_ID, getActionText($sender, $action), $action->WebsitePush->Ask, $action->WebsitePush->TargetURL);
                                            $websitepush->EventActionId = $action->Id;
                                            $websitepush->Save();
                                            $BROWSER->LoadWebsitePush();
                                        } else {
                                            if ($action->Type == 5 && !defined("EVENT_OVERLAY_BOX")) {
                                                define("EVENT_OVERLAY_BOX", true);
                                                $overlaybox = new OverlayBox(CALLER_USER_ID, CALLER_BROWSER_ID, $action->Value);
                                                $overlaybox->EventActionId = $action->Id;
                                                $overlaybox->Save();
                                                $BROWSER->LoadOverlayBoxes();
                                            } else {
                                                if ($action->Type == 9 && STATS_ACTIVE) {
                                                    $STATS->ProcessAction(ST_ACTION_GOAL, array(CALLER_USER_ID, $action->Id, $EXTERNALUSER->Visits == 1 ? 1 : 0, $BROWSER->GetQueryId(getCookieValue("sp"), null, 255, true)));
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                    if ($EventTrigger->Exists && $aexists) {
                        $EventTrigger->Update();
                    }
                }
            }
        }
    }
    return $actionData;
}
 function SetCookieGroup()
 {
     setCookieValue("login_group", $this->DesiredChatGroup);
 }
 function ApplyCustomValues($_array, $_prefix, $_get = false)
 {
     global $INPUTS;
     foreach ($INPUTS as $index => $input) {
         if ($input->Active && $input->Custom) {
             if (isset($_array[$_prefix . $index])) {
                 $this->Customs[$index] = base64UrlDecode($_array[$_prefix . $index]);
                 if ($input->Cookie) {
                     setCookieValue("cf_" . $index, base64UrlDecode($_array[$_prefix . $index]));
                 }
             }
         } else {
             if ($index == 111 && $input->Cookie && ($_get || isset($_array[POST_EXTERN_USER_NAME]) && !empty($_array[POST_EXTERN_USER_NAME]))) {
                 setCookieValue("form_" . $index, $this->Fullname);
             } else {
                 if ($index == 112 && $input->Cookie && ($_get || isset($_array[POST_EXTERN_USER_EMAIL]) && !empty($_array[POST_EXTERN_USER_EMAIL]))) {
                     setCookieValue("form_" . $index, $this->Email);
                 } else {
                     if ($index == 113 && $input->Cookie && isset($_array[POST_EXTERN_USER_COMPANY]) && !empty($_array[POST_EXTERN_USER_COMPANY])) {
                         setCookieValue("form_" . $index, $this->Company);
                     } else {
                         if ($index == 114 && $input->Cookie && isset($_array[POST_EXTERN_USER_COMPANY]) && !empty($_array[POST_EXTERN_USER_QUESTION])) {
                             setCookieValue("form_" . $index, $this->Question);
                         } else {
                             if ($index == 116 && $input->Cookie && isset($_array["p_phone"]) && !empty($_array["p_phone"])) {
                                 setCookieValue("form_" . $index, $this->Phone);
                             }
                         }
                     }
                 }
             }
         }
     }
 }
示例#6
0
 $TRACKINGSCRIPT = str_replace("<!--user_header-->", getParam(GET_EXTERN_USER_HEADER), $TRACKINGSCRIPT);
 $TRACKINGSCRIPT = str_replace("<!--user_customs-->", getJSCustomArray("", $customs), $TRACKINGSCRIPT);
 $TRACKINGSCRIPT = str_replace("<!--custom_params-->", getCustomParams("", $customs), $TRACKINGSCRIPT);
 $TRACKINGSCRIPT = str_replace("<!--is_ie-->", parseBool(!empty($_SERVER['HTTP_USER_AGENT']) && strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false), $TRACKINGSCRIPT);
 if (isset($fullname)) {
     setCookieValue("form_111", cutString(base64UrlDecode($fullname), 254));
 }
 if (isset($_GET[GET_EXTERN_USER_EMAIL])) {
     setCookieValue("form_112", cutString(base64UrlDecode($_GET[GET_EXTERN_USER_EMAIL]), 254));
 }
 if (isset($_GET[GET_EXTERN_USER_COMPANY])) {
     setCookieValue("form_113", cutString(base64UrlDecode($_GET[GET_EXTERN_USER_COMPANY]), 254));
 }
 for ($i = 0; $i <= 9; $i++) {
     if (isset($_GET["cf" . $i]) && !empty($_GET["cf" . $i])) {
         setCookieValue("cf_" . $i, cutString(base64UrlDecode($_GET["cf" . $i]), 254));
     }
 }
 if (!empty($_GET["fbpos"]) && is_numeric($_GET["fbpos"]) && !empty($_GET["fbw"]) && is_numeric($_GET["fbw"]) && !empty($_GET["fbh"]) && is_numeric($_GET["fbh"])) {
     $shadow = !empty($_GET["fbshx"]) && is_numeric($_GET["fbshx"]) && !empty($_GET["fbshy"]) && is_numeric($_GET["fbshy"]) && !empty($_GET["fbshb"]) && is_numeric($_GET["fbshb"]) && !empty($_GET["fbshc"]) && ctype_alnum($_GET["fbshc"]) ? "true," . $_GET["fbshb"] . "," . $_GET["fbshx"] . "," . $_GET["fbshy"] . ",'" . $_GET["fbshc"] . "'" : "false,0,0,0,''";
     $margin = isset($_GET["fbmt"]) && is_numeric($_GET["fbmt"]) && isset($_GET["fbmr"]) && is_numeric($_GET["fbmr"]) && isset($_GET["fbmb"]) && is_numeric($_GET["fbmb"]) && isset($_GET["fbml"]) && is_numeric($_GET["fbml"]) ? "," . $_GET["fbml"] . "," . $_GET["fbmt"] . "," . $_GET["fbmr"] . ",'" . $_GET["fbmb"] . "'" : ",0,0,0,0";
     $online = true;
     if (!empty($_GET["fboo"])) {
         $parameters = getTargetParameters();
         if (!operatorsAvailable(0, $parameters["exclude"], $parameters["include_group"], $parameters["include_user"]) > 0) {
             $online = false;
         }
     }
     if ($online) {
         $TRACKINGSCRIPT .= "lz_tracking_add_floating_button(" . $_GET["fbpos"] . "," . $shadow . $margin . "," . $_GET["fbw"] . "," . $_GET["fbh"] . ");";
     }
 static function Create($_ip, $_userId, $_reason, $_expireDays = 2, $_cookie = false, $_chats = false)
 {
     $filter = new Filter(md5(uniqid(rand())));
     $filter->Creator = "SYSTEM";
     $filter->Created = time();
     $filter->Editor = "SYSTEM";
     $filter->Edited = time();
     $filter->IP = $_ip;
     $filter->Expiredate = $_expireDays * 86400;
     $filter->Userid = $_userId;
     $filter->Reason = "";
     $filter->Filtername = $_reason;
     $filter->Activestate = 1;
     $filter->Exertion = 0;
     $filter->Languages = "";
     $filter->Activeipaddress = 1;
     $filter->Activeuserid = !empty($_userId) ? 1 : 0;
     $filter->Activelanguage = 0;
     $filter->AllowChats = $_chats;
     $filter->Save();
     if ($_cookie) {
         setCookieValue(OO_TRACKING_FILTER_NAME, "1");
     }
 }
function getSessionId()
{
    if (!isnull(getCookieValue("userid"))) {
        $session = getCookieValue("userid");
    } else {
        if (!empty($_GET[GET_TRACK_USERID])) {
            $session = base64UrlDecode(getParam(GET_TRACK_USERID));
        } else {
            setCookieValue("userid", $session = Visitor::IDValidate());
        }
    }
    return Visitor::IDValidate($session);
}
示例#9
0
 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("<!--alert-->", getAlertTemplate(), $html);
     $html = str_replace("<!--direct_send-->", 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("<!--groups-->", $groupbuilder->GetHTML(), $html);
     $html = str_replace("<!--login_trap-->", getFile(TEMPLATE_LOGIN_TRAP), $html);
     $html = str_replace("<!--group_select_visibility-->", 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("<!--logo-->", "<img src=\"" . base64UrlDecode($_GET[GET_EXTERN_USER_HEADER]) . "\" alt=\"\" border=\"0\"><br>", $html);
         } else {
             $html = str_replace("<!--logo-->", file_exists(FILE_CARRIERLOGO) ? "<img src=\"" . FILE_CARRIERLOGO . "\" alt=\"livezilla.net\" border=\"0\"><br>" : "", $html);
         }
示例#10
0
文件: track.php 项目: afzet/cake-cart
    $TRACKINGSCRIPT = str_replace("<!--width-->", $CONFIG["wcl_window_width"], $TRACKINGSCRIPT);
    $TRACKINGSCRIPT = geoReplacements($TRACKINGSCRIPT);
    $TRACKINGSCRIPT = str_replace("<!--geo_resolute-->", parseBool(!isSSpanFile() && !dataSetExists($externalUser->ExternalStatic->SessionFile) && !isnull($CONFIG["wcl_geo_tracking"]) && !(!isnull(getCookieValue("geo_data")) && getCookieValue("geo_data") > time() - 2592000)), $TRACKINGSCRIPT);
    $TRACKINGSCRIPT = str_replace("<!--alert_html-->", base64_encode(str_replace("<!--server-->", LIVEZILLA_URL, getFile(TEMPLATE_SCRIPT_ALERT))), $TRACKINGSCRIPT);
    $TRACKINGSCRIPT = str_replace("<!--user_name-->", getParam(GET_EXTERN_USER_NAME), $TRACKINGSCRIPT);
    $TRACKINGSCRIPT = str_replace("<!--user_email-->", getParam(GET_EXTERN_USER_EMAIL), $TRACKINGSCRIPT);
    $TRACKINGSCRIPT = str_replace("<!--user_company-->", getParam(GET_EXTERN_USER_COMPANY), $TRACKINGSCRIPT);
    $TRACKINGSCRIPT = str_replace("<!--user_header-->", getParam(GET_EXTERN_USER_HEADER), $TRACKINGSCRIPT);
    if (isset($_GET[GET_EXTERN_USER_EMAIL])) {
        setCookieValue("login_email", secPrev(base64UrlDecode($_GET[GET_EXTERN_USER_EMAIL])));
    }
    if (isset($_GET[GET_EXTERN_USER_COMPANY])) {
        setCookieValue("login_company", secPrev(base64UrlDecode($_GET[GET_EXTERN_USER_COMPANY])));
    }
    if (isset($_GET[GET_EXTERN_USER_NAME])) {
        setCookieValue("login_name", secPrev(base64UrlDecode($_GET[GET_EXTERN_USER_NAME])));
    }
} else {
    $TRACKINGSCRIPT = "lz_tracking_set_sessid(\"" . CALLER_USER_ID . "\",\"" . CALLER_BROWSER_ID . "\");";
    if (isset($_GET[GET_TRACK_BROWSERID]) && isset($_GET[GET_TRACK_START]) && isset($_GET[GET_TRACK_URL])) {
        if (!isnull($_GET[GET_TRACK_URL]) && strpos(base64UrlDecode($_GET[GET_TRACK_URL]), GET_INTERN_COBROWSE) !== false) {
            exit("lz_tracking_stop_tracking();");
        }
        $BROWSER = new ExternalBrowser(CALLER_BROWSER_ID, CALLER_USER_ID);
        if (isset($_GET[GET_EXTERN_USER_NAME]) && !isnull($_GET[GET_EXTERN_USER_NAME])) {
            $BROWSER->Fullname = substr(secPrev(base64UrlDecode($_GET[GET_EXTERN_USER_NAME])), 0, 32);
        }
        if (isset($_GET[GET_EXTERN_USER_EMAIL]) && !isnull($_GET[GET_EXTERN_USER_EMAIL])) {
            $BROWSER->Email = substr(secPrev(base64UrlDecode($_GET[GET_EXTERN_USER_EMAIL])), 0, 50);
        }
        if (isset($_GET[GET_EXTERN_USER_COMPANY]) && !isnull($_GET[GET_EXTERN_USER_COMPANY])) {
 function ApplyOverlayInputValues($_parent, $_changed = false)
 {
     global $INPUTS, $GROUPS;
     $group = $GROUPS[$this->DesiredChatGroup];
     foreach ($INPUTS as $index => $input) {
         $changed = false;
         if ($input->Active && $input->Custom) {
             if (isset($_GET["f" . $input->Index])) {
                 if (!isset($this->Customs[$index])) {
                     $this->Customs[$index] = "";
                 }
                 $this->Customs[$index] = getOParam("f" . $input->Index, $this->Customs[$index], $changed);
                 if ($input->Cookie && $input->Type != "File") {
                     setCookieValue("cf_" . $index, $this->Customs[$index]);
                 }
             }
         } else {
             $value = "";
             if ($index == 111 && $INPUTS[111]->IsServerInput()) {
                 $value = $_parent->Fullname = $this->Fullname = $group->GetServerInput($INPUTS[111], true, $this->Fullname, $changed);
             }
             if ($index == 112 && $INPUTS[112]->IsServerInput()) {
                 $value = $_parent->Email = $this->Email = $group->GetServerInput($INPUTS[112], true, $this->Email, $changed);
             }
             if ($index == 113 && $INPUTS[113]->IsServerInput()) {
                 $value = $_parent->Company = $this->Company = $group->GetServerInput($INPUTS[113], true, $this->Company, $changed);
             }
             if ($index == 114 && $INPUTS[114]->IsServerInput()) {
                 $value = $_parent->Question = $this->Question = $group->GetServerInput($INPUTS[114], true, $this->Question, $changed);
             }
             if ($index == 116 && $INPUTS[116]->IsServerInput()) {
                 $value = $_parent->Phone = $this->Phone = $group->GetServerInput($INPUTS[116], true, $this->Phone, $changed);
             }
             if ($input->Cookie && $input->Type != "File" && $changed && !empty($value)) {
                 setCookieValue("form_" . $index, $value);
             }
         }
         if ($changed) {
             $_changed = true;
         }
     }
     return $_changed;
 }
示例#12
0
function createStaticFile($_externalUser, $_resolution, $_color, $_timezone, $_lat, $_long, $_countryiso2, $_city, $_region, $_geotimezone, $_isp, $_geosspan, $_grid, $_fromCookie = false)
{
    global $CONFIG;
    if (isnull(getCookieValue("userid"))) {
        setCookieValue("visits", $_externalUser->ExternalStatic->Visits = 1);
    } else {
        if (!isnull(getCookieValue("userid"))) {
            setCookieValue("visits", $_externalUser->ExternalStatic->Visits = getCookieValue("visits") + 1);
        }
    }
    $_externalUser->ExternalStatic->IP = getIP();
    $_externalUser->ExternalStatic->Host = getHost();
    $_externalUser->ExternalStatic->SystemInfo = !isnull($userAgent = getServerParam("HTTP_USER_AGENT")) ? $userAgent : "";
    $_externalUser->ExternalStatic->Language = !isnull($acceptLanguage = getServerParam("HTTP_ACCEPT_LANGUAGE")) ? $acceptLanguage : "";
    if (strlen($_externalUser->ExternalStatic->Language) > 8 || strpos($_externalUser->ExternalStatic->Language, ";") !== false) {
        $parts = explode(";", $_externalUser->ExternalStatic->Language);
        if (count($parts) > 0) {
            $_externalUser->ExternalStatic->Language = $parts[0];
        } else {
            $_externalUser->ExternalStatic->Language = substr($_externalUser->ExternalStatic->Language, 0, 8);
        }
    }
    $_externalUser->ExternalStatic->Resolution = is_array($_resolution) && count($_resolution) == 2 ? $_resolution[0] . " x " . $_resolution[1] : "";
    $_externalUser->ExternalStatic->Resolution .= !isnull($_color) ? " (" . $_color . " Bit)" : "";
    $_externalUser->ExternalStatic->GeoTimezoneOffset = getLocalTimezone($_timezone);
    if (!isnull($_geosspan)) {
        createSSpanFile($_geosspan);
    }
    if (!isnull($CONFIG["wcl_geo_tracking"])) {
        if (!isnull($_lat) && base64_decode($_lat) > -180) {
            setCookieValue(GEO_LATITUDE, $_externalUser->ExternalStatic->GeoLatitude = base64_decode($_lat));
            setCookieValue(GEO_LONGITUDE, $_externalUser->ExternalStatic->GeoLongitude = base64_decode($_long));
            setCookieValue(GEO_COUNTRY_ISO_2, $_externalUser->ExternalStatic->GeoCountryISO2 = base64_decode($_countryiso2));
            setCookieValue(GEO_CITY, $_externalUser->ExternalStatic->GeoCity = base64_decode($_city));
            setCookieValue(GEO_REGION, $_externalUser->ExternalStatic->GeoRegion = base64_decode($_region));
            setCookieValue(GEO_TIMEZONE, $_externalUser->ExternalStatic->GeoTimezoneOffset = base64_decode($_geotimezone));
            setCookieValue(GEO_ISP, $_externalUser->ExternalStatic->GeoISP = base64_decode($_isp));
            setCookieValue("geo_data", time());
        } else {
            if (isset($_lat)) {
                $_externalUser->ExternalStatic->GeoLatitude = base64_decode($_lat);
                $_externalUser->ExternalStatic->GeoLongitude = base64_decode($_long);
            } else {
                if (!isnull(getCookieValue("geo_data"))) {
                    $_externalUser->ExternalStatic->GeoLatitude = getCookieValue(GEO_LATITUDE);
                    $_externalUser->ExternalStatic->GeoLongitude = getCookieValue(GEO_LONGITUDE);
                    $_externalUser->ExternalStatic->GeoCountryISO2 = getCookieValue(GEO_COUNTRY_ISO_2);
                    $_externalUser->ExternalStatic->GeoCity = getCookieValue(GEO_CITY);
                    $_externalUser->ExternalStatic->GeoRegion = getCookieValue(GEO_REGION);
                    $_externalUser->ExternalStatic->GeoTimezoneOffset = getCookieValue(GEO_TIMEZONE);
                    $_externalUser->ExternalStatic->GeoISP = getCookieValue(GEO_ISP);
                    $_fromCookie = true;
                }
            }
        }
        removeSSpanFile(false);
        if ($_fromCookie) {
            $_externalUser->ExternalStatic->GeoResultId = 6;
        } else {
            if (isSSpanFile()) {
                if (@filemtime(FILE_SERVER_GEO_SSPAN) > time() + CONNECTION_ERROR_SPAN) {
                    $_externalUser->ExternalStatic->GeoResultId = 5;
                } else {
                    $_externalUser->ExternalStatic->GeoResultId = 4;
                }
            } else {
                if (base64_decode($_lat) == -777) {
                    $_externalUser->ExternalStatic->GeoResultId = 5;
                } else {
                    if (base64_decode($_lat) == -522) {
                        $_externalUser->ExternalStatic->GeoResultId = 2;
                    } else {
                        if ($_grid != 4) {
                            $_externalUser->ExternalStatic->GeoResultId = 3;
                        } else {
                            $_externalUser->ExternalStatic->GeoResultId = $_grid;
                        }
                    }
                }
            }
        }
        if (strlen($_externalUser->ExternalStatic->Language) == 2 && !isnull(GEO_COUNTRY_ISO_2)) {
            $_externalUser->ExternalStatic->Language .= "-" . $_externalUser->ExternalStatic->GeoCountryISO2;
        }
    }
    $_externalUser->ExternalStatic->Save();
}
示例#13
0
 if (isset($_GET[GET_EXTERN_TEMPLATE]) && $_GET[GET_EXTERN_TEMPLATE] == "lz_chat_frame.3.2.login.0.0") {
     $html = getFile(PATH_FRAMES . $_GET[GET_EXTERN_TEMPLATE] . ".tpl");
     $html = str_replace("<!--button_message-->", $CONFIG["gl_no_om_sp"] ? "" : getFile(TEMPLATE_HTML_BUTTON_MESSAGE), $html);
 } else {
     if (isset($_GET[GET_EXTERN_TEMPLATE]) && $_GET[GET_EXTERN_TEMPLATE] == "lz_chat_frame.3.2.mail") {
         getData(false, true, false, false);
         $groupbuilder = new GroupBuilder(NULL, $GROUPS, NULL);
         $html = getFile(PATH_FRAMES . $_GET[GET_EXTERN_TEMPLATE] . ".tpl");
         if (isset($_POST["login_name"]) && $_POST["login_name"] != null) {
             setCookieValue("login_name", $_POST["login_name"]);
         }
         if (isset($_POST["login_email"]) && $_POST["login_email"] != null) {
             setCookieValue("login_email", $_POST["login_email"]);
         }
         if (isset($_POST["login_company"]) && $_POST["login_company"] != null) {
             setCookieValue("login_company", $_POST["login_company"]);
         }
         $html = str_replace("<!--alert-->", str_replace("<!--server-->", LIVEZILLA_URL, getFile(TEMPLATE_SCRIPT_ALERT)), $html);
         $html = replaceLoginDetails($html);
         $html = str_replace("<!--groups-->", $groupbuilder->GetHTML(), $html);
         $html = str_replace("<!--login_trap-->", getFile(TEMPLATE_LOGIN_TRAP), $html);
     } else {
         if (isset($_GET[GET_EXTERN_TEMPLATE]) && $_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]) && !isnull($_GET[GET_EXTERN_USER_HEADER])) {
                 $html = str_replace("<!--logo-->", "<img src=\"" . base64UrlDecode($_GET[GET_EXTERN_USER_HEADER]) . "\" alt=\"\" border=\"0\"><br>", $html);
             } else {
                 $html = str_replace("<!--logo-->", file_exists(FILE_CARRIERLOGO) ? "<img src=\"" . FILE_CARRIERLOGO . "\" alt=\"\" border=\"0\"><br>" : "", $html);
             }
         } else {
             if (isset($_GET[GET_EXTERN_TEMPLATE]) && $_GET[GET_EXTERN_TEMPLATE] == "lz_chat_frame.3.2.chat.0.0") {