From 673df1d814377c68a5c3c0e1f8993509c30591b3 Mon Sep 17 00:00:00 2001 From: Evgeny Gryaznov Date: Sun, 5 Apr 2009 14:24:01 +0000 Subject: [PATCH] force chat to be secure if needed git-svn-id: https://webim.svn.sourceforge.net/svnroot/webim/trunk@460 c66351dc-e62f-0410-b875-e3a5c0b9693f --- src/messenger/webim/operator/agent.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/messenger/webim/operator/agent.php b/src/messenger/webim/operator/agent.php index 0d4e1336..6d4b75b0 100644 --- a/src/messenger/webim/operator/agent.php +++ b/src/messenger/webim/operator/agent.php @@ -21,6 +21,19 @@ require_once('../libs/expand.php'); $operator = check_login(); +loadsettings(); +if($settings['enablessl'] == "1" && $settings['forcessl'] == "1") { + if(!is_secure_request()) { + $requested = $_SERVER['PHP_SELF']; + if($_SERVER['REQUEST_METHOD'] == 'GET' && $_SERVER['QUERY_STRING']) { + header("Location: ".get_app_location(true,true)."/operator/agent.php?".$_SERVER['QUERY_STRING']); + } else { + die("only https connections are handled"); + } + exit; + } +} + $threadid = verifyparam( "thread", "/^\d{1,8}$/"); if( !isset($_GET['token']) ) {