From fca74ed824beebc7fbc117a5c020ad522456ed6d Mon Sep 17 00:00:00 2001 From: Dmitriy Simushev Date: Thu, 16 Feb 2012 19:46:23 +0000 Subject: [PATCH] The pre-chat survey in no longer displayed for an invited visitors. --- src/messenger/webim/client.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/messenger/webim/client.php b/src/messenger/webim/client.php index 0d60d443..373ebaed 100644 --- a/src/messenger/webim/client.php +++ b/src/messenger/webim/client.php @@ -97,18 +97,21 @@ if( !isset($_GET['token']) || !isset($_GET['thread']) ) { exit; } - if($settings['enablepresurvey'] == '1' && !(isset($_POST['survey']) && $_POST['survey'] == 'on')) { + $link = connect(); + $invitation_state = invitation_state($_SESSION['visitorid'], $link); + $visitor_is_invited = $settings['enabletracking'] && $invitation_state['invited'] && !$invitation_state['threadid']; + if($settings['enablepresurvey'] == '1' && !(isset($_POST['survey']) && $_POST['survey'] == 'on') && !$visitor_is_invited) { $page = array(); setup_logo(); setup_survey($visitor['name'], $email, $groupid, $info, $referrer); expand("styles/dialogs", getchatstyle(), "survey.tpl"); + close_connection($link); exit; } $remoteHost = get_remote_host(); $userbrowser = $_SERVER['HTTP_USER_AGENT']; - $link = connect(); if(!check_connections_from_remote($remoteHost, $link)) { close_connection($link); die("number of connections from your IP is exceeded, try again later");