mirror of
https://github.com/znc/znc.git
synced 2026-08-07 17:33:34 +02:00
Lastseen module embeds info about last login time to webadmin user page.
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@2130 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
@@ -150,6 +150,24 @@ public:
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual bool OnEmbeddedWebRequest(CWebSock& WebSock, const CString& sPageName, CTemplate& Tmpl) {
|
||||
if (sPageName == "webadmin/user" && WebSock.GetSession()->IsAdmin()) {
|
||||
CUser* pUser = CZNC::Get().FindUser(Tmpl["Username"]);
|
||||
if (pUser) {
|
||||
time_t last = GetTime(pUser);
|
||||
if (last) {
|
||||
char buf[1024] = {0};
|
||||
strftime(buf, sizeof(buf), "%c", localtime(&last));
|
||||
Tmpl["LastSeen"] = buf;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
GLOBALMODULEDEFS(CLastSeenMod, "Collects data about when a user last logged in")
|
||||
|
||||
Reference in New Issue
Block a user