From 5c76e1b0192780f73ec7d8af08734f5864f41154 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Wed, 2 Nov 2005 03:30:56 +0000 Subject: [PATCH] added per-user internet mail permission setting --- webcit/ChangeLog | 4 ++++ webcit/useredit.c | 29 +++++++++++++++++++++++------ webcit/webcit.h | 19 +++++++++++++++++++ 3 files changed, 46 insertions(+), 6 deletions(-) diff --git a/webcit/ChangeLog b/webcit/ChangeLog index 0ba012aa1..0e9259685 100644 --- a/webcit/ChangeLog +++ b/webcit/ChangeLog @@ -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, diff --git a/webcit/useredit.c b/webcit/useredit.c index b0ccd1a2a..35e768cd9 100644 --- a/webcit/useredit.c +++ b/webcit/useredit.c @@ -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\">\n"); + wprintf(""); + wprintf(_("Permission to send Internet mail")); + wprintf(""); + wprintf("\n"); + wprintf(""); wprintf(_("Number of logins")); wprintf("" @@ -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"), diff --git a/webcit/webcit.h b/webcit/webcit.h index e365a9f96..6e9852c8f 100644 --- a/webcit/webcit.h +++ b/webcit/webcit.h @@ -142,6 +142,25 @@ #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 /* ext & 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 ) -- 2.39.2