--- lbbs/src/menu_proc.c 2025/11/04 14:58:56 1.45 +++ lbbs/src/menu_proc.c 2025/11/11 00:28:05 1.50 @@ -6,6 +6,10 @@ * Copyright (C) 2004-2025 Leaflet */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "article_cache.h" #include "article_favor_display.h" #include "article_view_log.h" @@ -18,8 +22,10 @@ #include "menu.h" #include "section_list_display.h" #include "screen.h" +#include "user_info_update.h" #include "user_list_display.h" #include "user_priv.h" +#include #include #include #include @@ -140,11 +146,19 @@ int reload_bbs_conf(void *param) int shutdown_bbs(void *param) { - log_common("Notify main process to exit\n"); + char buf[2] = "N"; + + clearscr(); + get_data(1, 1, "真的要关闭系统吗[y/N]? ", buf, sizeof(buf), 1); - if (kill(getppid(), SIGTERM) < 0) + if (toupper(buf[0]) == 'Y') { - log_error("Send SIGTERM signal failed (%d)\n", errno); + log_common("Notify main process to exit by [%s]\n", BBS_username); + + if (kill(getppid(), SIGTERM) < 0) + { + log_error("Send SIGTERM signal failed (%d)\n", errno); + } } return REDRAW; @@ -269,7 +283,7 @@ int show_top10_menu(void *param) show_top10 = 0; return 0; case KEY_TIMEOUT: - if (time(NULL) - BBS_last_access_tm >= MAX_DELAY_TIME) + if (time(NULL) - BBS_last_access_tm >= BBS_max_user_idle_time) { log_error("User input timeout\n"); show_top10 = 0; @@ -356,4 +370,14 @@ int list_online_user(void *param) } return REDRAW; +} + +int edit_intro(void *param) +{ + if (user_intro_edit(BBS_priv.uid) < 0) + { + log_error("user_intro_edit(%d) error\n", BBS_priv.uid); + } + + return REDRAW; }