Bug 30952: Staff interface redesign (header)
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / members / two_factor_auth.tt
1 [% USE raw %]
2 [% USE Koha %]
3 [% USE Asset %]
4 [% SET footerjs = 1 %]
5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>Two-factor authentication &rsaquo; Patrons &rsaquo; Koha</title>
7 [% INCLUDE 'doc-head-close.inc' %]
8 </head>
9 <body id="pat_two_factor_auth" class="pat">
10 [% WRAPPER 'header.inc' %]
11     [% INCLUDE 'patron-search-header.inc' %]
12 [% END %]
13
14 [% WRAPPER 'sub-header.inc' %]
15 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
16     <ol>
17         <li>
18             <a href="/cgi-bin/koha/mainpage.pl"><i class="fa fa-home"></i></a>
19         </li>
20         <li>
21             <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>
22         </li>
23         <li>
24             <a href="#" aria-current="page">
25                 Manage two-factor authentication
26             </a>
27         </li>
28     </ol>
29 </nav>
30 [% END %]
31
32 <div class="main container-fluid">
33     <div class="row">
34         <div class="col-sm-10 col-sm-push-2">
35             <main>
36
37                 [% INCLUDE 'members-toolbar.inc' %]
38
39                 <h1>Manage two-factor authentication</h1>
40
41                 [% IF ( missing_key ) %]
42                     <div id="error_message" class="dialog message">
43                         <p>
44                             Operation cannot proceed, please define an encryption key in your configuration.
45                         </p>
46                     </div>
47                 [% ELSE %]
48
49                     [% IF op == 'register' %]
50                         <div class="dialog message">
51                             <p>We recommend cloud-based mobile authenticator apps such as Authy, Duo Mobile, and LastPass. They can restore access if you lose your hardware device.</p>
52                             <p>Can't scan the code?</p>
53                             <p>To add the entry manually, provide the following details to the application on your phone.</p>
54                             <p>Account: [% issuer | html %]</p>
55                             <p>Key: [% key_id | html %]</p>
56                             <p>Time based: Yes</p>
57                         </div>
58
59                         [% IF invalid_pin %]
60                             <div class="dialog error">Invalid PIN code</div>
61                         [% END %]
62                         <form id="two-factor-auth" action="/cgi-bin/koha/members/two_factor_auth.pl" method="post">
63                             <fieldset class="rows">
64                                 <input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
65                                 <input type="hidden" name="op" value="register-2FA" />
66                                 <input type="hidden" name="secret32" value="[% secret32 | html %]" />
67                                 <ol>
68                                     <li>
69                                         <label for="qr_code">QR code: </label>
70                                         <img id="qr_code" src="[% qr_code | $raw %]" />
71                                     </li>
72                                     <li>
73                                         <label for="pin_code">PIN code: </label>
74                                         <input type="text" id="pin_code" name="pin_code" value="" />
75                                     </li>
76                                 </ol>
77                             </fieldset>
78                             <fieldset class="action">
79                                 <input type="submit" value="Register with two-factor app" />
80                                 <a class="cancel" href="/cgi-bin/koha/members/two_factor_auth.pl">Cancel</a>
81                             </fieldset>
82                         </form>
83                     [% ELSE %]
84                         [% IF patron.auth_method == "two-factor" %]
85                             <div class="two-factor-status">Status: Enabled</div>
86
87                             <form id="two-factor-auth" action="/cgi-bin/koha/members/two_factor_auth.pl" method="post">
88                                 <input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
89                                 <input type="hidden" name="op" value="disable-2FA" />
90                                 <input type="submit" value="Disable two-factor authentication" />
91                             </form>
92                         [% ELSE %]
93                             <div class="two-factor-status">Status: Disabled</div>
94
95                             <form id="two-factor-auth" action="/cgi-bin/koha/members/two_factor_auth.pl" method="post">
96                                 <input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
97                                 <input type="hidden" name="op" value="enable-2FA" />
98                                 <input type="submit" value="Enable two-factor authentication" />
99                             </form>
100
101                         [% END %]
102                     [% END %]
103                 [% END %]
104             </main>
105         </div> <!-- /.col-sm-10.col-sm-push-2 -->
106
107         <div class="col-sm-2 col-sm-pull-10">
108             <aside>
109                 [% INCLUDE 'circ-menu.inc' %]
110             </aside>
111         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
112     </div> <!-- /.row -->
113
114
115 [% MACRO jsinclude BLOCK %]
116     [% INCLUDE 'str/members-menu.inc' %]
117     [% Asset.js("js/members-menu.js") | $raw %]
118     <script>
119         $(document).ready(function(){
120             $(".delete").on("click", function(e){
121                 return confirmDelete(_("Are you sure you want to delete this key?"));
122             });
123         });
124     </script>
125 [% END %]
126
127 [% INCLUDE 'intranet-bottom.inc' %]