diff --git a/setup/frames/index.inc.php b/setup/frames/index.inc.php index 370bf748a7..fca7a27291 100644 --- a/setup/frames/index.inc.php +++ b/setup/frames/index.inc.php @@ -66,30 +66,19 @@ if (!$config_writable || !$config_readable) { ); } // -// Check https connection +// Https connection warning (check done on the client side) // -$is_https = !empty($_SERVER['HTTPS']) - && mb_strtolower($_SERVER['HTTPS']) == 'on'; -if (!$is_https) { - $text = __( - 'You are not using a secure connection; all data (including potentially ' - . 'sensitive information, like passwords) is transferred unencrypted!' - ); - - $text .= ' '; - - // Temporary workaround to use tranlated message in older releases - $text .= str_replace( - array('[a@%s]', '[/a]'), - array('', ''), - __( - 'If your server is also configured to accept HTTPS requests ' - . 'follow [a@%s]this link[/a] to use a secure connection.' - ) - ); - $text .= ''; - PMA_messagesSet('notice', 'no_https', __('Insecure connection'), $text); -} +$text = __( + 'You are not using a secure connection; all data (including potentially ' + . 'sensitive information, like passwords) is transferred unencrypted!' +); +$text .= ' '; +$text .= __( + 'If your server is also configured to accept HTTPS requests ' + . 'follow this link to use a secure connection.' +); +$text .= ''; +PMA_messagesSet('notice', 'no_https', __('Insecure connection'), $text); echo '
'; diff --git a/setup/lib/index.lib.php b/setup/lib/index.lib.php index c4de5964a4..17451b597e 100644 --- a/setup/lib/index.lib.php +++ b/setup/lib/index.lib.php @@ -79,23 +79,18 @@ function PMA_messagesEnd() */ function PMA_messagesShowHtml() { - $old_ids = array(); foreach ($_SESSION['messages'] as $type => $messages) { foreach ($messages as $id => $msg) { - echo '
' + if (! $msg['fresh'] && $type != 'error') { + $extra = ' hiddenmessage'; + } else { + $extra = ''; + } + echo '
' , '

' , $msg['title'] , '

' , $msg['message'] , '
'; - if (!$msg['fresh'] && $type != 'error') { - $old_ids[] = $id; - } } } - - echo "\n" , '\n"; } /** diff --git a/setup/scripts.js b/setup/scripts.js index e912bec005..53c33bebbd 100644 --- a/setup/scripts.js +++ b/setup/scripts.js @@ -12,24 +12,29 @@ if (top != self) { // Messages // -// stores hidden message ids -var hiddenMessages = []; - $(function () { - var hidden = hiddenMessages.length; - for (var i = 0; i < hidden; i++) { - $('#' + hiddenMessages[i]).css('display', 'none'); + + if (window.location.protocol === 'https:') { + $('#no_https').remove(); + } else { + $('#no_https a').click(function () { + var old_location = window.location; + window.location.href = 'https:' + old_location.href.substring(old_location.protocol.length); + return false; + }); } - if (hidden > 0) { + + var hiddenmessages = $('.hiddenmessage'); + + if (hiddenmessages.length > 0) { + hiddenmessages.hide(); var link = $('#show_hidden_messages'); link.click(function (e) { e.preventDefault(); - for (var i = 0; i < hidden; i++) { - $('#' + hiddenMessages[i]).show(500); - } + hiddenmessages.show(); $(this).remove(); }); - link.html(link.html().replace('#MSG_COUNT', hidden)); + link.html(link.html().replace('#MSG_COUNT', hiddenmessages.length)); link.css('display', ''); } });