* When creating a new user, auto-chain to the "edit user configuration"
authorArt Cancro <ajc@citadel.org>
Wed, 17 Mar 2004 18:25:31 +0000 (18:25 +0000)
committerArt Cancro <ajc@citadel.org>
Wed, 17 Mar 2004 18:25:31 +0000 (18:25 +0000)
  screen, and subsequently auto-chain to the "edit address book entry"
  screen.  This creates a nice sensible workflow.

webcit/ChangeLog
webcit/useredit.c
webcit/webcit.c
webcit/webcit.h

index 7f6e1c79637afacf4e55e997e97b68fc5c44d5c0..d59b019b4637a4f9d742fcaa08a5a8bb9c50c49b 100644 (file)
@@ -1,4 +1,9 @@
 $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.
 
@@ -1727,3 +1732,4 @@ Sun Dec  6 19:50:55 EST 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
 
 1998-12-03 Nathan Bryant <bryant@cs.usm.maine.edu>
        * webserver.c: warning fix
+
index 850b39058636e5e0f9bc2c65d287ac5ab822cc89..0ccf14e900857c4e47ce05c706e929c2330aa7ee 100644 (file)
@@ -211,8 +211,11 @@ void display_edit_address_book_entry(char *username, long usernum) {
 /*
  * 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;
@@ -271,6 +274,9 @@ void display_edituser(char *supplied_username) {
                "<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);
 
@@ -344,6 +350,9 @@ void display_edituser(char *supplied_username) {
 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.");
@@ -373,7 +382,15 @@ void edituser(void) {
                }
        }
 
-       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"));
+       }
 }
 
 
@@ -390,8 +407,9 @@ void create_user(void) {
        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,
index 914484cef50c3b6dccdf88916f48ae68e5dc558d..ea7a94e07fd78b2c247283a8a3f97ac370dbf43f 100644 (file)
@@ -1182,7 +1182,7 @@ void session_loop(struct httprequest *req)
        } 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")) {
index d600c413144cbece6cf40ee9059b564f30363fbc..3290f4a973aa685c4f6bf9300edad08ecf58884d 100644 (file)
@@ -365,7 +365,7 @@ void edit_vcard(void);
 void submit_vcard(void);
 void striplt(char *);
 void select_user_to_edit(char *message, char *preselect);
-void display_edituser(char *who);
+void display_edituser(char *who, int is_new);
 void create_user(void);
 void edituser(void);
 void do_change_view(int);