default to a session cookie instead of setting an explicit timeout, weird timezone...
[freeside.git] / httemplate / misc / edge_browser_check-iframe.html
1 <form id="canary-form" action="<% $fsurl %>misc/edge_browser_check-iframe.html" method="POST">
2 <input type="text" id="canary-result" value="<% scalar $cgi->param('edge_browser_canary') %>">
3 <select name="edge_browser_canary">
4   <option>test
5   <option>test
6 </select>
7 <input id="canary-submit" type="submit">
8 </form>
9
10 <script type="text/javascript">
11   $( function() {
12     if ( ! $("#canary-result").val() ) {
13       $("#canary-form").submit();
14     }
15   });
16 </script>
17
18 <%init>
19 my $cgi = FS::UID::cgi();
20 my $curuser = $FS::CurrentUser::CurrentUser;
21 my $session = $FS::CurrentUser::CurrentSession;
22 my $sessionkey = $session->sessionkey if $session;
23
24 if ( $curuser ) {
25   my $canary = $cgi->param('edge_browser_canary');
26   $curuser->set_pref(
27     'edge_bug_vulnerable',
28
29     $canary eq 'test' ? $sessionkey : 'Y',
30   );
31 }
32
33 </%init>