$Log$
+Revision 505.17 2004/03/17 18:25:31 ajc
+* When creating a new user, auto-chain to the "edit user configuration"
+ screen, and subsequently auto-chain to the "edit address book entry"
+ screen. This creates a nice sensible workflow.
+
Revision 505.16 2004/03/15 22:47:09 ajc
* Prettied up the chat window a little more.
1998-12-03 Nathan Bryant <bryant@cs.usm.maine.edu>
* webserver.c: warning fix
+
/*
* Edit a user. If supplied_username is null, look in the "username"
* web variable for the name of the user to edit.
+ *
+ * If "is_new" is set to nonzero, this screen will set the web variables
+ * to send the user to the vCard editor next.
*/
-void display_edituser(char *supplied_username) {
+void display_edituser(char *supplied_username, int is_new) {
char buf[SIZ];
char error_message[SIZ];
time_t now;
"<INPUT TYPE=\"hidden\" NAME=\"username\" VALUE=\"");
escputs(username);
wprintf("\">\n");
+ wprintf("<INPUT TYPE=\"hidden\" NAME=\"is_new\" VALUE=\"%d\">\n"
+ "<INPUT TYPE=\"hidden\" NAME=\"usernum\" VALUE=\"%ld\">\n",
+ is_new, usernum);
wprintf("<INPUT TYPE=\"hidden\" NAME=\"flags\" VALUE=\"%d\">\n", flags);
void edituser(void) {
char message[SIZ];
char buf[SIZ];
+ int is_new = 0;
+
+ is_new = atoi(bstr("is_new"));
if (strcasecmp(bstr("action"), "OK")) {
strcpy(message, "Edit user cancelled.");
}
}
- select_user_to_edit(message, bstr("username"));
+ /* If we are in the middle of creating a new user, move on to
+ * the vCard edit screen.
+ */
+ if (is_new) {
+ display_edit_address_book_entry( bstr("username"), atol(bstr("usernum")) );
+ }
+ else {
+ select_user_to_edit(message, bstr("username"));
+ }
}
serv_gets(buf);
if (buf[0] == '2') {
- sprintf(error_message, "<b>User has been created.</b>");
- select_user_to_edit(error_message, username);
+ /* sprintf(error_message, "<b>User has been created.</b>");
+ select_user_to_edit(error_message, username); */
+ display_edituser(username, 1);
}
else {
sprintf(error_message,
} else if (!strcasecmp(action, "select_user_to_edit")) {
select_user_to_edit(NULL, NULL);
} else if (!strcasecmp(action, "display_edituser")) {
- display_edituser(NULL);
+ display_edituser(NULL, 0);
} else if (!strcasecmp(action, "edituser")) {
edituser();
} else if (!strcasecmp(action, "create_user")) {