#include <limits.h>
#include "citadel.h"
#include "server.h"
-#include "sysdep_decls.h"
#include "citserver.h"
#include "support.h"
#include "config.h"
#include "control.h"
-#include "dynloader.h"
#include "room_ops.h"
#include "user_ops.h"
#include "policy.h"
#include "tools.h"
+#include "ctdl_module.h"
+
/*
* display who's online
char real_room[ROOMNAMELEN], room[ROOMNAMELEN];
char host[64], flags[5];
- aide = CC->usersupp.axlevel >= 6;
+ aide = CC->user.axlevel >= 6;
cprintf("%d%c \n", LISTING_FOLLOWS, CtdlCheckExpress() );
for (cptr = ContextList; cptr != NULL; cptr = cptr->next)
*/
void cmd_rchg(char *argbuf)
{
- char newroomname[SIZ];
+ char newroomname[ROOMNAMELEN];
- extract(newroomname, argbuf, 0);
+ extract_token(newroomname, argbuf, 0, '|', sizeof newroomname);
newroomname[ROOMNAMELEN-1] = 0;
if (strlen(newroomname) > 0) {
safestrncpy(CC->fake_roomname, newroomname,
sizeof(CC->fake_roomname) );
- }
+ }
else {
- strcpy(CC->fake_roomname, "");
- }
+ safestrncpy(CC->fake_roomname, "", sizeof CC->fake_roomname);
+ }
cprintf("%d OK\n", CIT_OK);
}
*/
void cmd_hchg(char *argbuf)
{
- char newhostname[SIZ];
+ char newhostname[64];
- extract(newhostname, argbuf, 0);
+ extract_token(newhostname, argbuf, 0, '|', sizeof newhostname);
if (strlen(newhostname) > 0) {
safestrncpy(CC->fake_hostname, newhostname,
sizeof(CC->fake_hostname) );
- }
+ }
else {
- strcpy(CC->fake_hostname, "");
- }
+ safestrncpy(CC->fake_hostname, "", sizeof CC->fake_hostname);
+ }
cprintf("%d OK\n", CIT_OK);
}
void cmd_uchg(char *argbuf)
{
- char newusername[SIZ];
+ char newusername[USERNAME_SIZE];
- extract(newusername, argbuf, 0);
+ extract_token(newusername, argbuf, 0, '|', sizeof newusername);
if (CtdlAccessCheck(ac_aide)) return;
-char *Dynamic_Module_Init(void)
+CTDL_MODULE_INIT(rwho)
{
CtdlRegisterProtoHook(cmd_rwho, "RWHO", "Display who is online");
CtdlRegisterProtoHook(cmd_hchg, "HCHG", "Masquerade hostname");
CtdlRegisterProtoHook(cmd_rchg, "RCHG", "Masquerade roomname");
CtdlRegisterProtoHook(cmd_uchg, "UCHG", "Masquerade username");
CtdlRegisterProtoHook(cmd_stel, "STEL", "Enter/exit stealth mode");
+
+ /* return our Subversion id for the Log */
return "$Id$";
}