Ver Fonte

Unset twofa on error

+ Autofocus on fields
Jaap Marcus há 5 anos atrás
pai
commit
b93570f6bd

+ 3 - 0
web/login/index.php

@@ -107,6 +107,7 @@ function authenticate_user(){
                         unset($output);
                         if ( $return_var > 0 ) {
                             sleep(2);
+                            unset($_POST['twofa']);
                             $error = "<a class=\"error\">".__('Invalid or missing 2FA token')."</a>";
                             return $error;
                         }
@@ -183,5 +184,7 @@ if (empty($_POST['user'])) {
     require_once('../templates/login_1.html');
 }else if (empty($_POST['twofa'])) {
     require_once('../templates/login_2.html');    
+} else {
+    require_once('../templates/login.html');
 }
 ?>

+ 1 - 1
web/templates/login.html

@@ -23,7 +23,7 @@
                                         </tr>
                                         <tr>
                                             <td>
-                                                <input tabindex="1" type="text" size="20px" style="width:240px;" name="user" class="vst-input">
+                                                <input tabindex="1" type="text" size="20px" style="width:240px;" name="user" class="vst-input" autofocus />
                                             </td>
                                         </tr>
                                         <tr>

+ 1 - 1
web/templates/login_1.html

@@ -30,7 +30,7 @@
                                         </tr>
                                         <tr>
                                             <td>
-                                                <input tabindex="2" type="password" size="20px"  style="width:240px;" name="password" class="vst-input">
+                                                <input tabindex="2" type="password" size="20px"  style="width:240px;" name="password" class="vst-input" autofocus />
                                             </td>
                                         </tr>
                                         <tr>

+ 1 - 1
web/templates/login_2.html

@@ -30,7 +30,7 @@
                                         </tr>
                                         <tr>
                                             <td>
-                                                <input tabindex="2" type="" size="20px"  style="width:240px;" name="twofa" class="vst-input">
+                                                <input tabindex="2" type="" size="20px"  style="width:240px;" name="twofa" class="vst-input" autofocus />
                                             </td>
                                         </tr>
                                         <tr>