/[LeafOK_CVS]/lbbs/src/login.c
ViewVC logotype

Diff of /lbbs/src/login.c

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

Revision 1.35 by sysadm, Thu May 29 13:17:33 2025 UTC Revision 1.39 by sysadm, Thu Jun 5 05:24:56 2025 UTC
# Line 27  Line 27 
27  #include <errno.h>  #include <errno.h>
28  #include <ctype.h>  #include <ctype.h>
29  #include <string.h>  #include <string.h>
 #include <mysql.h>  
30  #include <regex.h>  #include <regex.h>
31  #include <stdlib.h>  #include <stdlib.h>
32  #include <unistd.h>  #include <unistd.h>
33    #include <mysql/mysql.h>
34    
35  int bbs_login(MYSQL *db)  int bbs_login(MYSQL *db)
36  {  {
37          char username[BBS_username_max_len + 1];          char username[BBS_username_max_len + 1];
38          char password[BBS_password_max_len + 1];          char password[BBS_password_max_len + 1];
39          int count = 0;          int i = 0;
40          int ok = 0;          int ok = 0;
41    
42          for (; !SYS_server_exit && !ok && count < 3; count++)          for (; !SYS_server_exit && !ok && i < BBS_login_retry_times; i++)
43          {          {
44                  prints("\033[1;33mΗλΚδΘλΥΚΊΕ\033[m(ΚΤΣΓΗλΚδΘλ`\033[1;36mguest\033[m', "                  prints("\033[1;33mΗλΚδΘλΥΚΊΕ\033[m(ΚΤΣΓΗλΚδΘλ`\033[1;36mguest\033[m', "
45                             "ΧΆ²αΗλΚδΘλ`\033[1;31mnew\033[m'): ");                             "ΧΆ²αΗλΚδΘλ`\033[1;31mnew\033[m'): ");
# Line 85  int bbs_login(MYSQL *db) Line 85  int bbs_login(MYSQL *db)
85                  return -1;                  return -1;
86          }          }
87    
88          log_std("User \"%s\"(%ld) login from %s:%d\n",          log_common("User \"%s\"(%ld) login from %s:%d\n",
89                          BBS_username, BBS_priv.uid, hostaddr_client, port_client);                             BBS_username, BBS_priv.uid, hostaddr_client, port_client);
90    
91          return 0;          return 0;
92  }  }
93    
94  int check_user(MYSQL *db, char *username, char *password)  int check_user(MYSQL *db, const char *username, const char *password)
95  {  {
96          MYSQL_RES *rs;          MYSQL_RES *rs;
97          MYSQL_ROW row;          MYSQL_ROW row;


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

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