-/*
- * Server functions which perform operations on user objects.
- *
- * Copyright (c) 1987-2020 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.
- */
+// Server functions which perform operations on user objects.
+//
+// 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.
- cprintf("%d Password required for %s\n",
- MORE_DATA, CC->curr_user);
+ cprintf("%d Password required for %s\n", MORE_DATA, CC->curr_user);
- cprintf("%d Self-service user account creation "
- "is disabled on this system.\n", ERROR + NOT_HERE);
+ cprintf("%d Self-service user account creation is disabled on this system.\n", ERROR + NOT_HERE);
if ((!strcasecmp(username, "bbs")) ||
(!strcasecmp(username, "new")) ||
if ((!strcasecmp(username, "bbs")) ||
(!strcasecmp(username, "new")) ||
cprintf("%d '%s' already exists.\n",
ERROR + ALREADY_EXISTS, username);
return;
cprintf("%d '%s' already exists.\n",
ERROR + ALREADY_EXISTS, username);
return;
-/*
- * cmd_creu() - administratively create a new user account (do not log in to it)
- */
-void cmd_creu(char *cmdbuf)
-{
+// cmd_creu() - administratively create a new user account (do not log in to it)
+void cmd_creu(char *cmdbuf) {
}
cprintf("%d User '%s' created %s.\n", CIT_OK, username, (!IsEmptyStr(password)) ? "and password set" : "with no password");
return;
}
cprintf("%d User '%s' created %s.\n", CIT_OK, username, (!IsEmptyStr(password)) ? "and password set" : "with no password");
return;
CtdlGetUser(&CC->user, CC->curr_user);
cprintf("%d 80|24|%d|\n", CIT_OK, (CC->user.flags & US_USER_SET));
}
CtdlGetUser(&CC->user, CC->curr_user);
cprintf("%d 80|24|%d|\n", CIT_OK, (CC->user.flags & US_USER_SET));
}
if (num_parms(new_parms) < 3) {
cprintf("%d Usage error.\n", ERROR + ILLEGAL_VALUE);
if (num_parms(new_parms) < 3) {
cprintf("%d Usage error.\n", ERROR + ILLEGAL_VALUE);
-/*
- * set last read pointer
- */
-void cmd_slrp(char *new_ptr)
-{
+// set last read pointer (marks all messages in the current room as read, up to the specified point)
+void cmd_slrp(char *new_ptr) {
if (!strncasecmp(new_ptr, "highest", 7)) {
newlr = CC->room.QRhighest;
if (!strncasecmp(new_ptr, "highest", 7)) {
newlr = CC->room.QRhighest;
vbuf.v_lastseen = newlr;
snprintf(vbuf.v_seen, sizeof vbuf.v_seen, "*:%ld", newlr);
vbuf.v_lastseen = newlr;
snprintf(vbuf.v_seen, sizeof vbuf.v_seen, "*:%ld", newlr);
- /* Only rewrite the record if it changed */
- if ( (vbuf.v_lastseen != original_vbuf.v_lastseen)
- || (strcmp(vbuf.v_seen, original_vbuf.v_seen)) ) {
+ // Only rewrite the record if it changed
+ if ( (vbuf.v_lastseen != original_vbuf.v_lastseen)
+ || (strcmp(vbuf.v_seen, original_vbuf.v_seen))
+ ) {
- /*
- * These commands are only allowed by admins, room admins,
- * and room namespace owners
- */
+ // These commands are only allowed by admins, room admins,
+ // and room namespace owners
- /* There are unvalidated users. Traverse the user database,
- * and return the first user we find that needs validation.
- */
+ // There are unvalidated users. Traverse the user database, and return the first user we find that needs validation.
cdb_rewind(CDB_USERS);
while (cdbus = cdb_next_item(CDB_USERS), cdbus != NULL) {
memset(&usbuf, 0, sizeof(struct ctdluser));
cdb_rewind(CDB_USERS);
while (cdbus = cdb_next_item(CDB_USERS), cdbus != NULL) {
memset(&usbuf, 0, sizeof(struct ctdluser));
- /* If we get to this point, there are no more unvalidated users.
- * Therefore we clear the "users need validation" flag.
- */
-
+ // If we get to this point, there are no more unvalidated users. Therefore we clear the "users need validation" flag.
if (newax == 0) {
if (purge_user(user) == 0) {
cprintf("%d %s Deleted.\n", CIT_OK, userbuf.fullname);
if (newax == 0) {
if (purge_user(user) == 0) {
cprintf("%d %s Deleted.\n", CIT_OK, userbuf.fullname);
-/*
- * List one user (this works with cmd_list)
- */
-void ListThisUser(char *username, void *data)
-{
+// List one user (this works with cmd_list)
+void ListThisUser(char *username, void *data) {
char searchstring[256];
extract_token(searchstring, cmdbuf, 0, '|', sizeof searchstring);
striplt(searchstring);
char searchstring[256];
extract_token(searchstring, cmdbuf, 0, '|', sizeof searchstring);
striplt(searchstring);
cprintf("%d %d|%d|%d|%s|\n", CIT_OK, mail, regis, vali, CC->cs_inet_email);
}
cprintf("%d %d|%d|%d|%s|\n", CIT_OK, mail, regis, vali, CC->cs_inet_email);
}
struct ctdluser usbuf;
if (CtdlGetUser(&usbuf, who) == 0) {
cprintf("%d %s\n", CIT_OK, usbuf.fullname);
struct ctdluser usbuf;
if (CtdlGetUser(&usbuf, who) == 0) {
cprintf("%d %s\n", CIT_OK, usbuf.fullname);
cprintf("%d Goodbye.\n", CIT_OK);
CC->kill_me = KILLME_CLIENT_LOGGED_OUT;
}
cprintf("%d Goodbye.\n", CIT_OK);
CC->kill_me = KILLME_CLIENT_LOGGED_OUT;
}