home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 217 / DPCS0306DVD.ISO / Toolkit / Internet / FileZilla / Server / FileZilla_Server-0.9.11.exe / source / Accounts.h < prev    next >
Encoding:
C/C++ Source or Header  |  2005-08-29  |  1.8 KB  |  87 lines

  1. #ifndef ACCOUNTS_H_INCLUDED
  2. #define ACCOUNTS_H_INCLUDED
  3.  
  4. #ifndef _AFX
  5. #define CString CStdString
  6. #endif //_AFX
  7.  
  8. #include "SpeedLimit.h"
  9.  
  10. class t_directory
  11. {
  12. public:
  13.     t_directory();
  14.     CString dir;
  15.     std::list<CString> aliases;
  16.     BOOL bFileRead, bFileWrite, bFileDelete, bFileAppend;
  17.     BOOL bDirCreate, bDirDelete, bDirList, bDirSubdirs, bIsHome;
  18.     BOOL bAutoCreate;
  19. };
  20.  
  21. enum sltype
  22. {
  23.     download = 0,
  24.     upload = 1
  25. };
  26.  
  27. class t_group
  28. {
  29. public:
  30.     t_group();
  31.  
  32.     virtual int GetRequiredBufferLen() const;
  33.     virtual char * FillBuffer(char *p) const;
  34.     virtual unsigned char * ParseBuffer(unsigned char *pBuffer, int length);
  35.  
  36.     virtual bool BypassUserLimit() const;
  37.     virtual int GetUserLimit() const;
  38.     virtual int GetIpLimit() const;
  39.     virtual bool IsEnabled() const;
  40.     virtual bool ForceSsl() const;
  41.  
  42.     virtual int GetCurrentSpeedLimit(sltype type) const;
  43.     virtual bool BypassServerSpeedLimit(sltype type) const;
  44.  
  45.     bool AccessAllowed(SOCKADDR_IN sockAddr) const;
  46.  
  47.     virtual t_group& t_group::operator=(const t_group &a);
  48.  
  49.     CString group;
  50.     std::vector<t_directory> permissions;
  51.     int nBypassUserLimit;
  52.     int nUserLimit, nIpLimit;
  53.     int nEnabled;
  54.     int forceSsl;
  55.  
  56.     int nSpeedLimitType[2];
  57.     int nSpeedLimit[2];
  58.     SPEEDLIMITSLIST SpeedLimits[2];
  59.     int nBypassServerSpeedLimit[2];
  60.     
  61.     std::list<CString> allowedIPs, disallowedIPs;
  62.  
  63.     CString comment;
  64.  
  65.     t_group *pOwner;
  66.  
  67. protected:
  68.     bool ParseString(const unsigned char* endMarker, unsigned char *&p, CString &string);
  69. };
  70.  
  71. class t_user : public t_group
  72. {
  73. public:
  74.     t_user();
  75.  
  76.     virtual int GetRequiredBufferLen() const;
  77.     virtual char * FillBuffer(char *p) const;
  78.     virtual unsigned char * ParseBuffer(unsigned char *pBuffer, int length);
  79.  
  80.     virtual t_user& t_user::operator=(const t_user &a);
  81.  
  82.     CString user;
  83.     CString password;
  84. };
  85.  
  86. #endif //#define ACCOUNTS_H_INCLUDED
  87.