/*
* Display inner div of Wholist
- */
+ * /
void who_inner_div(void) {
UserStateStruct *User;
void *VUser;
char buf[SIZ];
- struct wcsession *WCC = WC; /* This is done to make it run faster; WC is a function */
+ struct wcsession *WCC = WC;
HashList *List;
HashPos *it;
const char *UserName;
long len;
time_t now;
int bg = 0;
-
wprintf("<table class=\"altern\">"
"<tr>\n");
wprintf("<th class=\"edit_col\"> </th>\n");
}
wprintf("</td>");
- /* (link to page this user) */
+ / * (link to page this user) * /
wprintf("<td width=\"5%%\"><a href=\"display_page?recp=");
UrlescPutStrBuf(User->UserName);
wprintf("\">"
" border=\"0\" /></a> ");
wprintf("</td>");
- /* (idle flag) */
+ / * (idle flag) * /
wprintf("<td width=\"5%%\">");
if (User->Idle) {
wprintf(" "
}
wprintf("</td>\n<td>");
- /* username (link to user bio/photo page) */
+ / * username (link to user bio/photo page) * /
wprintf("<a href=\"showuser?who=");
UrlescPutStrBuf(User->UserName);
wprintf("\">");
wprintf(" [%d] ", User->SessionCount);
wprintf("</a>");
- /* room */
+ / * room * /
wprintf("</td>\n\t<td>");
StrEscPuts(User->Room);
if (StrLength(User->RealRoom) > 0) {
}
wprintf("</td>\n\t<td class=\"host_col\">");
- /* hostname */
+ / * hostname * /
StrEscPuts(User->Host);
if (StrLength(User->RealHost) > 0) {
wprintf("<br /><i>");
}
wprintf("</table>");
DeleteHash(&List);
-
}
+*/
+#if 0
/*
* Display a list of users currently logged in to the system
- */
+ * /
void who(void)
{
char title[256];
"}\n"
"</script>\n", _("Do you really want to kill this session?")
);
+#endif
wprintf("<div id=\"banner\">\n");
wprintf("<div class=\"room_banner\">");
);
wprintf("</div></div>\n");
- /*
+ / *
* JavaScript to make the ajax refresh happen:
* See http://www.sergiopereira.com/articles/prototype.js.html for info on Ajax.PeriodicalUpdater
* It wants: 1. The div being updated
* 2. The URL of the update source
* 3. Other flags (such as the HTTP method and the refresh frequency)
- */
+ * /
wprintf(
"<script type=\"text/javascript\"> "
" new Ajax.PeriodicalUpdater('who_inner', 'who_inner_html', "
);
wDumpContent(1);
}
+*/
+#endif
/*
* end session
serv_printf("TERM %s", bstr("which_session"));
serv_getln(buf, sizeof buf);
- who();
+ ///who();
+ url_do_template();
}
/*
* Wholist section
- */
+ * /
void wholist_section(void) {
UserStateStruct *User;
void *VUser;
}
DeleteHash(&List);
}
+*/
void _terminate_session(void) {
slrp_highest();
terminate_session();
}
-HashList *GetWholistHash(void)
+HashList *GetWholistHash(StrBuf *Target, int nArgs, WCTemplateToken *Tokens, void *Context, int ContextType)
{
HashList *List;
char buf[SIZ];
return List;
}
-void WholistSubst(StrBuf *TemplBuffer, void *vContext)
+void WholistSubst(StrBuf *TemplBuffer, void *vContext, WCTemplateToken *Token)
{
UserStateStruct *User = (UserStateStruct*) vContext;
SVPutBuf("WHO:REALROOM", User->RealRoom, 1);
SVPutBuf("WHO:REALHOST", User->RealHost, 1);
svputlong("WHO:LASTACTIVE", User->LastActive);
+ ///svputlong("WHO:IDLESINCE",(now - User->LastActive) / 60);//// todo
svputlong("WHO:SESSION", User->Session);
svputlong("WHO:IDLE", User->Idle);
svputlong("WHO:NSESSIONS", User->SessionCount);
svputlong("WHO:ISME", (User->Session == WC->ctdl_pid));
}
-void DeleteWholistHash(HashList *KillMe)
+void DeleteWholistHash(HashList **KillMe)
{
- DeleteHash(&KillMe);
+ DeleteHash(KillMe);
}
void
InitModule_WHO
(void)
{
- WebcitAddUrlHandler(HKEY("who"), who, 0);
- WebcitAddUrlHandler(HKEY("who_inner_html"), who_inner_div, AJAX);
- WebcitAddUrlHandler(HKEY("wholist_section"), wholist_section, AJAX);
+/// WebcitAddUrlHandler(HKEY("who"), who, 0);
+// WebcitAddUrlHandler(HKEY("who_inner_html"), who_inner_div, AJAX);
+// WebcitAddUrlHandler(HKEY("wholist_section"), wholist_section, AJAX);
WebcitAddUrlHandler(HKEY("terminate_session"), _terminate_session, 0);
WebcitAddUrlHandler(HKEY("edit_me"), edit_me, 0);
- RegisterIterator("WHOLIST", NULL, GetWholistHash, WholistSubst, DeleteWholistHash);
+ RegisterIterator("WHOLIST", 0, NULL, GetWholistHash, WholistSubst, DeleteWholistHash, CTX_WHO);
}