📄 waruserhandle.h
字号:
/** This object is used by server applications that need auth-info and user-properties for logged-in user (in that server implementation). The WarUserHandle provides the server with all requiered information, and hides the actual user database and auth-method from the server. Each instance of a WarUserHandle typically represent one logged-in user.*/#ifndef WAR_USER_HANDLE_H#define WAR_USER_HANDLE_H/* SYSTEM INCLUDES *//* PROJECT INCLUDES */#ifndef WAR_SMART_POINTER_H# include "WarSmartPointer.h"#endif#ifndef WAR_SVR_ENUMS_H# include "WarSvrEnums.h"#endif#ifndef WAR_SVR_PATH_H# include "WarSvrPath.h"#endif#ifndef WAR_SVR_FILE_H# include "WarSvrFile.h"#endif#ifndef WAR_SVR_PROPERTIES_H# include "WarSvrProperties.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 WarUserHandle : public WarSmartPointer, public WarSvrEnums{public: // LIFECYCLE /** * Default constructor. */ WarUserHandle(void); // OPERATORS // OPERATIONS /** Change the current working dirtectory for a logged in user. @Param Path Directory to change to. The user must have access to the directoy, and it must exist. If the ditrectory is empty, ChDir will attempt to change to the users 'home'- directory or the root directory if home can't be found. @Exception WarException on error */ virtual void ChDir(const war_svrpath_t& Path); /** Session login. If username is NULL, anonymous login is attempted. The default implementation does only handle system accounts and anonymous logins. You can use \Ref{AllowSysuser()} and \Ref{AllowAnonymous()} to allow or disallow anonymous access or system users. @Param Host Virtual host to use. Currently most useful for the HTTP protocol. Most FTP clienst will not attempt to login to a virtual host. @Param UserName Login name. Use NULL for the anonymous user. @Param Password @Return LF_OK if the login was successful. */ virtual WarLoginResultE Login( war_ccstr_t Host = NULL, war_ccstr_t UserName = NULL, war_ccstr_t Passwd = NULL); /** Creates a WarSvrFile object from a relative server path. The file object is not opened. Security on the path-level is performed. @param SvrPath The logical (aliased) path to use @param pParsedPath An optional path where the parsed alias path is returned to. A parsed path is a path where ../ elements and links are resolved. The parsed path is also always a full path from root (/). @return A WarSvrFile object. The paths are expanded to the full path to the file or directory. @exception WarExcetption on error, or if the path could not be found. */ virtual WarSvrFile CreateWarFile(const war_svrpath_t& SvrPath, war_svrpath_t *pParsedPath = NULL) const; // ACCESS /// Get the full set of properties owned by the user virtual const WarSvrProperties& GetProperties() const { return mProperties; } // INQUIRY /// virtual bool IsLoggedIn() const; /** Get the login name. This may or may not be the same as the name passed to Login. @Exception WarException on fatal errocs, such as not logged in. */ virtual const std::string& GetName() const; /** Return the current working directory @param bEndWithSlash If true, the path is guaranteed to end with a WAR_SLASH. Else, the path may or may not end with a WAR_SLASH. */ virtual const war_svrpath_t GetCwd(bool bEndWithSlash = false) const;protected: ~WarUserHandle(void); WarSvrProperties mProperties;private:};/* INLINE METHODS *//* EXTERNAL REFERENCES */typedef WarPtrWrapper<WarUserHandle> war_userhandle_ptr_t;#endif /* __cplusplus *//****************** END C++ spesific ******************/#endif /* WAR_USER_HANDLE_H_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -