topage($thread['userName']), 'agent' => topage($thread['agentName']), 'link' => $_SERVER['PHP_SELF']."?thread=$threadid&force=true" ); start_html_output(); require('../view/confirm.php'); exit; } } if (!$viewonly) { take_thread($thread,$operator); } else if(!is_capable($can_viewthreads, $operator)) { $errors = array("Cannot view threads"); start_html_output(); expand("../styles", getchatstyle(), "error.tpl"); exit; } $token = $thread['ltoken']; header("Location: $webimroot/operator/agent.php?thread=$threadid&token=$token&level=$remote_level"); exit; } $token = verifyparam( "token", "/^\d{1,8}$/"); $thread = thread_by_id($threadid); if( !$thread || !isset($thread['ltoken']) || $token != $thread['ltoken'] ) { die("wrong thread"); } if($thread['agentId'] != $operator['operatorid'] && !is_capable($can_viewthreads, $operator)) { $errors = array("Cannot view threads"); start_html_output(); expand("../styles", getchatstyle(), "error.tpl"); exit; } setup_chatview_for_operator($thread, $operator); start_html_output(); $pparam = verifyparam( "act", "/^(redirect)$/", "default"); if( $pparam == "redirect" ) { setup_redirect_links($threadid,$token); expand("../styles", getchatstyle(), "redirect.tpl"); } else { expand("../styles", getchatstyle(), "chat.tpl"); } ?>