$Log$
+ Revision 572.20 2000/07/29 05:29:19 ajc
+ * Changed the format of RWHO output to provide non-masqueraded user/room/host
+ names (to Aides only) as additional fields rather than an extra line of
+ output.
+ * Changed the client to display new RWHO fields, in the "long" wholist only.
+ * Default SMTP and POP ports are now -1, not 25/110. These services must now
+ be activated manually.
+
Revision 572.19 2000/07/24 00:39:13 ajc
* Fixed a path problem when calling netmailer from mailinglist.c
Fri Jul 10 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
* Initial CVS import
+
*/
void who_is_online(int longlist)
{
- char buf[128], username[128], roomname[128], fromhost[128],
- flags[128];
+ char buf[128], username[128], roomname[128], fromhost[128];
+ char flags[128];
+ char actual_user[128], actual_room[128], actual_host[128];
char tbuf[128], clientsoft[128];
time_t timenow = 0;
time_t idletime, idlehours, idlemins, idlesecs;
extract(flags, buf, 7);
if (longlist) {
+
+ extract(actual_user, buf, 8);
+ extract(actual_room, buf, 9);
+ extract(actual_host, buf, 10);
+
idletime = timenow - extract_long(buf, 5);
idlehours = idletime / 3600;
idlemins = (idletime - (idlehours * 3600)) / 60;
fromhost, clientsoft,
(long) idlehours, (long) idlemins, (long) idlesecs);
+ if ( (strlen(actual_user)+strlen(actual_room)+strlen(actual_host)) > 0) {
+ pprintf("(really ");
+ if (strlen(actual_user)>0) pprintf("<%s> ", actual_user);
+ if (strlen(actual_room)>0) pprintf("in <%s> ", actual_room);
+ if (strlen(actual_host)>0) pprintf("from <%s> ", actual_host);
+ pprintf(")\n");
+ }
+
} else {
if (extract_int(buf, 0) == last_session) {
pprintf(" ");
void cmd_rwho(char *argbuf) {
struct CitContext *cptr;
int spoofed = 0;
+ int user_spoofed = 0;
+ int room_spoofed = 0;
+ int host_spoofed = 0;
int aide;
char un[40];
char real_room[ROOMNAMELEN], room[ROOMNAMELEN];
{
flags[0] = '\0';
spoofed = 0;
+ user_spoofed = 0;
+ room_spoofed = 0;
+ host_spoofed = 0;
if (cptr->cs_flags & CS_POSTING)
strcat(flags, "*");
{
strcpy(un, cptr->fake_username);
spoofed = 1;
+ user_spoofed = 1;
}
else
strcpy(un, cptr->curr_user);
{
strcpy(host, cptr->fake_hostname);
spoofed = 1;
+ host_spoofed = 1;
}
else
strcpy(host, cptr->cs_host);
if (cptr->fake_roomname[0]) {
strcpy(room, cptr->fake_roomname);
spoofed = 1;
+ room_spoofed = 1;
}
else {
strcpy(room, real_room);
if (((cptr->cs_flags&CS_STEALTH)==0) || (aide))
{
- cprintf("%d|%s|%s|%s|%s|%ld|%s|%s\n",
+ cprintf("%d|%s|%s|%s|%s|%ld|%s|%s|",
cptr->cs_pid, un, room,
host, cptr->cs_clientname,
(long)(cptr->lastidle),
cptr->lastcmdname, flags);
}
- if ((spoofed) && (aide))
- {
- cprintf("%d|%s|%s|%s|%s|%ld|%s|%s\n",
- cptr->cs_pid, cptr->curr_user,
- real_room,
- cptr->cs_host, cptr->cs_clientname,
- (long)(cptr->lastidle),
- cptr->lastcmdname, flags);
-
+
+ if ((user_spoofed) && (aide)) {
+ cprintf("%s|", cptr->curr_user);
+ }
+ else {
+ cprintf("|");
+ }
+
+ if ((room_spoofed) && (aide)) {
+ cprintf("%s|", real_room);
}
+ else {
+ cprintf("|");
+ }
+
+ if ((host_spoofed) && (aide)) {
+ cprintf("%s|", cptr->cs_host);
+ }
+ else {
+ cprintf("|");
+ }
+
+ cprintf("\n");
+
}
/* Now it's magic time. Before we finish, call any EVT_RWHO hooks
/*
* Default port numbers for various services
*/
- if (config.c_pop3_port == 0) config.c_pop3_port = 110;
- if (config.c_smtp_port == 0) config.c_smtp_port = 25;
+ if (config.c_pop3_port == 0) config.c_pop3_port = (-1);
+ if (config.c_smtp_port == 0) config.c_smtp_port = (-1);
/* Go through a series of dialogs prompting for config info */
this client (Note: NOOP's don't count)
6 - The last command received from a client. (NOOP's don't count)
7 - Session flags. These are: + (spoofed address), - (STEALTH mode), *
- (posting) and . (idle). (Citserver 5.02 and above)
+ (posting) and . (idle).
+ 8 - Actual user name, if user name is masqueraded and viewer is an Aide.
+ 9 - Actual room name, if room name is masqueraded and viewer is an Aide.
+ 10 - Actual host name, if host name is masqueraded and viewer is an Aide.
The listing is terminated, as always, with the string "000" on a line by
itself.