From d933c64b2f31cc54c8b6b37b8fdd35efb288ca5c Mon Sep 17 00:00:00 2001 From: Romain Neutron Date: Fri, 6 Jan 2012 14:42:41 +0100 Subject: [PATCH 1/9] Use of secured scheme for external apis in case of https --- lib/classes/http/request.class.php | 7 +++++++ templates/mobile/lightbox/index.twig | 2 +- templates/mobile/report/header.twig | 2 +- templates/web/login/index.twig | 6 +++--- templates/web/login/index_layout_displaycooliris.twig | 4 ++-- templates/web/prod/index.html | 2 +- templates/web/report/ajax_data_content.twig | 2 +- templates/web/report/all_content.twig | 3 +-- www/client/index.php | 6 ++++-- 9 files changed, 21 insertions(+), 13 deletions(-) diff --git a/lib/classes/http/request.class.php b/lib/classes/http/request.class.php index 62b3bfe6c4..c83ee48623 100644 --- a/lib/classes/http/request.class.php +++ b/lib/classes/http/request.class.php @@ -93,6 +93,13 @@ class http_request return true; return false; } + + public function is_secure() + { + return ( + isset($_SERVER['HTTPS']) && (strtolower($_SERVER['HTTPS']) == 'on' || $_SERVER['HTTPS'] == 1) + ); + } public function comes_from_flash() { diff --git a/templates/mobile/lightbox/index.twig b/templates/mobile/lightbox/index.twig index 9e7a2f9b7a..06507a78e6 100644 --- a/templates/mobile/lightbox/index.twig +++ b/templates/mobile/lightbox/index.twig @@ -70,7 +70,7 @@

Phraseanet Version {{session.get_version()}}

- +

License GNU GPL v3

diff --git a/templates/mobile/report/header.twig b/templates/mobile/report/header.twig index 225178a915..88c38e0320 100644 --- a/templates/mobile/report/header.twig +++ b/templates/mobile/report/header.twig @@ -26,7 +26,7 @@ dmax : '{{ dashboard_array.dmax_req }}' }; - + diff --git a/templates/web/login/index.twig b/templates/web/login/index.twig index 3404edca5c..b5647271ac 100644 --- a/templates/web/login/index.twig +++ b/templates/web/login/index.twig @@ -46,8 +46,8 @@ {% endif %} {% if display_chrome_frame and session.get_cookie('gfc_box') == false %}