function reloadGroups($_user)
{
    global $CONFIG, $INTERNAL, $GROUPS;
    initData(true, false, false, true);
    $groupbuilder = new GroupBuilder($INTERNAL, $GROUPS, $CONFIG);
    $groupbuilder->Generate();
    if (isset($_POST[POST_EXTERN_REQUESTED_INTERNID]) && !empty($_POST[POST_EXTERN_REQUESTED_INTERNID])) {
        $_user->Browsers[0]->DesiredChatPartner = getInternalSystemIdByUserId(AJAXDecode($_POST[POST_EXTERN_REQUESTED_INTERNID]));
    }
    $_user->AddFunctionCall("top.lz_chat_set_groups(\"" . $groupbuilder->Result . "\" ," . $groupbuilder->ErrorHTML . ");", false);
    $_user->AddFunctionCall("lz_chat_release(" . parseBool($groupbuilder->GroupAvailable || isset($_POST[GET_EXTERN_RESET]) && strlen($groupbuilder->ErrorHTML) <= 2) . "," . $groupbuilder->ErrorHTML . ");", false);
    return $_user;
}
require LIVEZILLA_PATH . "_lib/functions.external.inc.php";
require LIVEZILLA_PATH . "_lib/objects.external.inc.php";
Server::DefineURL(FILE_CHAT);
Server::InitDataProvider();
LocalizationManager::AutoLoad();
$browserId = getId(USER_ID_LENGTH);
if (!isset($_GET[GET_EXTERN_TEMPLATE])) {
    @set_time_limit(Server::$Configuration->File["timeout_chats"]);
    if (!isset($_GET["file"])) {
        @set_error_handler("handleError");
    }
    define("SESSION", getSessionId());
    if (empty(Server::$Configuration->File["gl_om_pop_up"]) && Server::$Configuration->File["gl_om_mode"] == 1) {
        Server::InitDataBlock(array("INTERNAL", "GROUPS", "FILTERS"));
        $groupbuilder = new GroupBuilder();
        $groupbuilder->Generate();
        if (!$groupbuilder->GroupAvailable) {
            exit("<html><script language=\"JavaScript\">if(typeof(window.opener != null) != 'undefined')window.opener.location = \"" . Server::$Configuration->File["gl_om_http"] . "\";window.close();</script></html>");
        }
    } else {
        Server::InitDataBlock(array("FILTERS"));
    }
    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(Filter::CreateFloodFilter(Communication::GetIP(), null));
    }
}
header("Content-Type: text/html; charset=utf-8");
if (!isset($_GET[GET_EXTERN_TEMPLATE])) {
    define("IS_FLOOD", Filter::IsFlood(Communication::GetIP(), null, true));
    define("IS_FILTERED", DataManager::$Filters->Match(Communication::GetIP(), LocalizationManager::ImplodeLanguages(!empty($_SERVER["HTTP_ACCEPT_LANGUAGE"]) ? $_SERVER["HTTP_ACCEPT_LANGUAGE"] : ""), SESSION));
    require LIVEZILLA_PATH . "_lib/trdp/mobde.php";
function reloadGroups($_user)
{
    global $CONFIG, $INTERNAL, $GROUPS;
    initData(array("INTERNAL", "FILTERS"));
    if (!empty($_GET[GET_EXTERN_GROUP])) {
        $_user->Browsers[0]->DesiredChatGroup = base64UrlDecode(getParam(GET_EXTERN_GROUP));
    }
    $opParam = getOperatorParameter();
    if (!empty($opParam)) {
        $_user->Browsers[0]->DesiredChatPartner = Operator::GetSystemId($opParam);
    }
    $groupbuilder = new GroupBuilder($INTERNAL, $GROUPS, $CONFIG, $_user->Browsers[0]->DesiredChatGroup, $_user->Browsers[0]->DesiredChatPartner);
    $groupbuilder->Generate($_user);
    if (!empty($opParam)) {
        $_user->Browsers[0]->DesiredChatPartner = Operator::GetSystemId($opParam);
    }
    $groupsAvailable = parseBool($groupbuilder->GroupAvailable || isset($_POST[GET_EXTERN_RESET]) && strlen($groupbuilder->ErrorHTML) <= 2);
    $_user->AddFunctionCall("lz_chat_set_groups(" . $groupsAvailable . ",\"" . $groupbuilder->Result . "\" ," . $groupbuilder->ErrorHTML . ");", false);
    $_user->AddFunctionCall("lz_chat_release(" . $groupsAvailable . "," . $groupbuilder->ErrorHTML . ");", false);
    return $_user;
}
Example #4
0
require LIVEZILLA_PATH . "_lib/objects.external.inc.php";
@set_time_limit($CONFIG["timeout_chats"]);
if (!isset($_GET["file"])) {
    @set_error_handler("handleError");
}
if (!isset($_GET["browid"])) {
    exit;
}
languageSelect();
initData(array("INTERNAL", "GROUPS", "FILTERS", "INPUTS"));
$USER = new Visitor(base64UrlDecode(getParam(GET_TRACK_USERID)));
$USER->Load();
array_push($USER->Browsers, new VisitorChat($USER->UserId, $USER->UserId . "_OVL"));
array_push($USER->Browsers, $BROWSER);
$GroupBuilder = new GroupBuilder($INTERNAL, $GROUPS, $CONFIG, $USER->Browsers[0]->DesiredChatGroup, $USER->Browsers[0]->DesiredChatPartner, false);
$GroupBuilder->Generate(null, true);
$USER->Browsers[0]->Overlay = true;
$USER->Browsers[0]->Load();
if ($USER->Browsers[0]->FirstCall) {
    $USER->AddFunctionCall("lz_chat_init_data_change(null,null);", false);
}
if (IS_FILTERED) {
    $USER->Browsers[0]->CloseChat();
    $USER->Browsers[0]->Destroy();
    $USER->AddFunctionCall("lz_tracking_remove_overlay_chat();", true);
}
$USER->Browsers[0]->LoadForward(false);
$USER->LoadChatRequests();
if (!empty($USER->Browsers[0]->Forward) && (!$GROUPS[$USER->Browsers[0]->Forward->TargetGroupId]->IsHumanAvailable(true, true) || !empty($USER->Browsers[0]->Forward->TargetSessId) && @$INTERNAL[$USER->Browsers[0]->Forward->TargetSessId]->UserStatus >= USER_STATUS_OFFLINE)) {
    $USER->Browsers[0]->Forward->Destroy();
    $USER->Browsers[0]->Forward = null;
 function ReloadGroups($_overlay = false, $_preSelect = true)
 {
     Server::InitDataBlock(array("INTERNAL", "FILTERS"));
     $grParam = UserGroup::ReadParams();
     $opParam = Operator::ReadParams();
     if (!empty($grParam) && empty($this->Browsers[0]->DesiredChatGroup)) {
         $this->Browsers[0]->DesiredChatGroup = $grParam;
     }
     if (!empty($opParam)) {
         $this->Browsers[0]->DesiredChatPartner = Operator::GetSystemId($opParam);
     }
     $groupbuilder = new GroupBuilder($this->Browsers[0]->DesiredChatGroup, $this->Browsers[0]->DesiredChatPartner);
     $groupbuilder->Generate($this);
     if (!empty($opParam)) {
         $this->Browsers[0]->DesiredChatPartner = Operator::GetSystemId($opParam);
     }
     $groupsAvailable = To::BoolString($groupbuilder->GroupAvailable || isset($_POST[GET_EXTERN_RESET]) && strlen($groupbuilder->ErrorHTML) <= 2);
     $_preSelect = $_preSelect ? Encoding::Base64UrlEncode($this->Browsers[0]->DesiredChatGroup) : "";
     $this->AddFunctionCall("lz_chat_set_groups(" . $groupsAvailable . ",\"" . $groupbuilder->Result . "\" ," . $groupbuilder->ErrorHTML . ",'" . $_preSelect . "');", false);
     if (!$_overlay) {
         $this->AddFunctionCall("lz_chat_release(" . $groupsAvailable . "," . $groupbuilder->ErrorHTML . ");", false);
     }
 }
function reloadGroups($_user, $_overlay = false, $_preSelect = true, $_declined = false)
{
    global $CONFIG, $INTERNAL, $GROUPS;
    initData(array("INTERNAL", "FILTERS"));
    $grParam = UserGroup::ReadParams();
    $opParam = Operator::ReadParams();
    if (!empty($grParam) && empty($_user->Browsers[0]->DesiredChatGroup)) {
        $_user->Browsers[0]->DesiredChatGroup = $grParam;
    }
    if (!empty($opParam)) {
        $_user->Browsers[0]->DesiredChatPartner = Operator::GetSystemId($opParam);
    }
    $groupbuilder = new GroupBuilder($INTERNAL, $GROUPS, $CONFIG, $_user->Browsers[0]->DesiredChatGroup, $_user->Browsers[0]->DesiredChatPartner);
    $groupbuilder->Generate($_user);
    if (!empty($opParam)) {
        $_user->Browsers[0]->DesiredChatPartner = Operator::GetSystemId($opParam);
    }
    $groupsAvailable = parseBool($groupbuilder->GroupAvailable || isset($_POST[GET_EXTERN_RESET]) && strlen($groupbuilder->ErrorHTML) <= 2);
    $_preSelect = $_preSelect ? base64UrlEncode($_user->Browsers[0]->DesiredChatGroup) : "";
    $_user->AddFunctionCall("lz_chat_set_groups(" . $groupsAvailable . ",\"" . $groupbuilder->Result . "\" ," . $groupbuilder->ErrorHTML . ",'" . $_preSelect . "');", false);
    if (!$_overlay) {
        $_user->AddFunctionCall("lz_chat_release(" . $groupsAvailable . "," . $groupbuilder->ErrorHTML . ");", false);
    }
    return $_user;
}