force chat to be secure if needed

git-svn-id: https://webim.svn.sourceforge.net/svnroot/webim/trunk@460 c66351dc-e62f-0410-b875-e3a5c0b9693f
This commit is contained in:
Evgeny Gryaznov 2009-04-05 14:24:01 +00:00
parent 7b57fde652
commit 673df1d814

View File

@ -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']) ) {