Leaked source code of windows server 2003
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.

116 lines
2.3 KiB

  1. #pragma once
  2. #include "VarSetBase.h"
  3. //---------------------------------------------------------------------------
  4. // VarSet Security Class
  5. //---------------------------------------------------------------------------
  6. class CVarSetSecurity : public CVarSet
  7. {
  8. public:
  9. CVarSetSecurity(CVarSet& rVarSet) :
  10. CVarSet(rVarSet),
  11. m_strReplace(GET_STRING(IDS_Replace)),
  12. m_strAdd(GET_STRING(IDS_Add)),
  13. m_strRemove(GET_STRING(IDS_Remove))
  14. {
  15. }
  16. //
  17. void SetGatherInformation(bool bGather)
  18. {
  19. Put(DCTVS_Security_GatherInformation, bGather);
  20. }
  21. void SetTranslateContainers(bool bTranslate)
  22. {
  23. if (bTranslate)
  24. {
  25. Put(DCTVS_Security_TranslateContainers, true);
  26. }
  27. else
  28. {
  29. Put(DCTVS_Security_TranslateContainers, (LPCTSTR)NULL);
  30. }
  31. }
  32. void SetTranslateFiles(bool bTranslate)
  33. {
  34. Put(DCTVS_Security_TranslateFiles, bTranslate);
  35. }
  36. void SetTranslateLocalGroups(bool bTranslate)
  37. {
  38. Put(DCTVS_Security_TranslateLocalGroups, bTranslate);
  39. }
  40. void SetTranslatePrinters(bool bTranslate)
  41. {
  42. Put(DCTVS_Security_TranslatePrinters, bTranslate);
  43. }
  44. void SetTranslateRegistry(bool bTranslate)
  45. {
  46. Put(DCTVS_Security_TranslateRegistry, bTranslate);
  47. }
  48. void SetTranslateShares(bool bTranslate)
  49. {
  50. Put(DCTVS_Security_TranslateShares, bTranslate);
  51. }
  52. void SetTranslateUserProfiles(bool bTranslate)
  53. {
  54. Put(DCTVS_Security_TranslateUserProfiles, bTranslate);
  55. }
  56. void SetTranslateUserRights(bool bTranslate)
  57. {
  58. Put(DCTVS_Security_TranslateUserRights, bTranslate);
  59. }
  60. void SetTranslationOption(long lOption)
  61. {
  62. LPCTSTR pszOption;
  63. switch (lOption)
  64. {
  65. case admtTranslateReplace:
  66. pszOption = m_strReplace;
  67. break;
  68. case admtTranslateAdd:
  69. pszOption = m_strAdd;
  70. break;
  71. case admtTranslateRemove:
  72. pszOption = m_strRemove;
  73. break;
  74. default:
  75. pszOption = NULL;
  76. break;
  77. }
  78. Put(DCTVS_Security_TranslationMode, pszOption);
  79. }
  80. protected:
  81. _bstr_t m_strReplace;
  82. _bstr_t m_strAdd;
  83. _bstr_t m_strRemove;
  84. };
  85. //---------------------------------------------------------------------------
  86. // Validation Functions
  87. //---------------------------------------------------------------------------
  88. inline bool IsTranslationOptionValid(long lOption)
  89. {
  90. return ((lOption >= admtTranslateReplace) && (lOption <= admtTranslateRemove));
  91. }