#include <pwd.h>
#include <errno.h>
#include <sys/types.h>
-#include <sys/time.h>
+
+#if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+
#include <sys/wait.h>
#include <string.h>
#include <limits.h>
#include "citadel.h"
#include "server.h"
-#include <time.h>
#include "sysdep_decls.h"
#include "citserver.h"
#include "support.h"
#include "config.h"
#include "control.h"
-#include "dynloader.h"
+#include "serv_extensions.h"
#include "room_ops.h"
#include "user_ops.h"
#include "policy.h"
* enter user bio
*/
void cmd_ebio(char *cmdbuf) {
- char cbuf[SIZ];
- char *ibuf;
+ char buf[SIZ];
FILE *fp;
if (!(CC->logged_in)) {
return;
}
- sprintf(cbuf,"./bio/%ld",CC->usersupp.usernum);
- fp = fopen(cbuf,"w");
+ snprintf(buf, sizeof buf, "./bio/%ld",CC->user.usernum);
+ fp = fopen(buf,"w");
if (fp == NULL) {
cprintf("%d Cannot create file\n",ERROR);
return;
}
cprintf("%d \n",SEND_LISTING);
- while(client_gets(&ibuf), strcmp(ibuf,"000")) {
- fprintf(fp,"%s\n",ibuf);
+ while(client_gets(buf), strcmp(buf,"000")) {
+ fprintf(fp,"%s\n",buf);
}
fclose(fp);
}
*/
void cmd_rbio(char *cmdbuf)
{
- struct usersupp ruser;
+ struct user ruser;
char buf[SIZ];
FILE *fp;
cprintf("%d No such user.\n",ERROR+NO_SUCH_USER);
return;
}
- sprintf(buf,"./bio/%ld",ruser.usernum);
+ snprintf(buf, sizeof buf, "./bio/%ld",ruser.usernum);
cprintf("%d OK|%s|%ld|%d|%ld|%ld|%ld\n", LISTING_FOLLOWS,
ruser.fullname, ruser.usernum, ruser.axlevel,
- ruser.lastcall, ruser.timescalled, ruser.posted);
+ (long)ruser.lastcall, ruser.timescalled, ruser.posted);
fp = fopen(buf,"r");
if (fp == NULL)
cprintf("%s has no bio on file.\n", ruser.fullname);
void cmd_lbio(char *cmdbuf) {
char buf[SIZ];
FILE *ls;
- struct usersupp usbuf;
+ struct user usbuf;
ls=popen("cd ./bio; ls","r");
if (ls==NULL) {
-char *Dynamic_Module_Init(void)
+char *serv_bio_init(void)
{
CtdlRegisterProtoHook(cmd_ebio, "EBIO", "Enter your bio");
CtdlRegisterProtoHook(cmd_rbio, "RBIO", "Read a user's bio");