예제 #1
0
function get_absolute_url()
{
    $protocol = getServerParam('HTTPS') == 'on' || getServerParam('HTTP_X_FORWARDED_PROTO') == 'https' ? 'https' : 'http';
    $pos = strpos(getServerParam('REQUEST_URI'), 'oc-includes');
    $URI = rtrim(substr(getServerParam('REQUEST_URI'), 0, $pos), '/') . '/';
    return $protocol . '://' . getServerParam('HTTP_HOST') . $URI;
}
예제 #2
0
function osc_getAbsoluteWebURL()
{
    $protocol = 'http';
    if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) == 'https' || isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] == 1)) {
        $protocol = 'https';
    }
    return $protocol . '://' . getServerParam('HTTP_HOST') . osc_getRelativeWebURL();
}
예제 #3
0
파일: index.php 프로젝트: afzet/cake-cart
require LIVEZILLA_PATH . "_lib/functions.global.inc.php";
languageSelect();
@set_error_handler("handleError");
if (function_exists('date_default_timezone_set')) {
    date_default_timezone_set(@date_default_timezone_get());
}
$scheme = getScheme();
if (isset($_GET[GET_INDEX_SERVER_ACTION]) && $_GET[GET_INDEX_SERVER_ACTION] == "addserver") {
    $html = doReplacements(getFile(TEMPLATE_HTML_ADD_SERVER));
    $html = str_replace("<!--lz_add_url-->", getServerAddLink($scheme), $html);
    exit($html);
} else {
    $html = getFile(TEMPLATE_HTML_INDEX);
    $errorbox = null;
    $errors['write'] = getFolderPermissions();
    $errors['php_version'] = getPhpVersion();
    if (!isnull($errors['write']) || !isnull($errors['php_version'])) {
        $errorbox = getFile(TEMPLATE_HTML_INDEX_ERRORS);
        $errorbox = str_replace("<!--write_access-->", $errors['write'], $errorbox);
        if (strlen($errors['write']) > 0 && !isnull($errors['php_version'])) {
            $errors['php_version'] = "<br><br>" . $errors['php_version'];
        }
        $errorbox = str_replace("<!--php_version-->", $errors['php_version'], $errorbox);
    }
    $html = str_replace("<!--index_errors-->", $errorbox, $html);
    $html = str_replace("<!--height-->", $CONFIG["wcl_window_height"], $html);
    $html = str_replace("<!--width-->", $CONFIG["wcl_window_width"], $html);
    $html = str_replace("<!--lz_add_server-->", $scheme . getServerParam("HTTP_HOST") . getServerParam("PHP_SELF") . "?" . GET_INDEX_SERVER_ACTION . "=addserver", $html);
    $html = str_replace("<!--lz_version-->", VERSION, $html);
    echo doReplacements($html);
}
예제 #4
0
파일: track.php 프로젝트: afzet/cake-cart
 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])) {
         $BROWSER->Company = substr(secPrev(base64UrlDecode($_GET[GET_EXTERN_USER_COMPANY])), 0, 50);
     }
     getData(false, false, false, true);
     define("IS_FILTERED", $FILTERS->Match(getIP(), formLanguages(!isnull(getServerParam("HTTP_ACCEPT_LANGUAGE")) ? getServerParam("HTTP_ACCEPT_LANGUAGE") : ""), CALLER_USER_ID));
     define("IS_FLOOD", !dataSetExists($BROWSER->SessionFile) && isFlood());
     if (!getAvailability() || IS_FILTERED || IS_FLOOD) {
         $BROWSER->Destroy();
         exit("lz_tracking_stop_tracking();");
     }
     if (dataSetExists($BROWSER->SessionFile)) {
         $BROWSER->Load();
     }
     $count = count($BROWSER->History);
     if (!dataSetExists($externalUser->ExternalStatic->SessionFile)) {
         createStaticFile($externalUser, array(@$_GET[GET_TRACK_RESOLUTION_WIDTH], @$_GET[GET_TRACK_RESOLUTION_HEIGHT]), @$_GET[GET_TRACK_COLOR_DEPTH], @$_GET[GET_TRACK_TIMEZONE_OFFSET], @$_GET[GEO_LATITUDE], @$_GET[GEO_LONGITUDE], @$_GET[GEO_COUNTRY_ISO_2], @$_GET[GEO_CITY], @$_GET[GEO_REGION], @$_GET[GEO_TIMEZONE], @$_GET[GEO_ISP], @$_GET[GEO_SSPAN], @$_GET[GEO_RESULT_ID]);
     }
     if (isset($_GET[GET_TRACK_CLOSE_CHAT_WINDOW])) {
         $chat = new ExternalChat($externalUser->UserId, $_GET[GET_TRACK_CLOSE_CHAT_WINDOW]);
         $chat->Load();
예제 #5
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();
}
예제 #6
0
파일: extern.php 프로젝트: afzet/cake-cart
    die;
}
require LIVEZILLA_PATH . "_lib/objects.external.inc.php";
require LIVEZILLA_PATH . "_lib/functions.external.inc.php";
if (isset($_POST[POST_EXTERN_SERVER_ACTION])) {
    languageSelect();
    getData(false, true, false, true);
    $externalUser = new UserExternal($_POST[POST_EXTERN_USER_USERID]);
    $externalUser->ExternalStatic = new ExternalStatic($externalUser->UserId);
    array_push($externalUser->Browsers, new ExternalChat($externalUser->UserId, $_POST[POST_EXTERN_USER_BROWSERID]));
    define("IS_FILTERED", $FILTERS->Match(getIP(), formLanguages(getServerParam("HTTP_ACCEPT_LANGUAGE") != null ? getServerParam("HTTP_ACCEPT_LANGUAGE") : ""), $_POST[POST_EXTERN_USER_USERID]));
    define("IS_FLOOD", !dataSetExists($externalUser->Browsers[0]->SessionFile) && isFlood());
    if (dataSetExists($externalUser->Browsers[0]->SessionFile)) {
        $externalUser->Browsers[0]->Load();
    }
    $externalUser->ExternalStatic->Language = getServerParam("HTTP_ACCEPT_LANGUAGE") != null ? getServerParam("HTTP_ACCEPT_LANGUAGE") : "";
    $externalUser->Browsers[0]->LoadChat($CONFIG, null);
    if ($_POST[POST_EXTERN_SERVER_ACTION] == EXTERN_ACTION_LISTEN) {
        $externalUser = listen($externalUser);
    } else {
        if ($_POST[POST_EXTERN_SERVER_ACTION] == EXTERN_ACTION_MAIL) {
            getData(false, true, false, false);
            if ($externalUser->SaveTicket(AJAXDecode($_POST[POST_EXTERN_USER_GROUP])) && ($CONFIG["gl_scom"] != null || $CONFIG["gl_sgom"] != null)) {
                $externalUser->SendCopyOfMail(AJAXDecode($_POST[POST_EXTERN_USER_GROUP]), $CONFIG, $GROUPS);
            }
        } else {
            if ($_POST[POST_EXTERN_SERVER_ACTION] == EXTERN_ACTION_RATE) {
                getData(true, false, false, false);
                $externalUser->SaveRate(AJAXDecode($_POST[POST_EXTERN_REQUESTED_INTERNID]));
            } else {
                if ($externalUser->Browsers[0]->Chat != null) {
예제 #7
0
    $html = str_replace("<!--cbcd-->", parseBool($CONFIG["gl_cbcd"]), $html);
    $html = str_replace("<!--bookmark_name-->", base64_encode($CONFIG["gl_site_name"]), $html);
    $html = str_replace("<!--user_id-->", SESSION, $html);
    $html = str_replace("<!--connection_error_span-->", CONNECTION_ERROR_SPAN, $html);
    $html = replaceLoginDetails($html);
    $html = geoReplacements($html);
    $html = str_replace("<!--requested_intern_userid-->", isset($_GET[GET_EXTERN_INTERN_USER_ID]) && !isnull($_GET[GET_EXTERN_INTERN_USER_ID]) ? base64UrlDecode($_GET[GET_EXTERN_INTERN_USER_ID]) : "", $html);
    $html = str_replace("<!--geo_url-->", CONFIG_LIVEZILLA_GEO . "?aid=" . $CONFIG["wcl_geo_tracking"], $html);
    $html = str_replace("<!--geo_resolute-->", parseBool(!isSSpanFile() && !isnull($CONFIG["wcl_geo_tracking"]) && !(getCookieValue("geo_data") != null && getCookieValue("geo_data") > time() - 2592000)), $html);
    $html = str_replace("<!--area_code-->", isset($_GET[GET_TRACK_SPECIAL_AREA_CODE]) ? "&code=" . $_GET[GET_TRACK_SPECIAL_AREA_CODE] : "", $html);
    $html = str_replace("<!--template_message_intern-->", base64_encode(getFile(TEMPLATE_HTML_MESSAGE_INTERN)), $html);
    $html = str_replace("<!--template_message_extern-->", base64_encode(getFile(TEMPLATE_HTML_MESSAGE_EXTERN)), $html);
    $html = str_replace("<!--template_message_add-->", base64_encode(getFile(TEMPLATE_HTML_MESSAGE_ADD)), $html);
    $html = str_replace("<!--template_message_add_alt-->", base64_encode(getFile(TEMPLATE_HTML_MESSAGE_ADD_ALTERNATE)), $html);
    $html = str_replace("<!--direct_login-->", parseBool(isset($_GET[GET_EXTERN_USER_NAME]) && !isset($_GET[GET_EXTERN_RESET]) && !isnull($_GET[GET_EXTERN_USER_NAME])), $html);
    $html = str_replace("<!--is_ie-->", parseBool(!isnull(getServerParam('HTTP_USER_AGENT')) && strpos(getServerParam('HTTP_USER_AGENT'), 'MSIE') !== false), $html);
    $html = str_replace("<!--setup_error-->", base64_encode(buildLoginErrorField()), $html);
    $html = str_replace("<!--offline_message_mode-->", $CONFIG["gl_om_mode"], $html);
    $html = str_replace("<!--offline_message_http-->", $CONFIG["gl_om_http"], $html);
    $html = str_replace("<!--offline_message_pre_chat-->", parseBool($CONFIG["gl_no_om_sp"] == 1), $html);
    $html = str_replace("<!--lang_client_queue_message-->", $CONFIG["gl_sho_qu_inf"] == 1 ? $LZLANG["client_queue_message"] : $LZLANG["client_ints_are_busy"], $html);
} else {
    if (isset($_GET[GET_EXTERN_TEMPLATE]) && $_GET[GET_EXTERN_TEMPLATE] == "lz_chat_frame.3.2.login.1.0") {
        getData(true, false, false, false);
        $html = getFile(PATH_FRAMES . $_GET[GET_EXTERN_TEMPLATE] . ".tpl");
        $html = isset($CONFIG["gl_site_name"]) ? str_replace("<!--config_name-->", $CONFIG["gl_site_name"], $html) : str_replace("<!--config_name-->", "LiveZilla", $html);
        $html = replaceLoginDetails($html);
        $html = str_replace("<!--alert-->", str_replace("<!--server-->", LIVEZILLA_URL, getFile(TEMPLATE_SCRIPT_ALERT)), $html);
        $html = str_replace("<!--info_text-->", $CONFIG["gl_info"], $html);
        $html = str_replace("<!--login_trap-->", getFile(TEMPLATE_LOGIN_TRAP), $html);
    } else {
예제 #8
0
function receiveFile($id = FILE_ACTION_NONE)
{
    global $RESPONSE, $INTERNAL;
    if (isset($_POST[POST_INTERN_FILE_TYPE]) && $_POST[POST_INTERN_FILE_TYPE] == FILE_TYPE_USERFILE) {
        $fid = md5($_FILES["file"]["name"] . CALLER_SYSTEM_ID . time());
        $filemask = CALLER_SYSTEM_ID . "_" . $fid;
        $parentId = getServerParam("HTTP_QRD_PARENT_ID");
        $rank = getServerParam("HTTP_QRD_RANK");
        if (isnull($parentId)) {
            createFileBaseFolders(CALLER_SYSTEM_ID, true);
            processResource(CALLER_SYSTEM_ID, CALLER_SYSTEM_ID, $INTERNAL[CALLER_SYSTEM_ID]->Fullname, 0, $INTERNAL[CALLER_SYSTEM_ID]->Fullname, 0, 4, 3);
            $parentId = CALLER_SYSTEM_ID;
            $rank = 4;
        }
        processResource(CALLER_SYSTEM_ID, $fid, $filemask, 3, $_FILES["file"]["name"], 0, $parentId, $rank, $_FILES["file"]["size"]);
        if (move_uploaded_file($_FILES["file"]["tmp_name"], PATH_UPLOADS . $filemask)) {
            $id = FILE_ACTION_SUCCEEDED;
        } else {
            $id = FILE_ACTION_ERROR;
        }
    }
    $RESPONSE->SetStandardResponse($id, base64_encode($fid));
}