From 6f49b72635d2c113c126eab5579fc5f1a8928bc6 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Fri, 4 Jul 2014 15:20:47 -0400 Subject: [PATCH] NNTP and NNTPS port configurations in both the text and web clients. --- citadel/citadel.h | 12 ++++----- citadel/control.c | 2 +- textclient/src/include/citadel_ipc.h | 2 +- textclient/src/tuiconfig.c | 25 +++++++------------ webcit/siteconfig.c | 8 ++++-- .../static/t/aide/siteconfig/tab_setting.html | 6 +++++ 6 files changed, 28 insertions(+), 27 deletions(-) diff --git a/citadel/citadel.h b/citadel/citadel.h index 8d4b45d7f..9198d4a28 100644 --- a/citadel/citadel.h +++ b/citadel/citadel.h @@ -61,11 +61,9 @@ extern "C" { /* Various length constants */ -#define ROOMNAMELEN 128 /* The size of a roomname string */ - -#define USERNAME_SIZE 64 /* The size of a username string */ -#define MAX_EDITORS 5 /* # of external editors supported */ - /* MUST be at least 1 */ +#define ROOMNAMELEN 128 /* The size of a roomname string */ +#define USERNAME_SIZE 64 /* The size of a username string */ +#define MAX_EDITORS 5 /* number of external editors supported ; must be at least 1 */ /* * Message expiration policy stuff @@ -103,7 +101,7 @@ struct march { * User records. */ typedef struct ctdluser ctdluser; -struct ctdluser { /* User record */ +struct ctdluser { /* User record */ int version; /* Cit vers. which created this rec */ uid_t uid; /* Associate with a unix account? */ char password[32]; /* password */ @@ -188,7 +186,7 @@ struct floor { #define REREGISTER 1 /* existing user reregistering */ /* number of items which may be handled by the CONF command */ -#define NUM_CONFIGS 70 +#define NUM_CONFIGS 71 #define TRACE syslog(LOG_DEBUG, "Checkpoint: %s, %d\n", __FILE__, __LINE__) diff --git a/citadel/control.c b/citadel/control.c index 0aba12404..2a608eee0 100644 --- a/citadel/control.c +++ b/citadel/control.c @@ -663,7 +663,7 @@ void cmd_conf(char *argbuf) config.c_nntp_port = atoi(buf); break; case 71: - config.c_nntp_port = atoi(buf); + config.c_nntps_port = atoi(buf); break; } ++a; diff --git a/textclient/src/include/citadel_ipc.h b/textclient/src/include/citadel_ipc.h index 1236743b2..ac4450b13 100644 --- a/textclient/src/include/citadel_ipc.h +++ b/textclient/src/include/citadel_ipc.h @@ -63,7 +63,7 @@ void calc_dirs_n_files(int relh, int home, const char *relhome, char *ctdldir, #define READ_HEADER 2 #define READ_MSGBODY 3 -#define NUM_CONFIGS 70 +#define NUM_CONFIGS 72 diff --git a/textclient/src/tuiconfig.c b/textclient/src/tuiconfig.c index 89db73163..2748035c7 100644 --- a/textclient/src/tuiconfig.c +++ b/textclient/src/tuiconfig.c @@ -1,7 +1,7 @@ /* * Configuration screens that are part of the text mode client. * - * Copyright (c) 1987-2012 by the citadel.org team + * Copyright (c) 1987-2014 by the citadel.org team * * This program is open source software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 3. @@ -117,17 +117,11 @@ void do_system_configuration(CtdlIPC *ipc) /* Security parameters */ - snprintf(sc[7], sizeof sc[7], "%d", (boolprompt( - "Require registration for new users", - atoi(&sc[7][0])))); - snprintf(sc[29], sizeof sc[29], "%d", (boolprompt( - "Disable self-service user account creation", - atoi(&sc[29][0])))); + snprintf(sc[7], sizeof sc[7], "%d", (boolprompt("Require registration for new users", atoi(&sc[7][0])))); + snprintf(sc[29], sizeof sc[29], "%d", (boolprompt("Disable self-service user account creation", atoi(&sc[29][0])))); strprompt("Initial access level for new users", &sc[6][0], 1); strprompt("Access level required to create rooms", &sc[19][0], 1); - snprintf(sc[67], sizeof sc[67], "%d", (boolprompt( - "Allow anonymous guest logins", - atoi(&sc[67][0])))); + snprintf(sc[67], sizeof sc[67], "%d", (boolprompt("Allow anonymous guest logins", atoi(&sc[67][0])))); snprintf(sc[4], sizeof sc[4], "%d", (boolprompt( "Automatically give room admin privs to a user who creates a private room", atoi(&sc[4][0])))); @@ -185,6 +179,8 @@ void do_system_configuration(CtdlIPC *ipc) strprompt("SMTP MTA server port (-1 to disable)", &sc[24][0], 5); strprompt("SMTP MSA server port (-1 to disable)", &sc[38][0], 5); strprompt("SMTPS server port (-1 to disable)", &sc[41][0], 5); + strprompt("NNTP server port (-1 to disable)", &sc[70][0], 5); + strprompt("NNTPS server port (-1 to disable)", &sc[71][0], 5); strprompt("Postfix TCP Dictionary Port server port (-1 to disable)", &sc[50][0], 5); strprompt("ManageSieve server port (-1 to disable)", &sc[51][0], 5); @@ -197,8 +193,7 @@ void do_system_configuration(CtdlIPC *ipc) */ a = atoi(sc[25]); a = (a ? 0 : 1); - a = boolprompt("Correct forged From: lines during authenticated SMTP", - a); + a = boolprompt("Correct forged From: lines during authenticated SMTP", a); a = (a ? 0 : 1); snprintf(sc[25], sizeof sc[25], "%d", a); @@ -228,10 +223,8 @@ void do_system_configuration(CtdlIPC *ipc) a = (a ? 1 : 0); /* Set only to 1 or 0 */ a = boolprompt("Do you want to configure LDAP authentication?", a); if (a) { - strprompt("Host name of LDAP server", - &sc[32][0], 127); - strprompt("Port number of LDAP service", - &sc[33][0], 5); + strprompt("Host name of LDAP server", &sc[32][0], 127); + strprompt("Port number of LDAP service", &sc[33][0], 5); strprompt("Base DN", &sc[34][0], 255); strprompt("Bind DN (or blank for anonymous bind)", &sc[35][0], 255); strprompt("Password for bind DN (or blank for anonymous bind)", &sc[36][0], 255); diff --git a/webcit/siteconfig.c b/webcit/siteconfig.c index ecfc0cc65..253e1a576 100644 --- a/webcit/siteconfig.c +++ b/webcit/siteconfig.c @@ -1,7 +1,7 @@ /* * Administrative screen for site-wide configuration * - * Copyright (c) 1996-2012 by the citadel.org team + * Copyright (c) 1996-2014 by the citadel.org team * * This program is open source software. You can redistribute it and/or * modify it under the terms of the GNU General Public License, version 3. @@ -210,7 +210,11 @@ CfgMapping ServerConfig[] = { {CFG_STR, 0, 0, "", HKEY("c_pop3_fetch")}, {CFG_STR, 0, 0, "", HKEY("c_pop3_fastest")}, {CFG_YES, 0, 0, "", HKEY("c_spam_flag_only")}, - {CFG_YES, 0, 0, "", HKEY("c_guest_logins")} + {CFG_YES, 0, 0, "", HKEY("c_guest_logins")}, + {CFG_STR, 0, 0, "", HKEY("c_port_number")}, + {CFG_STR, 0, 0, "", HKEY("c_ctdluid")}, + {CFG_STR, 0, 0, "", HKEY("c_nntp_port")}, + {CFG_STR, 0, 0, "", HKEY("c_nntps_port")} }; diff --git a/webcit/static/t/aide/siteconfig/tab_setting.html b/webcit/static/t/aide/siteconfig/tab_setting.html index 651fcc4b3..9a4c6a690 100644 --- a/webcit/static/t/aide/siteconfig/tab_setting.html +++ b/webcit/static/t/aide/siteconfig/tab_setting.html @@ -13,6 +13,12 @@ + + + + + +
-- 2.30.2