Ignore:
Timestamp:
2009-04-22T22:32:44+12:00 (15 years ago)
Author:
davidb
Message:

Local Library Server can now either be configured to connects from anywhere or be restricted to only allow local connections. The option is controlled by setting 'externalaccess' to 1 or 0 appropriately. A widget for this is provided under File/Settings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/runtime-src/src/w32server/settings.cpp

    r19015 r19210  
    6161// general settings
    6262int gsdl_port_num = 80;
     63int gsdl_external_access = 0;
    6364int gsdl_auto_enter = 0;
    6465int gsdl_browser = GS_DEFAULT;
     
    310311   
    311312    write_ini_line(fout, "portnumber", text_t(gsdl_port_num));
     313    write_ini_line(fout, "externalaccess", text_t(gsdl_external_access));
    312314    write_ini_line(fout, "autoenter", text_t(gsdl_auto_enter));
    313315    write_ini_line(fout, "browser", text_t(gsdl_browser));
     
    402404  // general settings
    403405  gsdl_port_num = 80;
     406  gsdl_external_access = 0;
    404407  gsdl_auto_enter = 0;
    405408  gsdl_start_browser = 1;
     
    464467      } else if (key == "portnumber") {
    465468        gsdl_port_num = value.getint();
     469
     470      } else if (key == "externalaccess") {
     471        gsdl_external_access = value.getint();
    466472       
    467473      } else if (key == "autoenter") {
     
    636642  gsdl_port_num = GetDlgItemInt(hwndDlg, SERVER_PORT_EDIT_BOX, &bres, 0);
    637643  if (!bres) gsdl_port_num = 80;
    638  
     644
     645  // whether to allow external access or not
     646  res = SendDlgItemMessage(hwndDlg, ID_EXTERNAL_ACCESS, BM_GETCHECK, 0, 0);
     647  gsdl_external_access = (res == 1);
     648   
    639649  // whether to enter the library automatically on startup
    640650  res = SendDlgItemMessage(hwndDlg, ID_AUTO_ENTER_LIBRARY, BM_GETCHECK, 0, 0);
    641651  gsdl_auto_enter = (res == 1);
    642  
     652
    643653  // which browser to use
    644654  gsdl_browser = read_dialog_browser_field (hwndDlg);
     
    666676    // set current values
    667677    SetDlgItemInt(hwndDlg, SERVER_PORT_EDIT_BOX, gsdl_port_num, FALSE);
     678    SendDlgItemMessage(hwndDlg, ID_EXTERNAL_ACCESS, BM_SETCHECK,
     679               gsdl_external_access ? 1 : 0, 0);
    668680    SendDlgItemMessage(hwndDlg, ID_AUTO_ENTER_LIBRARY, BM_SETCHECK,
    669681               gsdl_auto_enter ? 1 : 0, 0);
     
    877889  int old_gsdl_show_console = gsdl_show_console;
    878890  int old_gsdl_port_num = gsdl_port_num;
     891  int old_gsdl_external_access = gsdl_external_access;
    879892 
    880893  int res = 0;
     
    912925    if (res == 1) {
    913926      // only update if exited via the OK button
    914       if (gsdl_port_num != old_gsdl_port_num) {
     927      if ((gsdl_port_num != old_gsdl_port_num)
     928      || (gsdl_external_access != old_gsdl_external_access)) {
    915929    EndHTTPServer();
    916930    StartHTTPServer(window);
Note: See TracChangeset for help on using the changeset viewer.