/[LeafOK_CVS]/fenglin/bbs/user_service_login.php
ViewVC logotype

Diff of /fenglin/bbs/user_service_login.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.2 by sysadm, Sun Apr 27 04:32:05 2025 UTC Revision 1.4 by sysadm, Sun Sep 28 12:28:47 2025 UTC
# Line 125  Line 125 
125    
126                  if ($row = mysqli_fetch_array($rs))                  if ($row = mysqli_fetch_array($rs))
127                  {                  {
128                          if ($row["err_count"] >= 2)                          if ($row["err_count"] >= 10)
129                          {                          {
130                                  $result_set["return"]["code"] = 1;                                  $result_set["return"]["code"] = 1;
131                                  $result_set["return"]["message"] = "来源存在多次失败登陆尝试,请输入验证码";                                  $result_set["return"]["message"] = "来源存在多次失败登陆尝试,请输入验证码";
# Line 136  Line 136 
136                  }                  }
137                  mysqli_free_result($rs);                  mysqli_free_result($rs);
138    
139                  // Failed login attempts against the current username during certain time period                  // Failed login attempts against the current username since last successful login
140                  $sql = "SELECT COUNT(*) AS err_count FROM user_err_login_log                  $sql = "SELECT COUNT(*) AS err_count FROM user_err_login_log
141                                  WHERE username = '$username' AND login_dt >= SUBDATE(NOW(), INTERVAL 1 DAY)";                                  LEFT JOIN user_list ON user_err_login_log.username = user_list.username
142                                    LEFT JOIN user_pubinfo ON user_list.UID = user_pubinfo.UID
143                                    WHERE user_err_login_log.username = '$username'
144                                    AND (user_err_login_log.login_dt >= user_pubinfo.last_login_dt
145                                    OR user_pubinfo.last_login_dt IS NULL)";
146                  $rs = mysqli_query($db_conn, $sql);                  $rs = mysqli_query($db_conn, $sql);
147                  if ($rs == false)                  if ($rs == false)
148                  {                  {
# Line 151  Line 155 
155    
156                  if ($row = mysqli_fetch_array($rs))                  if ($row = mysqli_fetch_array($rs))
157                  {                  {
158                          if ($row["err_count"] >= 5)                          if ($row["err_count"] >= 3)
159                          {                          {
160                                  $result_set["return"]["code"] = 1;                                  $result_set["return"]["code"] = 1;
161                                  $result_set["return"]["message"] = "账户存在多次失败登陆尝试,请输入验证码";                                  $result_set["return"]["message"] = "账户存在多次失败登陆尝试,请输入验证码";
# Line 385  Line 389 
389    
390          mysqli_close($db_conn);          mysqli_close($db_conn);
391          exit(json_encode($result_set));          exit(json_encode($result_set));
 ?>  


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1