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.

883 lines
17 KiB

  1. /*++
  2. Copyright (c) 1994-2001 Microsoft Corporation
  3. Module Name :
  4. fvdir.cpp
  5. Abstract:
  6. FTP Virtual Directory Properties dialog
  7. Author:
  8. Ronald Meijer (ronaldm)
  9. Sergei Antonov (sergeia)
  10. Project:
  11. Internet Services Manager
  12. Revision History:
  13. --*/
  14. #include "stdafx.h"
  15. #include "common.h"
  16. #include "inetprop.h"
  17. #include "InetMgrApp.h"
  18. #include "supdlgs.h"
  19. #include "shts.h"
  20. #include "ftpsht.h"
  21. #include "fvdir.h"
  22. #include "iisobj.h"
  23. #include <lmcons.h>
  24. #ifdef _DEBUG
  25. #define new DEBUG_NEW
  26. #undef THIS_FILE
  27. static char THIS_FILE[] = __FILE__;
  28. #endif
  29. //
  30. // Directory Properties Page
  31. //
  32. // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  33. IMPLEMENT_DYNCREATE(CFtpDirectoryPage, CInetPropertyPage)
  34. CFtpDirectoryPage::CFtpDirectoryPage(
  35. IN CInetPropertySheet * pSheet,
  36. IN BOOL fHome
  37. )
  38. /*++
  39. Routine Description:
  40. Constructor for directory property page
  41. Arguments:
  42. CInetPropertySheet * pSheet : Sheet pointer
  43. BOOL fHome : TRUE if this is a home directory
  44. --*/
  45. : CInetPropertyPage(CFtpDirectoryPage::IDD, pSheet,
  46. fHome ? IDS_TAB_HOME_DIRECTORY : IDS_TAB_VIRTUAL_DIRECTORY),
  47. m_fHome(fHome),
  48. m_fOriginallyUNC(FALSE)
  49. {
  50. VERIFY(m_strPathPrompt.LoadString(IDS_PATH));
  51. VERIFY(m_strSharePrompt.LoadString(IDS_SHARE));
  52. #if 0 // Keep Class-wizard happy
  53. //{{AFX_DATA_INIT(CFtpDirectoryPage)
  54. m_nPathType = RADIO_DIRECTORY;
  55. m_nUnixDos = 0;
  56. m_fRead = FALSE;
  57. m_fWrite = FALSE;
  58. m_fLogAccess = FALSE;
  59. m_strPath = _T("");
  60. m_strDefaultDocument = _T("");
  61. m_strFooter = _T("");
  62. m_fBrowsingAllowed = FALSE;
  63. m_fEnableDefaultDocument = FALSE;
  64. m_fEnableFooter = FALSE;
  65. m_dwAccessPerms = 0;
  66. //}}AFX_DATA_INIT
  67. #endif // 0
  68. }
  69. CFtpDirectoryPage::~CFtpDirectoryPage()
  70. /*++
  71. Routine Description:
  72. Destructor
  73. Arguments:
  74. N/A
  75. Return Value:
  76. N/A
  77. --*/
  78. {
  79. }
  80. void
  81. CFtpDirectoryPage::DoDataExchange(
  82. IN CDataExchange * pDX
  83. )
  84. /*++
  85. Routine Description:
  86. Initialise/Store control Data
  87. Arguments:
  88. CDataExchange * pDX : DDX/DDV struct
  89. Return Value:
  90. None.
  91. --*/
  92. {
  93. CInetPropertyPage::DoDataExchange(pDX);
  94. //{{AFX_DATA_MAP(CFtpDirectoryPage)
  95. DDX_Check(pDX, IDC_CHECK_READ, m_fRead);
  96. DDX_Check(pDX, IDC_CHECK_WRITE, m_fWrite);
  97. DDX_Check(pDX, IDC_CHECK_LOG_ACCESS, m_fLogAccess);
  98. DDX_Control(pDX, IDC_CHECK_LOG_ACCESS, m_check_LogAccess);
  99. DDX_Control(pDX, IDC_CHECK_WRITE, m_check_Write);
  100. DDX_Control(pDX, IDC_CHECK_READ, m_check_Read);
  101. DDX_Control(pDX, IDC_BUTTON_EDIT_PATH_TYPE, m_button_AddPathType);
  102. DDX_Control(pDX, IDC_BUTTON_BROWSE, m_button_Browse);
  103. DDX_Control(pDX, IDC_EDIT_PATH, m_edit_Path);
  104. DDX_Control(pDX, IDC_RADIO_DIR, m_radio_Dir);
  105. DDX_Control(pDX, IDC_STATIC_PATH, m_static_PathPrompt);
  106. DDX_Radio(pDX, IDC_RADIO_DIR, m_nPathType);
  107. DDX_Radio(pDX, IDC_RADIO_UNIX, m_nUnixDos);
  108. //}}AFX_DATA_MAP
  109. DDX_Control(pDX, IDC_RADIO_UNC, m_radio_Unc);
  110. DDX_Text(pDX, IDC_EDIT_PATH, m_strPath);
  111. m_strPath.TrimLeft();
  112. DDV_MinMaxChars(pDX, m_strPath, 0, MAX_PATH);
  113. if (pDX->m_bSaveAndValidate)
  114. {
  115. //
  116. // Make sure a field names are correct
  117. //
  118. if (m_nPathType == RADIO_NETDIRECTORY)
  119. {
  120. DDX_Text(pDX, IDC_EDIT_PATH, m_strPath);
  121. m_strPath.TrimLeft();
  122. DDV_MinMaxChars(pDX, m_strPath, 0, MAX_PATH);
  123. if (!PathIsValid(m_strPath) || !PathIsUNC(m_strPath))
  124. {
  125. ::AfxMessageBox(IDS_BAD_UNC_PATH);
  126. pDX->Fail();
  127. }
  128. /*
  129. ISSUE: Supposedly this is not necessary...
  130. if (m_strUserName.IsEmpty())
  131. {
  132. ::AfxMessageBox(IDS_ERR_NO_USERNAME);
  133. OnButtonEditPathType();
  134. pDX->Fail();
  135. }
  136. */
  137. }
  138. else // Local Directory
  139. {
  140. ASSERT(m_nPathType == RADIO_DIRECTORY);
  141. if (!IsMasterInstance())
  142. {
  143. DDV_MinMaxChars(pDX, m_strPath, 1, MAX_PATH);
  144. }
  145. else
  146. {
  147. if (m_strPath.IsEmpty())
  148. {
  149. //
  150. // No additional validation necc. on master
  151. // instance.
  152. //
  153. return;
  154. }
  155. }
  156. if (!PathIsValid(m_strPath) || (PathIsRelative(m_strPath) && !IsDevicePath(m_strPath)))
  157. {
  158. ::AfxMessageBox(IDS_ERR_INVALID_PATH);
  159. pDX->Fail();
  160. }
  161. if (IsLocal())
  162. {
  163. DWORD dwAttr = GetFileAttributes(m_strPath);
  164. if (dwAttr == 0xffffffff || (dwAttr & FILE_ATTRIBUTE_DIRECTORY) == 0)
  165. {
  166. ::AfxMessageBox(IDS_ERR_PATH_NOT_FOUND);
  167. pDX->Fail();
  168. }
  169. }
  170. }
  171. }
  172. else
  173. {
  174. if (!IsMasterInstance())
  175. {
  176. DDV_MinMaxChars(pDX, m_strPath, 1, MAX_PATH);
  177. }
  178. }
  179. }
  180. void
  181. CFtpDirectoryPage::SetStateByType()
  182. /*++
  183. Routine Description:
  184. Set the state of the dialog by the path type currently selected
  185. Arguments:
  186. None
  187. Return Value:
  188. None
  189. --*/
  190. {
  191. switch(m_nPathType)
  192. {
  193. case RADIO_DIRECTORY:
  194. DeActivateControl(m_button_AddPathType);
  195. if (IsLocal() && !IsMasterInstance() && HasAdminAccess())
  196. {
  197. ActivateControl(m_button_Browse);
  198. }
  199. else
  200. {
  201. DeActivateControl(m_button_Browse);
  202. }
  203. m_static_PathPrompt.SetWindowText(m_strPathPrompt);
  204. break;
  205. case RADIO_NETDIRECTORY:
  206. ActivateControl(m_button_AddPathType);
  207. DeActivateControl(m_button_Browse);
  208. m_static_PathPrompt.SetWindowText(m_strSharePrompt);
  209. break;
  210. default:
  211. ASSERT(FALSE && "Invalid Selection");
  212. }
  213. }
  214. void
  215. CFtpDirectoryPage::SetPathType(
  216. IN LPCTSTR lpstrPath
  217. )
  218. /*++
  219. Routine Description:
  220. Set path type from given path
  221. Arguments:
  222. LPCTSTR lpstrPath : Path string
  223. Return Value:
  224. None
  225. --*/
  226. {
  227. if (PathIsUNC(lpstrPath))
  228. {
  229. m_nPathType = RADIO_NETDIRECTORY;
  230. m_radio_Dir.SetCheck(0);
  231. m_radio_Unc.SetCheck(1);
  232. }
  233. else
  234. {
  235. m_nPathType = RADIO_DIRECTORY;
  236. m_radio_Unc.SetCheck(0);
  237. m_radio_Dir.SetCheck(1);
  238. }
  239. SetStateByType();
  240. }
  241. //
  242. // Message Map
  243. //
  244. BEGIN_MESSAGE_MAP(CFtpDirectoryPage, CInetPropertyPage)
  245. //{{AFX_MSG_MAP(CFtpDirectoryPage)
  246. ON_BN_CLICKED(IDC_BUTTON_BROWSE, OnButtonBrowse)
  247. ON_BN_CLICKED(IDC_BUTTON_EDIT_PATH_TYPE, OnButtonEditPathType)
  248. ON_BN_CLICKED(IDC_RADIO_DIR, OnRadioDir)
  249. ON_BN_CLICKED(IDC_RADIO_UNC, OnRadioUnc)
  250. //}}AFX_MSG_MAP
  251. ON_EN_CHANGE(IDC_EDIT_PATH, OnItemChanged)
  252. ON_BN_CLICKED(IDC_CHECK_WRITE, OnItemChanged)
  253. ON_BN_CLICKED(IDC_CHECK_READ, OnItemChanged)
  254. ON_BN_CLICKED(IDC_CHECK_LOG_ACCESS, OnItemChanged)
  255. ON_BN_CLICKED(IDC_RADIO_MSDOS, OnItemChanged)
  256. ON_BN_CLICKED(IDC_RADIO_UNIX, OnItemChanged)
  257. END_MESSAGE_MAP()
  258. //
  259. // Message Handlers
  260. //
  261. // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  262. void
  263. CFtpDirectoryPage::OnItemChanged()
  264. /*++
  265. Routine Description:
  266. Handle change in data on the item
  267. Arguments:
  268. None
  269. Return Value:
  270. None
  271. --*/
  272. {
  273. SetModified(TRUE);
  274. }
  275. static int CALLBACK
  276. FileChooserCallback(HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData)
  277. {
  278. CFtpDirectoryPage * pThis = (CFtpDirectoryPage *)lpData;
  279. ASSERT(pThis != NULL);
  280. return pThis->BrowseForFolderCallback(hwnd, uMsg, lParam);
  281. }
  282. int
  283. CFtpDirectoryPage::BrowseForFolderCallback(HWND hwnd, UINT uMsg, LPARAM lParam)
  284. {
  285. switch (uMsg)
  286. {
  287. case BFFM_INITIALIZED:
  288. ASSERT(m_pPathTemp != NULL);
  289. if (::PathIsNetworkPath(m_pPathTemp))
  290. return 0;
  291. while (!::PathIsDirectory(m_pPathTemp))
  292. {
  293. if (0 == ::PathRemoveFileSpec(m_pPathTemp) && !::PathIsRoot(m_pPathTemp))
  294. {
  295. return 0;
  296. }
  297. DWORD attr = GetFileAttributes(m_pPathTemp);
  298. if ((attr & FILE_ATTRIBUTE_READONLY) == 0)
  299. break;
  300. }
  301. ::SendMessage(hwnd, BFFM_SETSELECTION, TRUE, (LPARAM)m_pPathTemp);
  302. break;
  303. case BFFM_SELCHANGED:
  304. {
  305. LPITEMIDLIST pidl = (LPITEMIDLIST)lParam;
  306. TCHAR path[MAX_PATH];
  307. if (SHGetPathFromIDList(pidl, path))
  308. {
  309. ::SendMessage(hwnd, BFFM_ENABLEOK, 0, !PathIsNetworkPath(path));
  310. }
  311. }
  312. break;
  313. case BFFM_VALIDATEFAILED:
  314. break;
  315. }
  316. return 0;
  317. }
  318. void
  319. CFtpDirectoryPage::OnButtonBrowse()
  320. /*++
  321. Routine Description:
  322. "Browse" button handler
  323. Arguments:
  324. None
  325. Return Value:
  326. None
  327. --*/
  328. {
  329. ASSERT(IsLocal());
  330. BOOL bRes = FALSE;
  331. HRESULT hr;
  332. CString str;
  333. m_edit_Path.GetWindowText(str);
  334. if (SUCCEEDED(hr = CoInitialize(NULL)))
  335. {
  336. LPITEMIDLIST pidl = NULL;
  337. if (SUCCEEDED(SHGetFolderLocation(NULL, CSIDL_DRIVES, NULL, 0, &pidl)))
  338. {
  339. LPITEMIDLIST pidList = NULL;
  340. BROWSEINFO bi;
  341. TCHAR buf[MAX_PATH];
  342. ZeroMemory(&bi, sizeof(bi));
  343. int drive = PathGetDriveNumber(str);
  344. if (GetDriveType(PathBuildRoot(buf, drive)) == DRIVE_FIXED)
  345. {
  346. StrCpy(buf, str);
  347. }
  348. else
  349. {
  350. buf[0] = 0;
  351. }
  352. m_strBrowseTitle.LoadString(m_fHome ?
  353. IDS_TAB_HOME_DIRECTORY : IDS_TAB_VIRTUAL_DIRECTORY);
  354. bi.hwndOwner = m_hWnd;
  355. bi.pidlRoot = pidl;
  356. bi.pszDisplayName = m_pPathTemp = buf;
  357. bi.lpszTitle = m_strBrowseTitle;
  358. bi.ulFlags |= BIF_NEWDIALOGSTYLE | BIF_RETURNONLYFSDIRS/* | BIF_EDITBOX*/;
  359. bi.lpfn = FileChooserCallback;
  360. bi.lParam = (LPARAM)this;
  361. pidList = SHBrowseForFolder(&bi);
  362. if ( pidList != NULL
  363. && SHGetPathFromIDList(pidList, buf)
  364. )
  365. {
  366. str = buf;
  367. bRes = TRUE;
  368. }
  369. IMalloc * pMalloc;
  370. VERIFY(SUCCEEDED(SHGetMalloc(&pMalloc)));
  371. if (pidl != NULL)
  372. pMalloc->Free(pidl);
  373. pMalloc->Release();
  374. }
  375. CoUninitialize();
  376. }
  377. if (bRes)
  378. {
  379. m_strPath = str;
  380. m_edit_Path.SetWindowText(str);
  381. SetPathType(m_strPath);
  382. OnItemChanged();
  383. }
  384. }
  385. BOOL
  386. CFtpDirectoryPage::OnInitDialog()
  387. /*++
  388. Routine Description:
  389. WM_INITDIALOG handler. Initialize the dialog.
  390. Arguments:
  391. None.
  392. Return Value:
  393. TRUE if no focus is to be set automatically, FALSE if the focus
  394. is already set.
  395. --*/
  396. {
  397. CInetPropertyPage::OnInitDialog();
  398. m_button_Browse.EnableWindow(
  399. IsLocal()
  400. && !IsMasterInstance()
  401. && HasAdminAccess());
  402. SetPathType(m_strPath);
  403. //
  404. // Directory listing style dependent on whether or not
  405. // this is a home directory
  406. //
  407. ActivateControl(*GetDlgItem(IDC_STATIC_DIRLISTING), m_fHome);
  408. ActivateControl(*GetDlgItem(IDC_RADIO_UNIX), m_fHome);
  409. ActivateControl(*GetDlgItem(IDC_RADIO_MSDOS), m_fHome);
  410. //
  411. // Some items not available on master instance
  412. //
  413. GetDlgItem(IDC_STATIC_PATH_TYPE)->EnableWindow(!IsMasterInstance());
  414. GetDlgItem(IDC_RADIO_DIR)->EnableWindow(
  415. !IsMasterInstance() && HasAdminAccess());
  416. GetDlgItem(IDC_RADIO_UNC)->EnableWindow(
  417. !IsMasterInstance() && HasAdminAccess());
  418. GetDlgItem(IDC_STATIC_PATH)->EnableWindow(
  419. !IsMasterInstance());
  420. GetDlgItem(IDC_EDIT_PATH)->EnableWindow(
  421. !IsMasterInstance() && HasAdminAccess());
  422. GetDlgItem(IDC_BUTTON_EDIT_PATH_TYPE)->EnableWindow(
  423. !IsMasterInstance() && HasAdminAccess());
  424. m_check_Write.EnableWindow(HasAdminAccess());
  425. m_check_Read.EnableWindow(HasAdminAccess());
  426. //
  427. // Store the original value of fUNC of reference later when
  428. // saving out --BoydM
  429. //
  430. m_fOriginallyUNC = (m_nPathType == RADIO_NETDIRECTORY);
  431. return TRUE;
  432. }
  433. void
  434. CFtpDirectoryPage::ChangeTypeTo(
  435. IN int nNewType
  436. )
  437. /*++
  438. Routine Description
  439. Change the directory type
  440. Arguments:
  441. int nNewType : New radio value
  442. Return Value:
  443. None
  444. --*/
  445. {
  446. int nOldType = m_nPathType;
  447. m_nPathType = nNewType;
  448. if (nOldType == m_nPathType)
  449. {
  450. //
  451. // No change
  452. //
  453. return;
  454. }
  455. OnItemChanged();
  456. SetStateByType();
  457. LPCTSTR lpKeepPath = NULL;
  458. int nID = -1;
  459. switch(m_nPathType)
  460. {
  461. case RADIO_DIRECTORY:
  462. if (!PathIsUNC(m_strPath)
  463. && (!PathIsRelative(m_strPath) || IsDevicePath(m_strPath)))
  464. {
  465. //
  466. // The old path info is acceptable, propose it
  467. // as a default
  468. //
  469. lpKeepPath = m_strPath;
  470. }
  471. nID = IDS_DIRECTORY_MASK;
  472. break;
  473. case RADIO_NETDIRECTORY:
  474. if (PathIsUNC(m_strPath))
  475. {
  476. //
  477. // The old path info is acceptable, propose it
  478. // as a default
  479. //
  480. lpKeepPath = m_strPath;
  481. }
  482. nID = IDS_UNC_MASK;
  483. break;
  484. }
  485. if (lpKeepPath != NULL)
  486. {
  487. //
  488. // Restore the old path
  489. //
  490. m_edit_Path.SetWindowText(lpKeepPath);
  491. }
  492. else
  493. {
  494. //
  495. // Load mask resource, and display
  496. // this in the directory
  497. //
  498. CString str;
  499. VERIFY(str.LoadString(nID));
  500. m_edit_Path.SetWindowText(str);
  501. }
  502. m_edit_Path.SetSel(0,-1);
  503. m_edit_Path.SetFocus();
  504. }
  505. void
  506. CFtpDirectoryPage::OnRadioDir()
  507. /*++
  508. Routine Description:
  509. 'directory' radio button handler
  510. Arguments:
  511. None
  512. Return Value:
  513. None.
  514. --*/
  515. {
  516. ChangeTypeTo(RADIO_DIRECTORY);
  517. }
  518. void
  519. CFtpDirectoryPage::OnRadioUnc()
  520. /*++
  521. Routine Description:
  522. 'network directory' radio button handler
  523. Arguments:
  524. None
  525. Return Value:
  526. None.
  527. --*/
  528. {
  529. ChangeTypeTo(RADIO_NETDIRECTORY);
  530. }
  531. /* virtual */
  532. HRESULT
  533. CFtpDirectoryPage::FetchLoadedValues()
  534. /*++
  535. Routine Description:
  536. Move configuration data from sheet to dialog controls
  537. Arguments:
  538. None
  539. Return Value:
  540. HRESULT
  541. --*/
  542. {
  543. CError err;
  544. BEGIN_META_DIR_READ(CFtpSheet)
  545. //
  546. // Use 'm_' notation because the message crackers require it.
  547. //
  548. BOOL m_fDontLog;
  549. FETCH_DIR_DATA_FROM_SHEET(m_strAlias);
  550. FETCH_DIR_DATA_FROM_SHEET(m_strUserName);
  551. FETCH_DIR_DATA_FROM_SHEET(m_strPassword);
  552. FETCH_DIR_DATA_FROM_SHEET(m_strPath);
  553. FETCH_DIR_DATA_FROM_SHEET(m_dwAccessPerms);
  554. FETCH_DIR_DATA_FROM_SHEET(m_fDontLog);
  555. m_fRead = IS_FLAG_SET(m_dwAccessPerms, MD_ACCESS_READ);
  556. m_fWrite = IS_FLAG_SET(m_dwAccessPerms, MD_ACCESS_WRITE);
  557. m_fLogAccess = !m_fDontLog;
  558. END_META_DIR_READ(err)
  559. BEGIN_META_INST_READ(CFtpSheet)
  560. BOOL m_fDosDirOutput;
  561. FETCH_INST_DATA_FROM_SHEET(m_fDosDirOutput);
  562. m_nUnixDos = m_fDosDirOutput ? RADIO_DOS : RADIO_UNIX;
  563. END_META_INST_READ(err)
  564. m_nPathType = PathIsUNC(m_strPath) ?
  565. RADIO_NETDIRECTORY : RADIO_DIRECTORY;
  566. //
  567. // Make sure we were passed the right home directory
  568. // flag
  569. //
  570. ASSERT(IsMasterInstance()
  571. || (m_fHome && !::lstrcmp(m_strAlias, g_cszRoot))
  572. || (!m_fHome && ::lstrcmp(m_strAlias, g_cszRoot))
  573. );
  574. return err;
  575. }
  576. /* virtual */
  577. HRESULT
  578. CFtpDirectoryPage::SaveInfo()
  579. /*++
  580. Routine Description:
  581. Save the information on this property page
  582. Arguments:
  583. None
  584. Return Value:
  585. Error return code
  586. --*/
  587. {
  588. ASSERT(IsDirty());
  589. TRACEEOLID("Saving FTP virtual directory page now...");
  590. CError err;
  591. SET_FLAG_IF(m_fRead, m_dwAccessPerms, MD_ACCESS_READ);
  592. SET_FLAG_IF(m_fWrite, m_dwAccessPerms, MD_ACCESS_WRITE);
  593. //
  594. // Use m_ notation because the message crackers require them
  595. //
  596. BOOL m_fDontLog = !m_fLogAccess;
  597. BOOL m_fDosDirOutput = (m_nUnixDos == RADIO_DOS);
  598. BOOL fUNC = (m_nPathType == RADIO_NETDIRECTORY);
  599. // BOOL fUserNameWritten = FALSE;
  600. BeginWaitCursor();
  601. BEGIN_META_DIR_WRITE(CFtpSheet)
  602. if (fUNC)
  603. {
  604. // STORE_DIR_DATA_ON_SHEET_REMEMBER(m_strUserName, fUserNameWritten)
  605. // if (fUserNameWritten)
  606. // {
  607. STORE_DIR_DATA_ON_SHEET(m_strUserName);
  608. STORE_DIR_DATA_ON_SHEET(m_strPassword);
  609. // }
  610. }
  611. else
  612. {
  613. if (m_fOriginallyUNC)
  614. {
  615. FLAG_DIR_DATA_FOR_DELETION(MD_VR_USERNAME);
  616. FLAG_DIR_DATA_FOR_DELETION(MD_VR_PASSWORD);
  617. }
  618. }
  619. STORE_DIR_DATA_ON_SHEET(m_dwAccessPerms)
  620. STORE_DIR_DATA_ON_SHEET(m_fDontLog)
  621. STORE_DIR_DATA_ON_SHEET(m_strPath)
  622. END_META_DIR_WRITE(err)
  623. if (err.Succeeded())
  624. {
  625. BEGIN_META_INST_WRITE(CFtpSheet)
  626. STORE_INST_DATA_ON_SHEET(m_fDosDirOutput);
  627. END_META_INST_WRITE(err)
  628. }
  629. if (err.Succeeded())
  630. {
  631. NotifyMMC();
  632. }
  633. EndWaitCursor();
  634. return err;
  635. }
  636. void
  637. CFtpDirectoryPage::OnButtonEditPathType()
  638. /*++
  639. Routine Description:
  640. 'Connect As..." button handler
  641. Arguments:
  642. None
  643. Return Value:
  644. None
  645. --*/
  646. {
  647. AFX_MANAGE_STATE(::AfxGetStaticModuleState());
  648. CUserAccountDlg dlg(
  649. QueryServerName(),
  650. m_strUserName,
  651. m_strPassword,
  652. this
  653. );
  654. if (dlg.DoModal() == IDOK)
  655. {
  656. m_strUserName = dlg.m_strUserName;
  657. m_strPassword = dlg.m_strPassword;
  658. OnItemChanged();
  659. }
  660. }