当前位置: 首页>>代码示例>>PHP>>正文


PHP Browser::GetRemoteLevel方法代码示例

本文整理汇总了PHP中Browser::GetRemoteLevel方法的典型用法代码示例。如果您正苦于以下问题:PHP Browser::GetRemoteLevel方法的具体用法?PHP Browser::GetRemoteLevel怎么用?PHP Browser::GetRemoteLevel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Browser的用法示例。


在下文中一共展示了Browser::GetRemoteLevel方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: verify_param

 * 
 * Все права защищены. (c) 2005-2009 ООО "ТОП".
 * Данное программное обеспечение и все сопутствующие материалы
 * предоставляются на условиях лицензии, доступной по адресу
 * http://webim.ru/license.html
 * 
 */
require_once '../classes/functions.php';
require_once '../classes/class.thread.php';
require_once '../classes/class.operator.php';
require_once '../classes/class.visitsession.php';
require_once '../classes/class.visitedpage.php';
require_once '../classes/class.invitation.php';
$operator = Operator::getInstance()->GetLoggedOperator();
$pageId = verify_param('pageid', '/^([a-z0-9]{32})?$/', '');
if (empty($pageId)) {
    die('invalid or absent pageid');
}
$visitSession = VisitSession::GetInstance()->GetVisitSessionByPageId($pageId);
$remoteLevel = Browser::GetRemoteLevel($visitSession['useragent']);
$thread = VisitedPage::GetInstance()->GetInvitationThread($pageId);
if (empty($thread) || $thread['state'] == STATE_CLOSED) {
    $thread = Thread::getInstance()->CreateThread(WEBIM_CURRENT_LOCALE, STATE_INVITE, array('operatorfullname' => $operator['fullname'], 'operatorid' => $operator['operatorid'], 'visitsessionid' => $visitSession['visitsessionid']));
    VisitSession::GetInstance()->UpdateVisitSession($visitSession['visitsessionid'], array('hasthread' => 1));
    $introMessage = Resources::Get('invite.intro.message', array($visitSession['visitorname']), WEBIM_CURRENT_LOCALE);
    Thread::getInstance()->PostMessage($thread['threadid'], KIND_FOR_AGENT, $introMessage);
    $invitationId = Invitation::getInstance()->CreateInvitation($thread['threadid']);
    VisitedPage::GetInstance()->UpdateVisitedPage($pageId, array('invitationid' => $invitationId));
}
header('Location: ' . WEBIM_ROOT . '/operator/agent.php?thread=' . $thread['threadid'] . '&token=' . $thread['token'] . '&level=' . $remoteLevel . '&force=false');
exit;
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:31,代码来源:invite.php

示例2: sendLocation

function sendLocation($thread)
{
    $threadid = $thread['threadid'];
    $token = $thread['token'];
    $level = Browser::GetRemoteLevel($_SERVER['HTTP_USER_AGENT']);
    $departmentkey = verify_param('deparmentkey', "/^\\w+\$/");
    $departmentParam = !empty($departmentkey) ? '&deparmentkey=' . $departmentkey : '';
    $url = WEBIM_ROOT . "/client.php?thread={$threadid}&token={$token}&level={$level}" . $departmentParam . getParametersToPassThru();
    header('Location: ' . $url);
    exit;
}
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:11,代码来源:client.php

示例3: handleWithoutToken

function handleWithoutToken($threadid, $viewonly)
{
    $TML = new SmartyClass();
    $operator = Operator::getInstance()->GetLoggedOperator();
    $remote_level = Browser::GetRemoteLevel($_SERVER['HTTP_USER_AGENT']);
    if ($remote_level != "ajaxed") {
        die("old browser is used, please update it");
    }
    $thread = Thread::getInstance()->GetThreadById($threadid);
    if (!$thread || !isset($thread['token'])) {
        die("wrong thread");
    }
    if ($viewonly && $operator['operatorid'] != $thread['operatorid']) {
        redirectToPageWithToken($thread, $viewonly, $remote_level);
    }
    $forcetake = verify_param("force", "/^true\$/", false);
    if ($forcetake) {
        ThreadProcessor::getInstance()->ProcessThread($thread['threadid'], 'operator_force_join', array("operatorid" => $operator["operatorid"]));
        redirectToPageWithToken($thread, null, $remote_level);
    } else {
        // is taken by another
        $visitSession = VisitSession::GetInstance()->GetVisitSessionById($thread['visitsessionid']);
        if ($thread['state'] != STATE_CLOSED && !empty($thread['operatorid']) && $operator['operatorid'] != $thread['operatorid'] && $operator['operatorid'] != $thread['nextoperatorid']) {
            $page = array('visitor' => $visitSession['visitorname'], 'agent' => $thread['operatorfullname'], 'force' => true, 'takelink' => $_SERVER['PHP_SELF'] . "?thread={$threadid}&force=true", 'viewlink' => $_SERVER['PHP_SELF'] . "?thread={$threadid}&viewonly=true", 'priority' => $thread['state'] == STATE_QUEUE_EXACT_OPERATOR || $thread['state'] == STATE_CHATTING_OPERATOR_BROWSER_CLOSED_REFRESHED);
            // TODO get rid of STATE_WAIT_ANOTHER_OPERATOR
            $TML->assign('link_arguments', "&thread={$threadid}");
            $TML->assign('page', $page);
            $TML->display('confirm.tpl');
            exit;
        }
        // is closed
        if ($thread['state'] == STATE_CLOSED) {
            $page = array('viewlink' => $_SERVER['PHP_SELF'] . "?thread=" . $threadid . "&viewonly=true", 'force' => false, 'thread_id' => $threadid, 'closed' => true);
            $TML->assign('link_arguments', "&thread={$threadid}");
            $TML->assign('page', $page);
            $TML->display('confirm.tpl');
            exit;
        }
    }
    ThreadProcessor::getInstance()->ProcessThread($thread['threadid'], 'operator_join', array('operatorid' => $operator['operatorid']));
    redirectToPageWithToken($thread, $viewonly, $remote_level);
}
开发者ID:notUserDeveloper,项目名称:fl-ru-damp,代码行数:42,代码来源:agent.php


注:本文中的Browser::GetRemoteLevel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。