| 3 |
* login |
* login |
| 4 |
* - user authentication and online status manager |
* - user authentication and online status manager |
| 5 |
* |
* |
| 6 |
* Copyright (C) 2004-2025 Leaflet <leaflet@leafok.com> |
* Copyright (C) 2004-2026 Leaflet <leaflet@leafok.com> |
| 7 |
*/ |
*/ |
| 8 |
|
|
| 9 |
#ifdef HAVE_CONFIG_H |
#ifdef HAVE_CONFIG_H |
| 46 |
|
|
| 47 |
for (i = 0; !SYS_server_exit && i < BBS_login_retry_times; i++) |
for (i = 0; !SYS_server_exit && i < BBS_login_retry_times; i++) |
| 48 |
{ |
{ |
| 49 |
|
clrtoeol(); |
| 50 |
prints("\033[1;33m请输入帐号\033[m(试用请输入`\033[1;36mguest\033[m', " |
prints("\033[1;33m请输入帐号\033[m(试用请输入`\033[1;36mguest\033[m', " |
| 51 |
"注册请输入`\033[1;31mnew\033[m'): "); |
"注册请输入`\033[1;31mnew\033[m'): "); |
| 52 |
iflush(); |
iflush(); |
| 71 |
|
|
| 72 |
if (username[0] != '\0') |
if (username[0] != '\0') |
| 73 |
{ |
{ |
| 74 |
|
clrtoeol(); |
| 75 |
prints("\033[1;37m请输入密码\033[m: "); |
prints("\033[1;37m请输入密码\033[m: "); |
| 76 |
iflush(); |
iflush(); |
| 77 |
|
|
| 395 |
tzset(); |
tzset(); |
| 396 |
} |
} |
| 397 |
|
|
|
log_common("User [%s] authenticated successfully", username); |
|
|
|
|
| 398 |
cleanup: |
cleanup: |
| 399 |
mysql_free_result(rs); |
mysql_free_result(rs); |
| 400 |
mysql_close(db); |
mysql_close(db); |