| 21 |
#include "login.h" |
#include "login.h" |
| 22 |
#include "user_priv.h" |
#include "user_priv.h" |
| 23 |
#include "common.h" |
#include "common.h" |
| 24 |
|
#include "database.h" |
| 25 |
#include "log.h" |
#include "log.h" |
| 26 |
#include "io.h" |
#include "io.h" |
| 27 |
#include "screen.h" |
#include "screen.h" |
| 43 |
|
|
| 44 |
int bbs_exit() |
int bbs_exit() |
| 45 |
{ |
{ |
| 46 |
char temp[256]; |
display_file_ex(DATA_GOODBYE, 1, 0); |
|
|
|
|
strcpy(temp, app_home_dir); |
|
|
strcat(temp, "data/goodbye.txt"); |
|
|
display_file_ex(temp, 1, 0); |
|
| 47 |
|
|
| 48 |
sleep(1); |
sleep(1); |
| 49 |
|
|
| 52 |
|
|
| 53 |
int bbs_center() |
int bbs_center() |
| 54 |
{ |
{ |
| 55 |
int ch, result, redraw; |
int ch, redraw; |
|
char temp[256]; |
|
| 56 |
time_t t_last_action; |
time_t t_last_action; |
| 57 |
|
|
| 58 |
BBS_last_access_tm = t_last_action = time(0); |
BBS_last_access_tm = t_last_action = time(0); |
| 116 |
|
|
| 117 |
int bbs_main() |
int bbs_main() |
| 118 |
{ |
{ |
|
char temp[256]; |
|
| 119 |
int ret; |
int ret; |
| 120 |
|
|
| 121 |
set_input_echo(0); |
set_input_echo(0); |
| 134 |
clearscr(); |
clearscr(); |
| 135 |
|
|
| 136 |
// BBS Top 10 |
// BBS Top 10 |
| 137 |
strcpy(temp, app_home_dir); |
display_file_ex("./var/bbs_top.txt", 1, 1); |
|
strcat(temp, "var/bbs_top.txt"); |
|
|
display_file_ex(temp, 1, 1); |
|
| 138 |
|
|
| 139 |
// Main |
// Main |
| 140 |
bbs_center(); |
bbs_center(); |
| 143 |
bbs_exit(); |
bbs_exit(); |
| 144 |
log_std("User logout\n"); |
log_std("User logout\n"); |
| 145 |
|
|
| 146 |
|
MYSQL *db = db_open(); |
| 147 |
|
if (db == NULL) |
| 148 |
|
{ |
| 149 |
|
return -1; |
| 150 |
|
} |
| 151 |
|
|
| 152 |
|
user_online_del(db); |
| 153 |
|
|
| 154 |
|
mysql_close(db); |
| 155 |
|
|
| 156 |
return 0; |
return 0; |
| 157 |
} |
} |