The pre-chat survey in no longer displayed for an invited visitors.

This commit is contained in:
Dmitriy Simushev 2012-02-16 19:46:23 +00:00
parent cf374158a8
commit fca74ed824

View File

@ -97,18 +97,21 @@ if( !isset($_GET['token']) || !isset($_GET['thread']) ) {
exit; 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(); $page = array();
setup_logo(); setup_logo();
setup_survey($visitor['name'], $email, $groupid, $info, $referrer); setup_survey($visitor['name'], $email, $groupid, $info, $referrer);
expand("styles/dialogs", getchatstyle(), "survey.tpl"); expand("styles/dialogs", getchatstyle(), "survey.tpl");
close_connection($link);
exit; exit;
} }
$remoteHost = get_remote_host(); $remoteHost = get_remote_host();
$userbrowser = $_SERVER['HTTP_USER_AGENT']; $userbrowser = $_SERVER['HTTP_USER_AGENT'];
$link = connect();
if(!check_connections_from_remote($remoteHost, $link)) { if(!check_connections_from_remote($remoteHost, $link)) {
close_connection($link); close_connection($link);
die("number of connections from your IP is exceeded, try again later"); die("number of connections from your IP is exceeded, try again later");