diff --git a/htdocs/js/ajax_functions.js b/htdocs/js/ajax_functions.js index 1b3a955..540b925 100644 --- a/htdocs/js/ajax_functions.js +++ b/htdocs/js/ajax_functions.js @@ -202,8 +202,6 @@ function makeHttpRequest(url,parameters,meth,successCallbackFunctionName,errorCa http_request.open(meth,url,true); http_request.setRequestHeader('Content-type','application/x-www-form-urlencoded'); - http_request.setRequestHeader('Content-length',parameters.length); - http_request.setRequestHeader('Connection','close'); if (meth == 'GET') parameters = null; http_request.send(parameters); diff --git a/htdocs/login_form.php b/htdocs/login_form.php index f16bdbf..6add50d 100644 --- a/htdocs/login_form.php +++ b/htdocs/login_form.php @@ -16,7 +16,19 @@ printf('

%s %s

',_('Authenticate to server'),$app['server'] echo '
'; # Check for a secure connection -if (! isset($_SERVER['HTTPS']) || strtolower($_SERVER['HTTPS']) != 'on') { +$isHTTPS = false; + +# Check if the current connection is encrypted +if (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') { + $isHTTPS = true; +} +# Check if a proxy server downstream does encryption for us +elseif (!empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) == 'https' || !empty($_SERVER['HTTP_X_FORWARDED_SSL']) && strtolower($_SERVER['HTTP_X_FORWARDED_SSL']) +== 'on') { + $isHTTPS = true; +} + +if (!$isHTTPS) { echo '
'; printf('%s: %s.', _('You are not using \'https\'. Web browser will transmit login information in clear text.'), @@ -25,6 +37,7 @@ if (! isset($_SERVER['HTTPS']) || strtolower($_SERVER['HTTPS']) != 'on') { echo '
'; } +unset($isSecure); # HTTP Basic Auth Form. if ($app['server']->getAuthType() == 'http') {