free(visits);
}
-
+
+
+void MailboxName(char *buf, struct usersupp *who, char *prefix) {
+ sprintf(buf, "%010ld.%s", who->usernum, prefix);
+ }
+
/*
* Is the user currently logged in an Aide?
cprintf("%d %s|%d|%d|%d|%u|%ld\n",OK,CC->usersupp.fullname,CC->usersupp.axlevel,
CC->usersupp.timescalled,CC->usersupp.posted,CC->usersupp.flags,
CC->usersupp.usernum);
- usergoto(0,0); /* Enter the lobby */
+ usergoto(BASEROOM,0); /* Enter the lobby */
rec_log(CL_LOGIN,CC->curr_user);
}
int a;
struct passwd *p = NULL;
char username[64];
+ char mailboxname[ROOMNAMELEN];
strcpy(username, newusername);
strproc(username);
if (getuser(&CC->usersupp,CC->curr_user)) {
return(ERROR+INTERNAL_ERROR);
}
+
+ /* give the user a private mailbox */
+ MailboxName(mailboxname, &CC->usersupp, MAILROOM);
+ create_room(mailboxname, 4, "", 0);
+
rec_log(CL_NEWUSER,CC->curr_user);
return(0);
}
return;
}
- if (CC->curr_rm < 0) {
- cprintf("%d No current room.\n",ERROR);
- return;
- }
-
if (!strncasecmp(new_ptr,"highest",7)) {
newlr = CC->quickroom.QRhighest;
-/* FIX ... if the current room is 1 (Mail), newlr needs to be set to the
- * number of the highest mail message
- */
}
else {
newlr = atol(new_ptr);
return;
}
- if (CC->curr_rm < 0) {
- cprintf("%d No current room.\n",ERROR);
- return;
- }
-
if (is_room_aide()==0) {
cprintf("%d Higher access required.\n",
ERROR+HIGHER_ACCESS_REQUIRED);
return;
}
- if (CC->curr_rm < 0) {
- cprintf("%d No current room.\n",ERROR);
- return;
- }
-
- if (CC->curr_rm < 3) {
- cprintf("%d You cannot forget this room.\n",ERROR+NOT_HERE);
- return;
- }
-
if (is_aide()) {
cprintf("%d Aides cannot forget rooms.\n",ERROR);
return;
CtdlSetRelationship(&vbuf, &CC->usersupp, &CC->quickroom);
lputuser(&CC->usersupp,CC->curr_user);
cprintf("%d Ok\n",OK);
- CC->curr_rm = (-1);
+ usergoto(BASEROOM, 0);
}
/*
int num_mails;
long *mailbox;
int a;
+ char mailboxname[32];
+
+ MailboxName(mailboxname, &CC->usersupp, MAILROOM);
+ for (a=0; a<=strlen(mailboxname); ++a) {
+ mailboxname[a] = tolower(mailboxname[a]);
+ }
- cdbmb = cdb_fetch(CDB_MAILBOXES, &CC->usersupp.usernum, sizeof(long));
+ cdbmb = cdb_fetch(CDB_MAILBOXES, mailboxname, strlen(mailboxname));
if (cdbmb != NULL) {
num_mails = cdbmb->len / sizeof(long);
mailbox = (long *) cdbmb->ptr;