17 #ifndef ZNC_WEBMODULES_H
18 #define ZNC_WEBMODULES_H
20 #include <znc/zncconfig.h>
79 time_t m_tmLastActive;
85 unsigned int uFlags = 0)
86 : m_uFlags(uFlags), m_sName(sName), m_Title(sTitle), m_vParams() {}
89 const VPair& vParams,
unsigned int uFlags = 0)
104 m_vParams.push_back(make_pair(sName, sValue));
114 unsigned int m_uFlags;
142 bool bBasic)
override;
184 std::shared_ptr<CAuthBase> m_spAuth;
188 std::shared_ptr<CWebSession> m_spSession;
190 static const unsigned int m_uiMaxSessions;
std::vector< TWebSubPage > VWebSubPages
Definition: WebModules.h:33
std::shared_ptr< CWebSubPage > TWebSubPage
Definition: WebModules.h:30
std::vector< std::pair< CString, CString > > VPair
Definition: ZNCString.h:39
std::vector< CString > VCString
Definition: ZNCString.h:38
Definition: HTTPSock.h:26
bool PrintErrorPage(unsigned int uStatusId, const CString &sStatusMsg, const CString &sMessage)
The base class for your own ZNC modules.
Definition: Modules.h:420
Definition: Translation.h:85
CString Resolve() const
Definition: Translation.h:90
String class that is used inside ZNC.
Definition: ZNCString.h:68
Definition: Template.h:28
Definition: Template.h:129
Definition: WebModules.h:120
void FinishUserSessions(const CUser &User)
CWebSessionMap(unsigned int uTTL=5000)
Definition: WebModules.h:122
Definition: WebModules.h:47
CWebSession & operator=(const CWebSession &)=delete
size_t AddError(const CString &sMessage)
size_t AddSuccess(const CString &sMessage)
CWebSession(const CWebSession &)=delete
const CString & GetId() const
Definition: WebModules.h:55
void FillMessageLoops(CTemplate &Tmpl)
CUser * SetUser(CUser *p)
Definition: WebModules.h:63
CUser * GetUser() const
Definition: WebModules.h:57
CWebSession(const CString &sId, const CString &sIP)
time_t GetLastActive() const
Definition: WebModules.h:58
const CString & GetIP() const
Definition: WebModules.h:56
bool IsLoggedIn() const
Definition: WebModules.h:59
Definition: WebModules.h:127
bool ForceLogin() override
bool SendCookie(const CString &sKey, const CString &sValue)
CString GetRequestCookie(const CString &sKey)
EPageReqResult PrintTemplate(const CString &sPageName, CString &sPageRet, CModule *pModule=nullptr)
void SetPaths(CModule *pModule, bool bIsTemplate=false)
CWebSock(const CString &sURIPrefix)
std::shared_ptr< CWebSession > GetSession()
void PrintErrorPage(const CString &sMessage)
bool ValidateCSRFCheck(const CString &sURI)
bool OnLogin(const CString &sUser, const CString &sPass, bool bBasic) override
CString FindTmpl(CModule *pModule, const CString &sName)
static CString GetSkinPath(const CString &sSkinName)
Csock * GetSockObj(const CString &sHost, unsigned short uPort) override
EPageReqResult
Definition: WebModules.h:129
@ PAGE_NOTFOUND
Definition: WebModules.h:130
@ PAGE_DONE
Definition: WebModules.h:134
@ PAGE_PRINT
Definition: WebModules.h:131
@ PAGE_DEFERRED
Definition: WebModules.h:132
bool AddModLoop(const CString &sLoopName, CModule &Module, CTemplate *pTemplate=nullptr)
VCString GetDirs(CModule *pModule, bool bIsTemplate)
static void FinishUserSessions(const CUser &User)
EPageReqResult PrintStaticFile(const CString &sPath, CString &sPageRet, CModule *pModule=nullptr)
void OnPageRequest(const CString &sURI) override
void GetAvailSkins(VCString &vRet) const
Definition: WebModules.h:82
CString GetTitle() const
Definition: WebModules.h:110
virtual ~CWebSubPage()
Definition: WebModules.h:95
@ F_ADMIN
Definition: WebModules.h:97
const VPair & GetParams() const
Definition: WebModules.h:111
CWebSubPage(const CString &sName, const CString &sTitle="", unsigned int uFlags=0)
Definition: WebModules.h:84
const CString & GetName() const
Definition: WebModules.h:109
CWebSubPage(const CString &sName, const COptionalTranslation &Title, const VPair &vParams, unsigned int uFlags=0)
Definition: WebModules.h:88
bool RequiresAdmin() const
Definition: WebModules.h:107
void SetTitle(const COptionalTranslation &s)
Definition: WebModules.h:100
void SetName(const CString &s)
Definition: WebModules.h:99
void AddParam(const CString &sName, const CString &sValue)
Definition: WebModules.h:103
Definition: WebModules.h:35
virtual ~CZNCTagHandler()
Definition: WebModules.h:38
CZNCTagHandler(CWebSock &pWebSock)
bool HandleTag(CTemplate &Tmpl, const CString &sName, const CString &sArgs, CString &sOutput) override
Basic socket class.
Definition: Csocket.h:564
Insert an object with a time-to-live and check later if it still exists.
Definition: Utils.h:291