]> jfr.im git - irc/unrealircd/unrealircd-webpanel.git/blobdiff - plugins/sql_auth/login.php
Rather large update, please see commit notes
[irc/unrealircd/unrealircd-webpanel.git] / plugins / sql_auth / login.php
index d2b598b94495869d92f110dfcb48ccfb3fdc8661..830b3e0126532f7ea7b929e84f04233310ef7d6b 100644 (file)
@@ -16,26 +16,27 @@ if (!empty($_GET['logout']))
 if (!empty($_POST))
 {
   if ($_POST['username'] && $_POST['password'])
-  {
-         
-         /* securitah */
-         security_check();
-         $user = new SQLA_User($_POST['username']);
-         
-         /* not being too informative with the login error in case of attackers */
-         if (!$user->id)
-         {
-                 $failmsg = "Incorrect login";
-         }
-         else if ($user->password_verify($_POST['password']))
-         {
-                 $_SESSION['id'] = $user->id;
-                 header('Location: ' . BASE_URL);
-         }
-         else
-         {
-                 $failmsg = "Incorrect login";
-         }
+{
+       
+       /* securitah */
+       security_check();
+       $user = new SQLA_User($_POST['username']);
+       
+       /* not being too informative with the login error in case of attackers */
+       if (!$user->id)
+       {
+               $failmsg = "Incorrect login";
+       }
+       else if ($user->password_verify($_POST['password']))
+       {
+               $_SESSION['id'] = $user->id;
+               header('Location: ' . BASE_URL);
+               $user->add_meta("last_login", date("Y-m-d m:i:s"));
+       }
+       else
+       {
+               $failmsg = "Incorrect login";
+       }
 
   }
   else