CMS for the late garbage.fm
at main 46 lines 1.2 kB view raw
1<div class="box wide"> 2 <div class="legend">Login - Step 2</div> 3 4 <? $form->form_tag(ADMIN_ROOT_URL . "auth2", array(), function($f) 5 use ($html, $auth_user) { ?> 6 <?= $html->flash_errors(); ?> 7 <?= $html->flash_notices(); ?> 8 9 <?= $f->label_tag("username", "Username:", 10 array("class" => "required")); ?> 11 <span class="d"> 12 <?= h($auth_user->username) ?> 13 </span> 14 <br /> 15 16 <? if ($auth_user->totp_secret) { ?> 17 <?= $f->label_tag("totp_code", "TOTP Code:", 18 array("class" => "required")); ?> 19 <?= $f->text_field_tag("totp_code", "", 20 array("autofocus" => "autofocus")) ?> 21 <br /> 22 23 <p> 24 <?= $f->submit_tag("Login"); ?> 25 </p> 26 <? } else { ?> 27 <? $totp = $auth_user->new_totp; ?> 28 29 <label class="required">TOTP Provisioning:</label> 30 <div class="d"> 31 Scan the following QR code in a TOTP-compatible application such as 32 Google Authenticator: 33 34 <p> 35 <a href="<?= h($totp->getProvisioningUri()) ?>"><img 36 src="https://chart.googleapis.com/chart?cht=qr&chs=200x200&chl=<?= 37 urlencode($totp->getProvisioningUri()) ?>&chld=H|0"></a> 38 </p> 39 </div> 40 41 <?= $f->hidden_field_tag("totp_secret", $auth_user->totp_secret); ?> 42 43 <?= $f->submit_tag("Proceed"); ?> 44 <? } ?> 45 <? }); ?> 46</div>