$Log$
+ Revision 590.122 2002/03/03 06:18:45 ajc
+ * Implemented the CREU server command to administratively create user accounts
+ * Added the ability to create new user accounts to <.A>ide <U>seredit
+
Revision 590.121 2002/03/03 06:05:16 ajc
* Split up some of the code in order to prepare for user accounts to be
administratively created without logging in to them.
Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
* Initial CVS import
+
cmd_newu(&cmdbuf[5]);
}
+ else if (!strncasecmp(cmdbuf,"CREU",4)) {
+ cmd_creu(&cmdbuf[5]);
+ }
+
else if (!strncasecmp(cmdbuf,"SETP",4)) {
cmd_setp(&cmdbuf[5]);
}
int userpurge;
newprompt("User name: ",who,25);
- sprintf(buf,"AGUP %s",who);
+AGUP: sprintf(buf,"AGUP %s",who);
serv_puts(buf);
serv_gets(buf);
if (buf[0]!='2') {
scr_printf("%s\n",&buf[4]);
- return;
+ scr_printf("Do you want to create this user? ");
+ if (yesno()) {
+ sprintf(buf, "CREU %s", who);
+ serv_puts(buf);
+ serv_gets(buf);
+ if (buf[0] == '2') goto AGUP;
+ scr_printf("%s\n",&buf[4]);
+ return;
}
+ return;
+ }
extract(who, &buf[4], 0);
extract(pass, &buf[4], 1);
flags = extract_int(&buf[4], 2);
NEWU (create NEW User account)
- This command creates a new user account and logs it in. The argument to
+ This command creates a new user account AND LOGS 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, so the client should immediately prompt the
logged in, or ERROR if another user already exists with this name. If OK,
it will also return the same parameters that PASS returns.
+ Please note that the NEWU command should only be used for self-service user account
+creation. For administratively creating user accounts, please use the CREU command.
+
SETP (SET new Password)
ERROR.
+ 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.
+
+ 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.
+
+
+
LKRN (List Known Rooms with New messages)
List known rooms with new messages. If the client is not logged in, ERROR
/*
- * cmd_newu() - create a new user account
+ * cmd_newu() - create a new user account and log in as that user
*/
void cmd_newu(char *cmdbuf)
{
PerformSessionHooks(EVT_SETPASS);
}
+
+/*
+ * cmd_creu() - administratively create a new user account (do not log in to it)
+ */
+void cmd_creu(char *cmdbuf)
+{
+ int a;
+ char username[SIZ];
+
+ if (CtdlAccessCheck(ac_aide)) {
+ return;
+ }
+
+ extract(username, cmdbuf, 0);
+ username[25] = 0;
+ strproc(username);
+
+ if (strlen(username) == 0) {
+ cprintf("%d You must supply a user name.\n", ERROR);
+ return;
+ }
+
+ a = create_user(username, 0);
+
+ if (a == 0) {
+ cprintf("%d ok\n", OK);
+ return;
+ } else if (a == ERROR + ALREADY_EXISTS) {
+ cprintf("%d '%s' already exists.\n",
+ ERROR + ALREADY_EXISTS, username);
+ return;
+ } else {
+ cprintf("%d An error occured creating the user account.\n", ERROR);
+ }
+ rec_log(CL_NEWUSER, username);
+}
+
+
+
/*
* get user parameters
*/
int create_user (char *newusername, int become_user);
void do_login(void);
void cmd_newu (char *cmdbuf);
+void cmd_creu (char *cmdbuf);
void cmd_setp (char *new_pw);
void cmd_getu (void);
void cmd_setu (char *new_parms);