From 59025d96bc6dd7932bd6c9b106643a22602b24b4 Mon Sep 17 00:00:00 2001 From: Teromene Date: Sat, 18 Mar 2017 19:02:18 +0000 Subject: [PATCH] Add an indicator to show the HTTP status of the site. (#483) --- bridges/ABCTabsBridge.php | 2 +- bridges/AskfmBridge.php | 2 +- bridges/BandcampBridge.php | 2 +- bridges/DansTonChatBridge.php | 2 +- css/style.css | 15 +++++++++++++++ lib/html.php | 10 ++++++++++ 6 files changed, 29 insertions(+), 4 deletions(-) diff --git a/bridges/ABCTabsBridge.php b/bridges/ABCTabsBridge.php index 8c47175..d44cba2 100644 --- a/bridges/ABCTabsBridge.php +++ b/bridges/ABCTabsBridge.php @@ -3,7 +3,7 @@ class ABCTabsBridge extends BridgeAbstract { const MAINTAINER = 'kranack'; const NAME = 'ABC Tabs Bridge'; - const URI = 'http://www.abc-tabs.com/'; + const URI = 'https://www.abc-tabs.com/'; const DESCRIPTION = 'Returns 22 newest tabs'; public function collectData(){ diff --git a/bridges/AskfmBridge.php b/bridges/AskfmBridge.php index 7d6639b..4b1597d 100644 --- a/bridges/AskfmBridge.php +++ b/bridges/AskfmBridge.php @@ -3,7 +3,7 @@ class AskfmBridge extends BridgeAbstract { const MAINTAINER = 'az5he6ch'; const NAME = 'Ask.fm Answers'; - const URI = 'http://ask.fm/'; + const URI = 'https://ask.fm/'; const CACHE_TIMEOUT = 300; //5 min const DESCRIPTION = 'Returns answers from an Ask.fm user'; const PARAMETERS = array( diff --git a/bridges/BandcampBridge.php b/bridges/BandcampBridge.php index 96c96da..28e9ba5 100644 --- a/bridges/BandcampBridge.php +++ b/bridges/BandcampBridge.php @@ -3,7 +3,7 @@ class BandcampBridge extends BridgeAbstract { const MAINTAINER = 'sebsauvage'; const NAME = 'Bandcamp Tag'; - const URI = 'http://bandcamp.com/'; + const URI = 'https://bandcamp.com/'; const CACHE_TIMEOUT = 600; // 10min const DESCRIPTION = 'New bandcamp release by tag'; const PARAMETERS = array( array( diff --git a/bridges/DansTonChatBridge.php b/bridges/DansTonChatBridge.php index 925c4a6..56bb4c1 100644 --- a/bridges/DansTonChatBridge.php +++ b/bridges/DansTonChatBridge.php @@ -3,7 +3,7 @@ class DansTonChatBridge extends BridgeAbstract { const MAINTAINER = 'Astalaseven'; const NAME = 'DansTonChat Bridge'; - const URI = 'http://danstonchat.com/'; + const URI = 'https://danstonchat.com/'; const CACHE_TIMEOUT = 21600; //6h const DESCRIPTION = 'Returns latest quotes from DansTonChat.'; diff --git a/css/style.css b/css/style.css index 32f5c33..4a0c677 100644 --- a/css/style.css +++ b/css/style.css @@ -144,6 +144,21 @@ form { } +.secure-warning { + + background-color: #ffc600; + color: #5f5f5f; + + box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.3); + border-radius: 2px; + border: 1px solid transparent; + + width: 80%; + margin: auto; + margin-bottom: 6px; + +} + input[type="text"] { background-color: white; diff --git a/lib/html.php b/lib/html.php index ed1b394..8643fa1 100644 --- a/lib/html.php +++ b/lib/html.php @@ -28,6 +28,14 @@ EOD; if($bridge == false) return ""; + $HTTPSWarning = ''; + if(strpos($bridge->getURI(), 'https') !== 0) { + + $HTTPSWarning = '
Warning : + This bridge is not fetching its content through a secure connection
'; + + } + $name = '' . $bridge->getName() . ''; $description = $bridge->getDescription(); @@ -45,6 +53,7 @@ CARD; if(count($bridge->getParameters()) == 0){ $card .= $getFormHeader($bridgeName); + $card .= $HTTPSWarning; if($isActive){ if(defined('PROXY_URL') && PROXY_BYBRIDGE){ @@ -93,6 +102,7 @@ CARD; $card .= '
' . $parameterName . '
' . PHP_EOL; $card .= $getFormHeader($bridgeName); + $card .= $HTTPSWarning; foreach($parameter as $id => $inputEntry){ $additionalInfoString = '';