$Log$
+ Revision 612.2 2003/12/07 19:56:24 error
+ * CREU command now allows specification of an initial password
+
Revision 612.1 2003/12/04 04:20:08 ajc
* Incoming RFC822 messages get the To: field translated directly to
a Citadel <R> field.
Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
* Initial CVS import
-
CREU (CREate new User account)
- This command creates a new user account AND DOES NOT LOG IT IN. The argument to
-this command will be the name of the account. No case conversion is done
-on the name. Note that the new account is installed with a default
-configuration, and no password. This command returns OK if the account was created,
-or ERROR if another user already exists with this name.
+ This command creates a new user account AND DOES NOT LOG IT IN. The first
+argument to this command will be the name of the account. No case conversion
+is done on the name. Note that the new account is installed with a default
+configuration, and no password. The second argument is optional, and will be
+an initial password for the user. This command returns OK if the account was
+created, or ERROR if another user already exists with this name.
Please note that CREU is intended to be used for activities in which a system
-administrator is creating user accounts. For self-service user account creation,
-use the NEWU command.
-
+administrator is creating user accounts. For self-service user account
+creation, use the NEWU command.
LKRN (List Known Rooms with New messages)
{
int i;
- syslog(LOG_NOTICE, "session %d: user <%s> logged in",
+ syslog(LOG_NOTICE, "Session %d: %s logged in",
CC->cs_pid, CC->curr_user);
lgetuser(&CC->user, CC->curr_user);
/*
- * cmd_creu() - administratively create a new user account (do not log in to it)
+ * cmd_creu() - administratively create a new user account (do not log in to it)
*/
void cmd_creu(char *cmdbuf)
{
int a;
char username[SIZ];
+ char password[SIZ];
+ struct ctdluser tmp;
if (CtdlAccessCheck(ac_aide)) {
return;
}
extract(username, cmdbuf, 0);
+ extract(password, cmdbuf, 1);
username[25] = 0;
+ password[31] = 0;
strproc(username);
+ strproc(password);
if (strlen(username) == 0) {
cprintf("%d You must supply a user name.\n", ERROR);
a = create_user(username, 0);
if (a == 0) {
- cprintf("%d ok\n", CIT_OK);
+ if (strlen(password) > 0) {
+ lgetuser(&tmp, username);
+ safestrncpy(tmp.password, new_pw, sizeof(tmp.password));
+ lputuser(&tmp);
+ }
+ cprintf("%d User '%s' created %s.\n", CIT_OK, username,
+ (strlen(password) > 0) ? "and password set" :
+ "with no password");
return;
} else if (a == ERROR + ALREADY_EXISTS) {
cprintf("%d '%s' already exists.\n",