Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

179 lines
4.5 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. FPInfo.cpp : implementation file
  5. CPropertyPage support for User mgmt wizard
  6. File History:
  7. JonY Apr-96 created
  8. --*/
  9. #include "stdafx.h"
  10. #include "speckle.h"
  11. #include "wizbased.h"
  12. #include "FPInfo.h"
  13. #ifdef _DEBUG
  14. #undef THIS_FILE
  15. static char THIS_FILE[] = __FILE__;
  16. #endif
  17. /////////////////////////////////////////////////////////////////////////////
  18. // CFPInfo property page
  19. IMPLEMENT_DYNCREATE(CFPInfo, CWizBaseDlg)
  20. CFPInfo::CFPInfo() : CWizBaseDlg(CFPInfo::IDD)
  21. {
  22. //{{AFX_DATA_INIT(CFPInfo)
  23. m_nGraceLogins = 0;
  24. m_nConcurrentConnections = 0;
  25. m_csCaption = _T("");
  26. m_sAllowedGraceLogins = 6;
  27. m_sConcurrentConnections = 1;
  28. //}}AFX_DATA_INIT
  29. }
  30. CFPInfo::~CFPInfo()
  31. {
  32. }
  33. void CFPInfo::DoDataExchange(CDataExchange* pDX)
  34. {
  35. CPropertyPage::DoDataExchange(pDX);
  36. //{{AFX_DATA_MAP(CFPInfo)
  37. DDX_Control(pDX, IDC_CONCURRENT_CONNECTIONS_SPIN, m_sbConconSpin);
  38. DDX_Control(pDX, IDC_GRACE_LOGIN_SPIN, m_sbGraceLogins);
  39. DDX_Radio(pDX, IDC_GRACE_LOGIN_RADIO, m_nGraceLogins);
  40. DDX_Radio(pDX, IDC_CONCURRENT_CONNECTIONS_RADIO1, m_nConcurrentConnections);
  41. DDX_Text(pDX, IDC_STATIC1, m_csCaption);
  42. DDX_Text(pDX, IDC_ALLOWED_GRACE_LOGINS_EDIT, m_sAllowedGraceLogins);
  43. DDV_MinMaxUInt(pDX, m_sAllowedGraceLogins, 0, 200);
  44. DDX_Text(pDX, IDC_CONCURRENT_CONNECTIONS_EDIT, m_sConcurrentConnections);
  45. DDV_MinMaxUInt(pDX, m_sConcurrentConnections, 1, 1000);
  46. //}}AFX_DATA_MAP
  47. }
  48. BEGIN_MESSAGE_MAP(CFPInfo, CWizBaseDlg)
  49. //{{AFX_MSG_MAP(CFPInfo)
  50. ON_BN_CLICKED(IDC_GRACE_LOGIN_RADIO, OnGraceLoginRadio)
  51. ON_BN_CLICKED(IDC_GRACE_LOGIN_RADIO2, OnGraceLoginRadio2)
  52. ON_BN_CLICKED(IDC_CONCURRENT_CONNECTIONS_RADIO1, OnConcurrentConnectionsRadio)
  53. ON_BN_CLICKED(IDC_CONCURRENT_CONNECTIONS_RADIO2, OnConcurrentConnectionsRadio2)
  54. ON_WM_SHOWWINDOW()
  55. //}}AFX_MSG_MAP
  56. END_MESSAGE_MAP()
  57. /////////////////////////////////////////////////////////////////////////////
  58. // CFPInfo message handlers
  59. // Disable the contents of the group control
  60. void CFPInfo::OnGraceLoginRadio()
  61. {
  62. m_nGraceLogins = 0;
  63. GetDlgItem(IDC_ALLOWED_GRACE_LOGINS_EDIT)->EnableWindow(FALSE);
  64. GetDlgItem(IDC_GRACE_LOGIN_SPIN)->EnableWindow(FALSE);
  65. }
  66. // Enable the contents of the group control
  67. void CFPInfo::OnGraceLoginRadio2()
  68. {
  69. m_nGraceLogins = 1;
  70. GetDlgItem(IDC_ALLOWED_GRACE_LOGINS_EDIT)->EnableWindow(TRUE);
  71. GetDlgItem(IDC_GRACE_LOGIN_SPIN)->EnableWindow(TRUE);
  72. m_sbGraceLogins.SetRange(0,200);
  73. }
  74. BOOL CFPInfo::OnInitDialog()
  75. {
  76. CWizBaseDlg::OnInitDialog();
  77. // set group box defaults
  78. GetDlgItem(IDC_ALLOWED_GRACE_LOGINS_EDIT)->EnableWindow(FALSE);
  79. GetDlgItem(IDC_GRACE_LOGIN_SPIN)->EnableWindow(FALSE);
  80. GetDlgItem(IDC_CONCURRENT_CONNECTIONS_EDIT)->EnableWindow(FALSE);
  81. GetDlgItem(IDC_CONCURRENT_CONNECTIONS_SPIN)->EnableWindow(FALSE);
  82. return TRUE; // return TRUE unless you set the focus to a control
  83. // EXCEPTION: OCX Property Pages should return FALSE
  84. }
  85. // disable
  86. void CFPInfo::OnConcurrentConnectionsRadio()
  87. {
  88. GetDlgItem(IDC_CONCURRENT_CONNECTIONS_EDIT)->EnableWindow(FALSE);
  89. GetDlgItem(IDC_CONCURRENT_CONNECTIONS_SPIN)->EnableWindow(FALSE);
  90. }
  91. // enable
  92. void CFPInfo::OnConcurrentConnectionsRadio2()
  93. {
  94. GetDlgItem(IDC_CONCURRENT_CONNECTIONS_EDIT)->EnableWindow(TRUE);
  95. GetDlgItem(IDC_CONCURRENT_CONNECTIONS_SPIN)->EnableWindow(TRUE);
  96. m_sbConconSpin.SetRange(1, 1000);
  97. }
  98. LRESULT CFPInfo::OnWizardNext()
  99. {
  100. CSpeckleApp* pApp = (CSpeckleApp*)AfxGetApp();
  101. UpdateData(TRUE);
  102. if (m_nGraceLogins != 0) // limited
  103. {
  104. pApp->m_sNWAllowedGraceLogins = m_sAllowedGraceLogins;
  105. pApp->m_sNWRemainingGraceLogins = m_sAllowedGraceLogins;
  106. }
  107. else // unlimited
  108. {
  109. pApp->m_sNWAllowedGraceLogins = 0x6;
  110. pApp->m_sNWRemainingGraceLogins = 0xff;
  111. }
  112. if (m_nConcurrentConnections == 0) pApp->m_sNWConcurrentConnections = 0xffff;
  113. else pApp->m_sNWConcurrentConnections = m_sConcurrentConnections;
  114. if (pApp->m_bExchange) return IDD_EXCHANGE_DIALOG;
  115. else return IDD_RESTRICTIONS_DIALOG;
  116. }
  117. LRESULT CFPInfo::OnWizardBack()
  118. {
  119. CSpeckleApp* pApp = (CSpeckleApp*)AfxGetApp();
  120. if (pApp->m_bRAS) return IDD_RAS_PERM_DIALOG;
  121. else if (pApp->m_bHomeDir) return IDD_HOMEDIR_DIALOG;
  122. else if (pApp->m_bLoginScript) return IDD_LOGON_SCRIPT_DIALOG;
  123. else if (pApp->m_bProfile) return IDD_PROFILE;
  124. else return IDD_OPTIONS_DIALOG;
  125. }
  126. void CFPInfo::OnShowWindow(BOOL bShow, UINT nStatus)
  127. {
  128. CWizBaseDlg::OnShowWindow(bShow, nStatus);
  129. if (bShow)
  130. {
  131. CSpeckleApp* pApp = (CSpeckleApp*)AfxGetApp();
  132. CString csTemp;
  133. csTemp.LoadString(IDS_FPNW_CAPTION);
  134. CString csTemp2;
  135. csTemp2.Format(csTemp, pApp->m_csUserName);
  136. m_csCaption = csTemp2;
  137. UpdateData(FALSE);
  138. }
  139. }