Skip to content

Commit 2236552

Browse files
authored
Log successful and failed login attempts
1 parent 713c849 commit 2236552

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

trunk/web/login.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@
118118
else
119119
echo "setTimeout('history.go(-2)',500);\n";
120120
echo "</script>";
121+
$sql="INSERT INTO `loginlog`(user_id,password,ip,time) VALUES(?,'login ok',?,NOW())";
122+
pdo_query($sql,$user_id,$ip);
121123
} else {
122124
$sql = "INSERT INTO `loginlog`(user_id,password,ip,time) VALUES(?,'login fail',?,NOW())";
123125
pdo_query($sql, $user_id, $ip);

0 commit comments

Comments
 (0)