for (a=0; a<num_msgs; ++a) {
delnum = msglist[a];
- msg = CtdlFetchMessage(delnum);
+ msg = CtdlFetchMessage(delnum, 0); /* dont need body */
if (msg != NULL) {
xtime = atol(msg->cm_fields['T']);
CtdlFreeMessage(msg);
#ifdef ENABLE_AUTOLOGIN
struct PurgeList *pptr;
- if ((us->uid != (-1)) && (us->uid != BBSUID)) {
+ if ((us->uid != (-1)) && (us->uid != CTDLUID)) {
if (getpwuid(us->uid) == NULL) {
pptr = (struct PurgeList *)
malloc(sizeof(struct PurgeList));
struct ctdlroom qrbuf;
char mailboxname[ROOMNAMELEN];
MailboxName(mailboxname, us, MAILROOM);
- create_room(mailboxname, 4, "", 0, 1, 1);
+ create_room(mailboxname, 4, "", 0, 1, 1, VIEW_BBS);
if (getroom(&qrbuf, mailboxname) != 0) return;
lprintf(CTDL_DEBUG, "Got %s\n", qrbuf.QRname);
*/
*/
if (us->timescalled == 0) purge = 1;
+ /* User number 0, as well as any negative user number, is
+ * also impossible.
+ */
+ if (us->usernum < 1L) purge = 1;
+
if (purge == 1) {
pptr = (struct PurgeList *) malloc(sizeof(struct PurgeList));
pptr->next = UserPurgeList;
* last twelve hours. This is usually enough granularity.
*/
now = time(NULL);
- memcpy(&tm, localtime(&now), sizeof(struct tm));
+ localtime_r(&now, &tm);
if (tm.tm_hour != config.c_purge_hour) return;
if ((now - last_purge) < 43200) return;