Passed
Push — master ( 1177a1...bb183a )
by
unknown
01:56 queued 10s
created
login.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -16,8 +16,8 @@  discard block
 block discarded – undo
16 16
                 if ($_SERVER['REQUEST_METHOD'] == 'GET' && isset($_GET["r_login"])) {
17 17
                     $error = "The page you tried to access requires you to be logged in.";
18 18
                 }
19
-                if($_SERVER['REQUEST_METHOD'] == 'POST' && $_POST['password'] && $_POST['username']) {
20
-                    if(isset($_POST['remember'])) {
19
+                if ($_SERVER['REQUEST_METHOD'] == 'POST' && $_POST['password'] && $_POST['username']) {
20
+                    if (isset($_POST['remember'])) {
21 21
                         $rememberMe = true;
22 22
                     } else {
23 23
                         $rememberMe = false;
@@ -26,12 +26,12 @@  discard block
 block discarded – undo
26 26
                     $stmt->bind_param("s", $_POST['username']);
27 27
                     $stmt->execute();
28 28
                     $result = $stmt->get_result();
29
-                    if(!mysqli_num_rows($result)){ { $error = "incorrect username or password"; goto skip; } }
29
+                    if (!mysqli_num_rows($result)) { { $error = "incorrect username or password"; goto skip; } }
30 30
                     
31 31
                     $row = $result->fetch_assoc();
32 32
                     $hash = $row['password'];
33 33
                     
34
-                    if(!password_verify($_POST['password'], $hash)) {
34
+                    if (!password_verify($_POST['password'], $hash)) {
35 35
                         $error = "incorrect username or password"; goto skip;
36 36
                     }
37 37
 
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
                     if (isset($result['otpsecret'])) {
43 43
                         $otp = true;
44 44
                         if (isset($_POST['totp'])) {
45
-                            if ($_POST['totp'] === $result['otpbackupcode']) {goto skip2fa;}
45
+                            if ($_POST['totp'] === $result['otpbackupcode']) {goto skip2fa; }
46 46
                             require("vendor/autoload.php");
47 47
                             $totp = OTPHP\TOTP::create($result['otpsecret']);
48 48
                             if (!$totp->verify($_POST['totp'])) {
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
                     }
57 57
                     skip2fa:
58 58
 
59
-                    if($rememberMe) {
59
+                    if ($rememberMe) {
60 60
                         session_write_close();
61 61
                         session_set_cookie_params("2678400");
62 62
                         ini_set('session.gc_maxlifetime', 2678400);
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
                 } 
71 71
                 skip:
72 72
 
73
-                if(isset($error)) { echo "<small style='color:red'>".$error."</small>"; } 
73
+                if (isset($error)) { echo "<small style='color:red'>" . $error . "</small>"; } 
74 74
             ?>
75 75
             <form method="post">
76 76
                 <input required placeholder="Username" type="text" name="username"><br>
Please login to merge, or discard this patch.