📄 waruserauthwin32nt.h
字号:
/** This is the implementation of user authentication trough Windows NT. This authentication scheme leaves very limited options on the user handles, and are primarily designed to do basic authentication of normal user accounte on NT machine.*/#ifndef WAR_USER_AUTH_WIN32_NT_H#define WAR_USER_AUTH_WIN32_NT_H/* SYSTEM INCLUDES */#include <Lm.h>/* PROJECT INCLUDES */#ifndef WAR_USER_AUTH_H# include "WarUserAuth.h"#endif#ifndef WAR_WIN32_REGISTRY_H# include "WarWin32Registry.h"#endif#ifndef WAR_USER_AUTHDATA_WIN32_NT_H# include "WarUserAuthDataWin32Nt.h"#endif/* LOCAL INCLUDES *//* FORWARD REFERENCES */#ifdef __cplusplusextern "C" {#endif/****************** BEGIN OLD STYLE C spesific ********//****************** END OLD STYLE C spesific **********/#ifdef __cplusplus }#endif/****************** BEGIN C++ spesific ****************/#ifdef __cplusplusclass WarUserAuthWin32Nt : public WarUserAuth{public: typedef WarCollector<wchar_t> netstr_t; typedef WarPtrWrapper<WarUserAuthDataWin32Nt> user_data_ptr_t; // LIFECYCLE /* * Default constructor. */ WarUserAuthWin32Nt(); /** * Destructor. */ ~WarUserAuthWin32Nt(); // OPERATORS // OPERATIONS /** Creats an instance of the authentication * module for NT users. * * @param regRoot The root path to the registry * value for this instance of the module. * This path must exist and must be initialized. * @exception WarException on error */ void Create(const WarWin32Registry& regKey, const bool doValidateGroup = true) throw(WarException); virtual WarLoginResultE Login( WarSvrProtocol& fromServer, war_ccsysstr_t virtualHost, war_ccsysstr_t userName, war_ccsysstr_t userPasswd, war_authdata_ptr_t& authDataPtr, bool &isAuthorative); void SetUsingLocalMachine(const bool doSet) throw(WarException); void SetAnonNeedEmailAsPasswd(const bool doSet) throw(WarException); void SetAuthServer(const netstr_t& strName) throw(WarException); void SetAuthGroup(const netstr_t& strName) throw(WarException); void SetAnonUser(const netstr_t& strName) throw(WarException); void SetAnonPasswd(const netstr_t& strName) throw(WarException); virtual void SetEnableAnon(const bool doEnable = true) throw(WarException); virtual void CreateUser(war_ccsysstr_t userName, war_ccsysstr_t userPasswd, const bool doEnable = false) throw(WarException); virtual void DeleteUser(war_ccsysstr_t userName) throw(WarException); virtual void DeleteGroup(war_ccsysstr_t groupName) throw(WarException); virtual void CreateGroup(war_ccsysstr_t groupName) throw(WarException); virtual void AddUserToGroup(war_ccsysstr_t userName, war_ccsysstr_t groupName) throw(WarException); virtual void RemoveUserFromGroup(war_ccsysstr_t userName, war_ccsysstr_t groupName) throw(WarException); void ValidateAndFixGroup(const netstr_t& groupName) throw(WarException); void ValidateAndCheckAnonUser(); // LSA functions // ACCESS // INQUIRY virtual void EnumerateUsers(user_set_t& outList) throw(WarException); netstr_t GetAuthServer() const; netstr_t GetAuthGroup() const; netstr_t GetAnonUser() const; netstr_t GetAnonPasswd() const; bool IsUsingLocalMachine() const; bool IsAnonEmailReqiered() const; virtual bool IsAnonSupported() const {return true;} virtual bool IsAnonAllowed() const; virtual bool CanCreateUser() const {return true; } virtual bool CanDeleteUser() const {return true; } virtual bool CanCreateGroup() const {return true; } virtual bool CanDeleteGroup() const {return true; } virtual bool CanAddUserToGroup() const {return true; } virtual bool CanRemoveUserFromGroup() const {return true; } WarError MapErrorCode(NET_API_STATUS status); static bool HaveLocalUser(war_ccsysstr_t userName); static bool HaveLocalGroup(war_ccsysstr_t groupName);protected: user_data_ptr_t CreateDataHandle(PSID, war_ccsysstr_t userName, HANDLE loginHandle = NULL, bool isAnonymous = false) throw(WarException); WarWin32Registry mRegRoot;private:};/* INLINE METHODS *//* EXTERNAL REFERENCES */typedef WarPtrWrapper<WarUserAuthWin32Nt> war_user_auth_win32_nt_ptr_t;#endif /* __cplusplus *//****************** END C++ spesific ******************/#endif /* WAR_USER_AUTH_WIN32_NT_H_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -