Browse Source

2FA: Add usernames to QR codes

spaghetti 7 years ago
parent
commit
19a6f14642
1 changed files with 6 additions and 6 deletions
  1. 6
    6
      sections/user/2fa.php

+ 6
- 6
sections/user/2fa.php View File

@@ -117,7 +117,7 @@ View::show_header("Two-factor Authentication Settings", 'u2f');
117 117
           <p>To enable it, add the secret key below to your 2FA client either manually or by scanning the QR code, then enter a verification code generated by your 2FA client and click the "Enable 2FA" button.</p>
118 118
           <form method="post">
119 119
             <input type="text" size="60" name="twofasecret" id="twofasecret" value="<?=$TwoFASecret?>" readonly><br>
120
-            <img src="<?=$TwoFA->getQRCodeImageAsDataUri(SITE_NAME, $TwoFASecret)?>"><br>
120
+            <img src="<?=$TwoFA->getQRCodeImageAsDataUri(SITE_NAME.':'.$LoggedUser['Username'], $TwoFASecret)?>"><br>
121 121
             <input type="text" size="20" maxlength="6" pattern="[0-9]{0,6}" name="twofa" id="twofa" placeholder="Verification Code" autocomplete="off"><br><br>
122 122
             <button type="submit" name="type" value="2FA-E">Enable 2FA</button>
123 123
           </form>
@@ -130,7 +130,7 @@ View::show_header("Two-factor Authentication Settings", 'u2f');
130 130
           <input type="hidden" name="type" value="2FA-D">
131 131
           <p>2FA is enabled for this account with the following secret:</p>
132 132
           <input type="text" size="20" name="twofasecret" id="twofasecret" value="<?=$TwoFASecret?>" readonly><br>
133
-          <img src="<?=$TwoFA->getQRCodeImageAsDataUri(SITE_NAME, $TwoFASecret)?>"><br><br>
133
+          <img src="<?=$TwoFA->getQRCodeImageAsDataUri(SITE_NAME.':'.$LoggedUser['Username'], $TwoFASecret)?>"><br><br>
134 134
           <p>To disable 2FA, click the button below.</p>
135 135
           <button type="submit" name="type" value="2FA-D">Disable 2FA</button>
136 136
         </form>
@@ -162,11 +162,11 @@ View::show_header("Two-factor Authentication Settings", 'u2f');
162 162
           <input type="hidden" name="u2f-sigs" value='<?=json_encode($U2FSigs)?>'>
163 163
           <input type="hidden" name="u2f-response">
164 164
           <input type="hidden" value="U2F-E">
165
+          <p>Universal Two Factor is enabled.</p>
166
+          <p>To add an additional U2F token, plug it in and press the button on it</p>
167
+          <p>To disable U2F completely and deregister all tokens, press the button below</p>
168
+          <button type="submit" name="type" value="U2F-D">Disable U2F</button>
165 169
         </form>
166
-        <p>Universal Two Factor is enabled.</p>
167
-        <p>To add an additional U2F token, plug it in and press the button on it</p>
168
-        <p>To disable U2F completely and deregister all tokens, press the button below</p>
169
-        <button type="submit" name="type" value="U2F-D">Disable U2F</button>
170 170
 <?    } ?>
171 171
       </div>
172 172
     </div>

Loading…
Cancel
Save