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

Diff of /lbbs/src/bbs_main.c

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

Revision 1.80 by sysadm, Thu Oct 16 05:24:52 2025 UTC Revision 1.85 by sysadm, Fri Oct 17 07:07:55 2025 UTC
# Line 195  int bbs_logout(void) Line 195  int bbs_logout(void)
195    
196          display_file(DATA_GOODBYE, 1);          display_file(DATA_GOODBYE, 1);
197    
198          log_common("User logout\n");          log_common("User [%s] logout\n", BBS_username);
199    
200          return 0;          return 0;
201  }  }
# Line 219  int bbs_center() Line 219  int bbs_center()
219          {          {
220                  ch = igetch(100);                  ch = igetch(100);
221    
222                    if (ch != KEY_NULL && ch != KEY_TIMEOUT)
223                    {
224                            BBS_last_access_tm = time(NULL);
225                    }
226    
227                  if (bbs_menu.choose_step == 0 && time(NULL) - t_last_action >= 10)                  if (bbs_menu.choose_step == 0 && time(NULL) - t_last_action >= 10)
228                  {                  {
229                          t_last_action = time(NULL);                          t_last_action = time(NULL);
# Line 237  int bbs_center() Line 242  int bbs_center()
242                  switch (ch)                  switch (ch)
243                  {                  {
244                  case KEY_NULL: // broken pipe                  case KEY_NULL: // broken pipe
245                            log_error("KEY_NULL\n");
246                          return 0;                          return 0;
247                  case KEY_TIMEOUT:                  case KEY_TIMEOUT:
248                          if (time(NULL) - BBS_last_access_tm >= MAX_DELAY_TIME)                          if (time(NULL) - BBS_last_access_tm >= MAX_DELAY_TIME)
249                          {                          {
250                                    log_error("User input timeout\n");
251                                  return 0;                                  return 0;
252                          }                          }
253                          continue;                          continue;
254                  case CR:                  case CR:
                         igetch_reset();  
255                  default:                  default:
256                          switch (menu_control(&bbs_menu, ch))                          switch (menu_control(&bbs_menu, ch))
257                          {                          {
# Line 267  int bbs_center() Line 273  int bbs_center()
273                          }                          }
274                          iflush();                          iflush();
275                  }                  }
   
                 BBS_last_access_tm = time(NULL);  
276          }          }
277    
278          return 0;          return 0;
# Line 331  int bbs_main() Line 335  int bbs_main()
335          {          {
336                  prints("\033[1m%s 欢迎使用ssh方式访问 \033[1;33m按任意键继续...\033[m", BBS_username);                  prints("\033[1m%s 欢迎使用ssh方式访问 \033[1;33m按任意键继续...\033[m", BBS_username);
337                  iflush();                  iflush();
338                  igetch_t(MAX_DELAY_TIME);                  igetch_reset();
339                    while (!SYS_server_exit && igetch_t(MAX_DELAY_TIME) == 0)
340                            ;
341          }          }
342          else if (bbs_login() < 0)          else if (bbs_login() < 0)
343          {          {
344                  goto cleanup;                  goto cleanup;
345          }          }
346            log_common("User [%s] login\n", BBS_username);
347    
348          // Load article view log          // Load article view log
349          if (article_view_log_load(BBS_priv.uid, &BBS_article_view_log, 0) < 0)          if (article_view_log_load(BBS_priv.uid, &BBS_article_view_log, 0) < 0)


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

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