home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 9 / IOPROG_9.ISO / contrib / iis4 / iis4_07.cab / Auth.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-09-05  |  2.0 KB  |  66 lines

  1. // Auth.h : Declaration of the CIISAuth
  2.  
  3. #ifndef __AUTH_H_
  4. #define __AUTH_H_
  5.  
  6. #include "Mtx.h"
  7. #include "asptlb.h"         // ASP symbols
  8. #include "resource.h"       // main symbols
  9.  
  10. /////////////////////////////////////////////////////////////////////////////
  11. // CIISAuth
  12. class ATL_NO_VTABLE CIISAuth : 
  13.     public CComObjectRootEx<CComMultiThreadModel>,
  14.     public CComCoClass<CIISAuth, &CLSID_Auth>,
  15.     public IDispatchImpl<IAuth, &IID_IAuth, &LIBID_NETAUTHLib>
  16. {
  17. public:
  18.     CIISAuth();
  19.     ~CIISAuth();
  20.  
  21. DECLARE_REGISTRY_RESOURCEID(IDR_AUTH)
  22.  
  23. BEGIN_COM_MAP(CIISAuth)
  24.     COM_INTERFACE_ENTRY(IAuth)
  25.     COM_INTERFACE_ENTRY(IDispatch)
  26. END_COM_MAP()
  27.  
  28. // IAuth
  29. public:
  30.     STDMETHOD(get_IsInGroup)(/*[in]*/ BSTR bstrGroupName, /*[out, retval]*/ BOOL *pfIsInGroup);
  31.     STDMETHOD(get_IsAdmin)(/*[out, retval]*/ BOOL *pfIsAdmin);
  32.     STDMETHOD(get_UsingHTTPS)(/*[out, retval]*/ BSTR *pbstrUsingHTTPS);
  33.     STDMETHOD(get_AuthMethod)(/*[out, retval]*/ BSTR *pbstrMethod);
  34.     STDMETHOD(get_Domain)(/*[out, retval]*/ BSTR *bstrDomain);
  35.     STDMETHOD(put_Username)(/*[in]*/ BSTR strUserName);
  36.     STDMETHOD(get_Username)(/*[out, retval]*/ BSTR *pstrUserName);
  37.     STDMETHOD(get__NewEnum)(/*[out, retval]*/ IUnknown** retval);
  38.  
  39. private:
  40. #    define        MAX_GROUPS 32            // Maximum number of groups a user can be in
  41.  
  42.     CComBSTR    m_bstrUserName;            // Name of the user
  43.     CComBSTR    m_bstrDomainName;        // Domain of the user
  44.     CComBSTR    m_bstrAuthMethod;        // IIS Authentication method used
  45.     CComBSTR    m_bstrHTTPS;            // Are we using HTTPS?
  46.     CComVariant m_varGroups[MAX_GROUPS];// Array of groups user belongs to
  47.  
  48.     DWORD        m_cGroups;                // # of groups user belongs to
  49.  
  50.     IRequest    *m_pRequest;            // COM Interface to ASP Request intrinsic
  51.  
  52.     // Helper functions
  53.     void        BuildGroupList();
  54.     BOOL        IsInGroup(BSTR bstrGroupName);
  55.     void        BuildUserDetails();
  56.  
  57.     HRESULT        InitInterfaces();
  58.     void        DestroyInterfaces();
  59.  
  60.     HRESULT        GetIntrinsic(IGetContextProperties *pProps, WCHAR *szName, REFIID iid, void **ppv);
  61.     HRESULT        GetCertificateDetails();
  62.     HRESULT        GetServerVariables();
  63. };
  64.  
  65. #endif //__AUTH_H_
  66.