These are artifacts from the old days of dialup BBS and they aren't really used anymore.
Removing them to save a bunch of extra database writes.
uid_t uid; // Associate with a unix account?
char password[32]; // Account password (unless using external authentication)
unsigned flags; // See US_ flags below
- long timescalled; // Total number of logins
- long posted; // Number of messages posted (ever)
CIT_UBYTE axlevel; // Access level
long usernum; // User number (never recycled)
time_t lastcall; // Last time the user called
return;
}
- cprintf("%d OK|%s|%ld|%d|%ld|%ld|%ld\n", LISTING_FOLLOWS,
- ruser.fullname, ruser.usernum, ruser.axlevel,
- (long)ruser.lastcall, ruser.timescalled, ruser.posted);
+ cprintf("%d OK|%s|%ld|%d|%ld|0|0\n", LISTING_FOLLOWS,
+ ruser.fullname, ruser.usernum, ruser.axlevel, (long)ruser.lastcall);
struct CtdlMessage *msg = CtdlFetchMessage(ruser.msgnum_bio, 1);
if (msg != NULL) {
// Server functions which perform operations on user objects.
//
-// Copyright (c) 1987-2022 by the citadel.org team
+// Copyright (c) 1987-2023 by the citadel.org team
//
// This program is open source software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License, version 3.
if ((CC->user.axlevel >= AxAideU)
|| ((usbuf.flags & US_UNLISTED) == 0)
|| ((CC->internal_pgm))) {
- cprintf("%s|%d|%ld|%ld|%ld|%ld||\n",
+ cprintf("%s|%d|%ld|%ld|0|0||\n",
usbuf.fullname,
usbuf.axlevel,
usbuf.usernum,
- (long)usbuf.lastcall,
- usbuf.timescalled,
- usbuf.posted);
+ (long)usbuf.lastcall);
}
}
}
cprintf("%d No such user.\n", ERROR + NO_SUCH_USER);
return;
}
- cprintf("%d %s|%s|%u|%ld|%ld|%d|%ld|%ld|%d\n",
+ cprintf("%d %s|%s|%u|0|0|%d|%ld|%ld|%d\n",
CIT_OK,
usbuf.fullname,
usbuf.password,
usbuf.flags,
- usbuf.timescalled,
- usbuf.posted,
(int) usbuf.axlevel,
usbuf.usernum,
(long)usbuf.lastcall,
extract_token(usbuf.password, cmdbuf, 1, '|', sizeof usbuf.password);
if (np > 2)
usbuf.flags = extract_int(cmdbuf, 2);
- if (np > 3)
- usbuf.timescalled = extract_int(cmdbuf, 3);
- if (np > 4)
- usbuf.posted = extract_int(cmdbuf, 4);
if (np > 5) {
newax = extract_int(cmdbuf, 5);
if ((newax >= AxDeleted) && (newax <= AxAideU)) {
// Moved this lower down so that aides and permanent users get purged if they ask to be.
if (!strcasecmp(us.password, "deleteme")) purge = 1;
- // Fewer than zero calls is impossible, indicating a corrupted record.
- if (us.timescalled < 0) purge = 1;
-
// any negative user number, is also impossible.
if (us.usernum < 0L) purge = 1;
cprintf("<u_uid>%ld</u_uid>\n", (long)u.uid);
client_write(HKEY("<u_password>")); xml_strout(u.password); client_write(HKEY("</u_password>\n"));
cprintf("<u_flags>%u</u_flags>\n", u.flags);
- cprintf("<u_timescalled>%ld</u_timescalled>\n", u.timescalled);
- cprintf("<u_posted>%ld</u_posted>\n", u.posted);
cprintf("<u_axlevel>%d</u_axlevel>\n", u.axlevel);
cprintf("<u_usernum>%ld</u_usernum>\n", u.usernum);
cprintf("<u_lastcall>%ld</u_lastcall>\n", (long)u.lastcall);
else if (!strcasecmp(el, "u_uid")) usbuf.uid = atol(ChrPtr(migr_chardata));
else if (!strcasecmp(el, "u_password")) safestrncpy(usbuf.password, ChrPtr(migr_chardata), sizeof usbuf.password);
else if (!strcasecmp(el, "u_flags")) usbuf.flags = atoi(ChrPtr(migr_chardata));
- else if (!strcasecmp(el, "u_timescalled")) usbuf.timescalled = atol(ChrPtr(migr_chardata));
- else if (!strcasecmp(el, "u_posted")) usbuf.posted = atol(ChrPtr(migr_chardata));
else if (!strcasecmp(el, "u_axlevel")) usbuf.axlevel = atoi(ChrPtr(migr_chardata));
else if (!strcasecmp(el, "u_usernum")) usbuf.usernum = atol(ChrPtr(migr_chardata));
else if (!strcasecmp(el, "u_lastcall")) usbuf.lastcall = atol(ChrPtr(migr_chardata));
+++ /dev/null
-/*
- * Automatically copies the contents of a "New User Greetings" room to the
- * inbox of any new user upon account creation.
- *
- * Copyright (c) 1987-2022 by the citadel.org team
- *
- * This program is open source software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 3.
- *
- * 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.
- */
-
-/*
- * Name of the New User Greetings room.
- */
-#define NEWUSERGREETINGS "New User Greetings"
-
-#include "../../sysdep.h"
-#include <stdlib.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <fcntl.h>
-#include <signal.h>
-#include <pwd.h>
-#include <errno.h>
-#include <sys/types.h>
-#include <time.h>
-#include <sys/wait.h>
-#include <string.h>
-#include <limits.h>
-#include "../../ctdl_module.h"
-#include "../../citadel_defs.h"
-#include "../../server.h"
-#include "../../citserver.h"
-#include "../../support.h"
-#include "../../config.h"
-#include "../../user_ops.h"
-#include "../../database.h"
-#include "../../msgbase.h"
-
-/*
- * Copy the contents of the New User Greetings> room to the user's Mail> room.
- */
-void CopyNewUserGreetings(void) {
- struct cdbdata *cdbfr;
- long *msglist = NULL;
- int num_msgs = 0;
- char mailboxname[ROOMNAMELEN];
-
-
- /* Only do this for new users. */
- if (CC->user.timescalled != 1) return;
-
- /* This user's mailbox. */
- CtdlMailboxName(mailboxname, sizeof mailboxname, &CC->user, MAILROOM);
-
- /* Go to the source room ... bail out silently if it's not there,
- * or if it's not private.
- */
- if (CtdlGetRoom(&CC->room, NEWUSERGREETINGS) != 0) return;
- if ((CC->room.QRflags & QR_PRIVATE) == 0) return;
-
- cdbfr = cdb_fetch(CDB_MSGLISTS, &CC->room.QRnumber, sizeof(long));
-
- if (cdbfr != NULL) {
- msglist = malloc(cdbfr->len);
- memcpy(msglist, cdbfr->ptr, cdbfr->len);
- num_msgs = cdbfr->len / sizeof(long);
- cdb_free(cdbfr);
- }
-
- if (num_msgs > 0) {
- CtdlSaveMsgPointersInRoom(mailboxname, msglist, num_msgs, 1, NULL, 0);
- }
-
- /* Now free the memory we used, and go away. */
- if (msglist != NULL) free(msglist);
-}
-
-
-// Initialization function, called from modules_init.c
-char *ctdl_module_init_newuser(void) {
- if (!threading) {
- CtdlRegisterSessionHook(CopyNewUserGreetings, EVT_LOGIN, PRIO_LOGIN + 1);
- }
-
- /* return our module name for the log */
- return "newuser";
-}
syslog(LOG_DEBUG, "extensions: init %s", ctdl_module_init_listdeliver());
syslog(LOG_DEBUG, "extensions: init %s", ctdl_module_init_listsub());
syslog(LOG_DEBUG, "extensions: init %s", ctdl_module_init_migrate());
- syslog(LOG_DEBUG, "extensions: init %s", ctdl_module_init_newuser());
syslog(LOG_DEBUG, "extensions: init %s", ctdl_module_init_nntp());
syslog(LOG_DEBUG, "extensions: init %s", ctdl_module_init_notes());
syslog(LOG_DEBUG, "extensions: init %s", ctdl_module_init_pop3());
}
}
- /* Bump this user's messages posted counter. */
- syslog(LOG_DEBUG, "msgbase: updating user");
- CtdlLockGetCurrentUser();
- CC->user.posted = CC->user.posted + 1;
- CtdlPutCurrentUserLock();
-
/* Decide where bounces need to be delivered */
if ((recps != NULL) && (recps->bounce_to == NULL)) {
if (CC->logged_in) {
uid_t uid; // Associate with a unix account?
char password[32]; // password
unsigned flags; // See US_ flags below
- long timescalled; // Total number of logins
- long posted; // Number of messages ever submitted
+ long unused1;
+ long unused2;
cit_uint8_t axlevel; // Access level
long usernum; // User number (never recycled)
time_t lastcall; // Date/time of most recent login
syslog(LOG_NOTICE, "user_ops: <%s> logged in", CC->curr_user);
CtdlGetUserLock(&CC->user, CC->curr_user);
- ++(CC->user.timescalled);
CC->previous_login = CC->user.lastcall;
time(&CC->user.lastcall);
void logged_in_response(void) {
- cprintf("%d %s|%d|%ld|%ld|%u|%ld|%ld\n",
+ cprintf("%d %s|%d|0|0|%u|%ld|%ld\n",
CIT_OK, CC->user.fullname, CC->user.axlevel,
- CC->user.timescalled, CC->user.posted,
CC->user.flags, CC->user.usernum,
CC->previous_login
);
// These are the default flags on new accounts
usbuf->flags = US_LASTOLD | US_DISAPPEAR | US_PAGINATOR | US_FLOORS;
-
- usbuf->timescalled = 0;
- usbuf->posted = 0;
usbuf->axlevel = CtdlGetConfigInt("c_initax");
usbuf->lastcall = time(NULL);
user64->uid = (uid_t) user32->uid;
strcpy(user64->password, user32->password);
user64->flags = (unsigned) user32->flags;
- user64->timescalled = (long) user32->timescalled;
- user64->posted = (long) user32->posted;
user64->axlevel = (cit_uint8_t) user32->axlevel;
user64->usernum = (long) user32->usernum;
user64->lastcall = (time_t) user32->lastcall;