added per-user internet mail permission setting
authorArt Cancro <ajc@citadel.org>
Wed, 2 Nov 2005 03:30:56 +0000 (03:30 +0000)
committerArt Cancro <ajc@citadel.org>
Wed, 2 Nov 2005 03:30:56 +0000 (03:30 +0000)
webcit/ChangeLog
webcit/useredit.c
webcit/webcit.h

index 0ba012aa15c5a3f8dc51b2a69ced7f35ef8b4539..0e9259685f9e3b9ed8bd9cfa432ffde3f5e07687 100644 (file)
@@ -1,5 +1,9 @@
 $Id$
 
+Tue Nov  1 22:30:15 EST 2005 ajc
+* useredit.c: added in the missing "Permission to send Internet mail"
+  option for editing a user account.
+
 Mon Oct 31 22:29:39 EST 2005 ajc
 * messages.c: the summary line for each message is now a SPAN instead of
   a DIV.  This was done because we needed the SPAN anyway to apply styles,
index b0ccd1a2aad1e4102b538e1ff1f79a099de579c0..35e768cd9903dbd93eeed956e075394480aaab11 100644 (file)
@@ -209,12 +209,12 @@ void display_edit_address_book_entry(char *username, long usernum) {
  * to send the user to the vCard editor next.
  */
 void display_edituser(char *supplied_username, int is_new) {
-       char buf[SIZ];
-       char error_message[SIZ];
+       char buf[1024];
+       char error_message[1024];
        time_t now;
 
-       char username[SIZ];
-       char password[SIZ];
+       char username[256];
+       char password[256];
        unsigned int flags;
        int timescalled;
        int msgsposted;
@@ -291,6 +291,15 @@ void display_edituser(char *supplied_username, int is_new) {
        escputs(password);
        wprintf("\" MAXLENGTH=\"20\"></TD></TR>\n");
 
+       wprintf("<tr><td>");
+       wprintf(_("Permission to send Internet mail"));
+       wprintf("</td><td>");
+       wprintf("<input type=\"checkbox\" name=\"inetmail\" value=\"yes\" ");
+       if (flags & US_INTERNET) {
+               wprintf("CHECKED ");
+       }
+       wprintf("></td></tr>\n");
+
        wprintf("<TR><TD>");
        wprintf(_("Number of logins"));
        wprintf("</TD><TD>"
@@ -368,6 +377,7 @@ void edituser(void) {
        char message[SIZ];
        char buf[SIZ];
        int is_new = 0;
+       unsigned int flags = 0;
 
        is_new = atoi(bstr("is_new"));
 
@@ -375,11 +385,18 @@ void edituser(void) {
                safestrncpy(message, _("Changes were not saved."), sizeof message);
        }
        else {
+               flags = atoi(bstr("flags"));
+               if (!strcasecmp(bstr("inetmail"), "yes")) {
+                       flags |= US_INTERNET;
+               }
+               else {
+                       flags &= ~US_INTERNET ;
+               }
 
-               serv_printf("ASUP %s|%s|%s|%s|%s|%s|%s|%s|%s|",
+               serv_printf("ASUP %s|%s|%d|%s|%s|%s|%s|%s|%s|",
                        bstr("username"),
                        bstr("password"),
-                       bstr("flags"),
+                       flags,
                        bstr("timescalled"),
                        bstr("msgsposted"),
                        bstr("axlevel"),
index e365a9f96cad83b30619616f7de79f28f8be2ce1..6e9852c8f56e620c26faabf5850ba7c594e175ca 100644 (file)
 #define UA_ZAPPED             16
 
 
+/*
+ * User flags (from Citadel)
+ */
+#define US_NEEDVALID   1               /* User needs to be validated       */
+#define US_PERM                4               /* Permanent user                   */
+#define US_LASTOLD     16              /* Print last old message with new  */
+#define US_EXPERT      32              /* Experienced user                 */
+#define US_UNLISTED    64              /* Unlisted userlog entry           */
+#define US_NOPROMPT    128             /* Don't prompt after each message  */
+#define US_PROMPTCTL   256             /* <N>ext & <S>top work at prompt   */
+#define US_DISAPPEAR   512             /* Use "disappearing msg prompts"   */
+#define US_REGIS       1024            /* Registered user                  */
+#define US_PAGINATOR   2048            /* Pause after each screen of text  */
+#define US_INTERNET    4096            /* Internet mail privileges         */
+#define US_FLOORS      8192            /* User wants to see floors         */
+#define US_COLOR       16384           /* User wants ANSI color support    */
+#define US_USER_SET    (US_LASTOLD | US_EXPERT | US_UNLISTED | \
+                       US_NOPROMPT | US_DISAPPEAR | US_PAGINATOR | \
+                       US_FLOORS | US_COLOR | US_PROMPTCTL )