* This module implements server commands related to the display and
* manipulation of the "Who's online" list.
*
+ * Copyright (c) 1987-2009 by the citadel.org team
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "sysdep.h"
* display who's online
*/
void cmd_rwho(char *argbuf) {
- struct CitContext *cptr;
struct CitContext *nptr;
int nContexts, i;
int spoofed = 0;
*/
- nContexts = num_sessions;
- nptr = malloc(sizeof(struct CitContext) * nContexts);
+ nptr = CtdlGetContextArray(&nContexts) ;
if (!nptr)
{
/* Couldn't malloc so we have to bail but stick to the protocol */
cprintf("000\n");
return;
}
- begin_critical_section(S_SESSION_TABLE);
- for (cptr = ContextList, i=0; cptr != NULL && i < nContexts; cptr = cptr->next, i++)
- {
- memcpy(&nptr[i], cptr, sizeof (struct CitContext));
- }
- end_critical_section (S_SESSION_TABLE);
aide = CC->user.axlevel >= 6;
cprintf("%d%c \n", LISTING_FOLLOWS, CtdlCheckExpress() );