summaryrefslogtreecommitdiff
path: root/httemplate/misc/edge_browser_check-iframe.html
blob: e804fc6762764448de3f1ff4fb1e89fa6885b3fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<form id="canary-form" action="<% $fsurl %>misc/edge_browser_check-iframe.html" method="POST">
<input type="text" id="canary-result" value="<% scalar $cgi->param('edge_browser_canary') %>">
<select name="edge_browser_canary">
  <option>test
  <option>test
</select>
<input id="canary-submit" type="submit">
</form>

<script type="text/javascript" src="<% $fsurl %>elements/jquery.js"></script>
<script type="text/javascript">
  $( function() {
    if ( ! $("#canary-result").val() ) {
      $("#canary-form").submit();
    }
  });
</script>

<%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,
  );
}

</%init>