From 8a8e73270785100f2abc1242148a935d09f976ea Mon Sep 17 00:00:00 2001 From: Mitch Jackson Date: Wed, 12 Sep 2018 23:32:52 -0400 Subject: [PATCH] RT# 80624 Detect and warn for bad MS Edge version --- httemplate/elements/header.html | 1 + .../misc/edge_browser_check-fail_notice.html | 25 ++++++++++++++++ httemplate/misc/edge_browser_check-header.html | 32 ++++++++++++++++++++ httemplate/misc/edge_browser_check-iframe.html | 35 ++++++++++++++++++++++ 4 files changed, 93 insertions(+) create mode 100644 httemplate/misc/edge_browser_check-fail_notice.html create mode 100644 httemplate/misc/edge_browser_check-header.html create mode 100644 httemplate/misc/edge_browser_check-iframe.html diff --git a/httemplate/elements/header.html b/httemplate/elements/header.html index c6b10e301..6df45fb07 100644 --- a/httemplate/elements/header.html +++ b/httemplate/elements/header.html @@ -4,3 +4,4 @@ % } else { <& header-full.html, @_ &> % } +<& /misc/edge_browser_check-header.html &> diff --git a/httemplate/misc/edge_browser_check-fail_notice.html b/httemplate/misc/edge_browser_check-fail_notice.html new file mode 100644 index 000000000..fb42ffe8e --- /dev/null +++ b/httemplate/misc/edge_browser_check-fail_notice.html @@ -0,0 +1,25 @@ +<& /elements/header.html, "Edge browser bug" &> + +
+
+ ⚠ +
+

+ Edge Browser Bug +

+

+ Your copy of Microsoft Edge has a data corrupting bug. +

+

+ Microsoft fixed this bug with the July RS4 Windows 10 Update. + Please update your copy of Windows. +

+

+ Alternatively, you may choose to use + Mozilla Firefox + or Google Chrome. They + are not affected by this bug. +

+
+ +<& /elements/footer.html &> \ No newline at end of file diff --git a/httemplate/misc/edge_browser_check-header.html b/httemplate/misc/edge_browser_check-header.html new file mode 100644 index 000000000..e7666aec4 --- /dev/null +++ b/httemplate/misc/edge_browser_check-header.html @@ -0,0 +1,32 @@ +% if ( $force_redirect ) { + +% } elsif ( $do_check ) { + + +% } +<%init> +my $curuser = $FS::CurrentUser::CurrentUser; +my $cgi = FS::UID::cgi(); +my $DEBUG = 0; + +my $do_check = 0; +$do_check = 1 + if $curuser + && !$cgi->param('edge_browser_check') + && $curuser->get_pref('edge_bug_vulnerable') ne 'N'; + +my $force_redirect = $curuser->get_pref('edge_bug_vulnerable') eq 'Y' ? 1 : 0; + \ No newline at end of file diff --git a/httemplate/misc/edge_browser_check-iframe.html b/httemplate/misc/edge_browser_check-iframe.html new file mode 100644 index 000000000..e804fc676 --- /dev/null +++ b/httemplate/misc/edge_browser_check-iframe.html @@ -0,0 +1,35 @@ +
+ + + +
+ + + + +<%init> +my $cgi = FS::UID::cgi(); +my $curuser = $FS::CurrentUser::CurrentUser; + +if ( $curuser ) { + my $canary = $cgi->param('edge_browser_canary'); + $curuser->set_pref( + 'edge_bug_vulnerable', + + $canary eq 'test' ? 'Y' : 'Y', + + # Don't test this user's session for the next 10m + time() + 600, + ); +} + + \ No newline at end of file -- 2.11.0