-/* $Id$
- *
+/*
* Configuration screens that are part of the text mode client.
*
*/
void do_system_configuration(CtdlIPC *ipc)
{
-#define NUM_CONFIGS 67
+#define NUM_CONFIGS 68
char buf[256];
char sc[NUM_CONFIGS][256];
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[4], sizeof sc[4], "%d", (boolprompt(
"Automatically give room aide privs to a user who creates a private room",
atoi(&sc[4][0]))));
"Automatically delete committed database logs",
atoi(&sc[43][0]))));
- strprompt("Server IP address (0.0.0.0 for 'any')", &sc[37][0], 15);
+ strprompt("Server IP address (* for 'any')", &sc[37][0], 15);
strprompt("POP3 server port (-1 to disable)", &sc[23][0], 5);
strprompt("POP3S server port (-1 to disable)", &sc[40][0], 5);
strprompt("IMAP server port (-1 to disable)", &sc[27][0], 5);
r += 1 + strlen(sc[a]);
resp = (char *)calloc(1, r);
if (!resp) {
- err_printf("Can't save config - out of memory!\n");
+ scr_printf("Can't save config - out of memory!\n");
logoff(ipc, 1);
}
for (a = 0; a < NUM_CONFIGS; a++) {
}
r = CtdlIPCSetSystemConfig(ipc, resp, buf);
if (r / 100 != 4) {
- err_printf("%s\n", buf);
+ scr_printf("%s\n", buf);
}
free(resp);
r = CtdlIPCSetMessageExpirationPolicy(ipc, 2, site_expirepolicy, buf);
if (r / 100 != 2) {
- err_printf("%s\n", buf);
+ scr_printf("%s\n", buf);
}
r = CtdlIPCSetMessageExpirationPolicy(ipc, 3, mbx_expirepolicy, buf);
if (r / 100 != 2) {
- err_printf("%s\n", buf);
+ scr_printf("%s\n", buf);
}
}
int sel;
keyopt(" <1> localhost (Alias for this computer)\n");
- keyopt(" <2> smart-host (Forward all outbound mail to this host)\n");
- keyopt(" <3> directory (Consult the Global Address Book)\n");
- keyopt(" <4> SpamAssassin (Address of SpamAssassin server)\n");
- keyopt(" <5> RBL (domain suffix of spam hunting RBL)\n");
- keyopt(" <6> masq domains (Domains as which users are allowed to masquerade)\n");
- keyopt(" <7> ClamAV (Address of ClamAV clamd server)\n");
- sel = intprompt("Which one", 1, 1, 7);
+ keyopt(" <2> smart host (Forward all outbound mail to this host)\n");
+ keyopt(" <3> fallback host (Send mail to this host only if direct delivery fails)\n");
+ keyopt(" <4> directory (Consult the Global Address Book)\n");
+ keyopt(" <5> SpamAssassin (Address of SpamAssassin server)\n");
+ keyopt(" <6> RBL (domain suffix of spam hunting RBL)\n");
+ keyopt(" <7> masq domains (Domains as which users are allowed to masquerade)\n");
+ keyopt(" <8> ClamAV (Address of ClamAV clamd server)\n");
+ sel = intprompt("Which one", 1, 1, 8);
switch(sel) {
case 1: strcpy(buf, "localhost");
return;
case 2: strcpy(buf, "smarthost");
return;
- case 3: strcpy(buf, "directory");
+ case 3: strcpy(buf, "fallbackhost");
+ return;
+ case 4: strcpy(buf, "directory");
return;
- case 4: strcpy(buf, "spamassassin");
+ case 5: strcpy(buf, "spamassassin");
return;
- case 5: strcpy(buf, "rbl");
+ case 6: strcpy(buf, "rbl");
return;
- case 6: strcpy(buf, "masqdomain");
+ case 7: strcpy(buf, "masqdomain");
return;
- case 7: strcpy(buf, "clamav");
+ case 8: strcpy(buf, "clamav");
return;
}
}
int num_recs = 0;
char **recs = NULL;
char ch;
- int badkey;
int i, j;
int quitting = 0;
int modified = 0;
r += 1 + strlen(recs[i]);
resp = (char *)calloc(1, r);
if (!resp) {
- err_printf("Can't save config - out of memory!\n");
+ scr_printf("Can't save config - out of memory!\n");
logoff(ipc, 1);
}
if (num_recs) for (i = 0; i < num_recs; i++) {
}
r = CtdlIPCSetSystemConfigByType(ipc, INTERNETCFG, resp, buf);
if (r / 100 != 4) {
- err_printf("%s\n", buf);
+ scr_printf("%s\n", buf);
} else {
scr_printf("Wrote %d records.\n", num_recs);
modified = 0;
"Quit without saving", 0);
break;
default:
- badkey = 1;
+ break;
}
} while (!quitting);
tempfp = fopen(filename, "w");
if (tempfp == NULL) {
- err_printf("Cannot open %s: %s\n", filename, strerror(errno));
+ scr_printf("Cannot open %s: %s\n", filename, strerror(errno));
return;
}
fclose(tempfp);
e_ex_code = 1; /* start with a failed exit code */
- screen_reset();
stty_ctdl(SB_RESTORE);
editor_pid = fork();
cksum = file_checksum(filename);
} while ((b != editor_pid) && (b >= 0));
editor_pid = (-1);
stty_ctdl(0);
- screen_set();
}
if (file_checksum(filename) == cksum) {
- err_printf("*** No changes to save.\n");
+ scr_printf("*** No changes to save.\n");
e_ex_code = 1;
}
int num_recs = 0;
char **recs = NULL;
char ch;
- int badkey;
int i, j;
int quitting = 0;
int modified = 0;
r += 1 + strlen(recs[i]);
listing = (char*) calloc(1, r);
if (!listing) {
- err_printf("Can't save config - out of memory!\n");
+ scr_printf("Can't save config - out of memory!\n");
logoff(ipc, 1);
}
if (num_recs) for (i = 0; i < num_recs; ++i) {
"Quit without saving", 0);
break;
default:
- badkey = 1;
+ break;
}
} while (!quitting);
int num_recs = 0;
char **recs = NULL;
char ch;
- int badkey;
int i, j;
int quitting = 0;
int modified = 0;
r += 1 + strlen(recs[i]);
listing = (char*) calloc(1, r);
if (!listing) {
- err_printf("Can't save config - out of memory!\n");
+ scr_printf("Can't save config - out of memory!\n");
logoff(ipc, 1);
}
if (num_recs) for (i = 0; i < num_recs; ++i) {
"Quit without saving", 0);
break;
default:
- badkey = 1;
+ break;
}
} while (!quitting);
int num_recs = 0;
char **recs = NULL;
char ch;
- int badkey;
int i, j;
int quitting = 0;
int modified = 0;
}
listing = (char*) calloc(1, r);
if (!listing) {
- err_printf("Can't save config - out of memory!\n");
+ scr_printf("Can't save config - out of memory!\n");
logoff(ipc, 1);
}
if (num_recs) for (i = 0; i < num_recs; ++i) {
"Quit without saving", 0);
break;
default:
- badkey = 1;
+ break;
}
} while (!quitting);
int num_recs = 0;
char **recs = NULL;
char ch;
- int badkey;
int i, j;
int quitting = 0;
int modified = 0;
}
listing = (char*) calloc(1, r);
if (!listing) {
- err_printf("Can't save config - out of memory!\n");
+ scr_printf("Can't save config - out of memory!\n");
logoff(ipc, 1);
}
if (num_recs) for (i = 0; i < num_recs; ++i) {
"Quit without saving", 0);
break;
default:
- badkey = 1;
+ break;
}
} while (!quitting);