]> jfr.im git - irc/unrealircd/unrealircd-webpanel.git/blobdiff - plugins/sql_auth/login.php
Move some code around, add lookup by ID and get_current_user()
[irc/unrealircd/unrealircd-webpanel.git] / plugins / sql_auth / login.php
index 294bafec78299f9ce4cd525e944a6bce879c418e..b0b0aa45735268c6f892e87c97a03177cc069ed6 100644 (file)
@@ -25,16 +25,16 @@ if (!empty($_POST))
       /* not being too informative with the login error in case of attackers */
       if (!$user->id)
       {
-          $failmsg = "Incorrect username";
+          $failmsg = "Incorrect login";
       }
-      else if (password_verify($_POST['password'], $user->passhash))
+      else if ($user->password_verify($_POST['password']))
       {
-        $_SESSION['id'] = $user->id;
-        header('Location: ' . BASE_URL);
+          $_SESSION['id'] = $user->id;
+          header('Location: ' . BASE_URL);
       }
       else
       {
-          $failmsg = "Incorrect pass";
+          $failmsg = "Incorrect login";
       }
 
   }