diff --git a/include/struct.h b/include/struct.h index c3bb323b4..9294c4247 100644 --- a/include/struct.h +++ b/include/struct.h @@ -850,8 +850,10 @@ typedef struct Whowas { char *username; char *hostname; char *virthost; + char *ip; char *servername; char *realname; + char *account; long umodes; time_t logoff; struct Client *online; /* Pointer to new nickname for chasing or NULL */ diff --git a/src/modules/whowas.c b/src/modules/whowas.c index f2e006ac3..c5149ec07 100644 --- a/src/modules/whowas.c +++ b/src/modules/whowas.c @@ -104,6 +104,19 @@ CMD_FUNC(cmd_whowas) (*temp->virthost != '\0') ? temp->virthost : temp->hostname), temp->realname); + if (!BadPtr(temp->ip) && ValidatePermissionsForPath("client:see:ip",client,NULL,NULL,NULL)) + { + sendnumericfmt(client, RPL_WHOISHOST, "%s :was connecting from %s@%s %s", + temp->name, + temp->username, temp->hostname, + temp->ip ? temp->ip : ""); + } + if (IsOper(client) && !BadPtr(temp->account)) + { + sendnumericfmt(client, RPL_WHOISLOGGEDIN, "%s %s :was logged in as", + temp->name, + temp->account); + } if (!((find_uline(temp->servername)) && !IsOper(client) && HIDE_ULINES)) { sendnumeric(client, RPL_WHOISSERVER, temp->name, temp->servername, diff --git a/src/whowas.c b/src/whowas.c index 6a4c6f72a..cb704f5b1 100644 --- a/src/whowas.c +++ b/src/whowas.c @@ -47,6 +47,7 @@ void add_history(Client *client, int online) safe_free(new->virthost); safe_free(new->realname); safe_free(new->username); + safe_free(new->account); new->servername = NULL; if (new->online) @@ -59,12 +60,15 @@ void add_history(Client *client, int online) safe_strdup(new->name, client->name); safe_strdup(new->username, client->user->username); safe_strdup(new->hostname, client->user->realhost); + safe_strdup(new->ip, client->ip); if (client->user->virthost) safe_strdup(new->virthost, client->user->virthost); else safe_strdup(new->virthost, ""); new->servername = client->user->server; safe_strdup(new->realname, client->info); + if (strcmp(client->user->account, "0")) + safe_strdup(new->account, client->user->account); /* Its not string copied, a pointer to the scache hash is copied -Dianora