$Log$
+ Revision 580.22 2001/08/11 19:18:41 ajc
+ * Realized that I am stupid and started implementing server commands to load
+ and save network configurations, when I had already lovingly implemented the
+ CONF GETSYS and CONF PUTSYS commands to store arbitrary configuration sets
+ in the Local System Configuration> room. Ripped the newer crap out.
+ * Implemented a skeleton of <.A>ide <S>ysconfig <N>etwork on the client side.
+
Revision 580.21 2001/08/11 03:51:56 ajc
* Removed the idle timer from the client. Dialup is dead.
Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
* Initial CVS import
-
mailing_list_management();
break;
+ case 88:
+ do_ignet_configuration();
+ break;
+
case 6:
gotonext();
break;
*/
#define SPOOLMIME "application/x-citadel-delivery-list"
#define INTERNETCFG "application/x-citadel-internet-config"
+#define IGNETCFG "application/x-citadel-ignet-config"
#define TRACE lprintf(9, "Checkpoint: %s, %d\n", __FILE__, __LINE__)
cmd=80,2,&.,&Aide,&System configuration,&General
cmd=82,2,&.,&Aide,&System configuration,&Internet
cmd=83,2,&.,&Aide,&System configuration,check &Message base
+cmd=88,2,&.,&Aide,&System configuration,&Network
cmd=85,2,&.,&Aide,&Terminate server,&Now
cmd=86,2,&.,&Aide,&Terminate server,&Scheduled
cmd=87,1,&.,&Aide,mailing &List management
unlink(filename); /* Delete the temporary files */
unlink(changefile);
}
+
+
+/*
+ * IGnet node configuration
+ */
+void do_ignet_configuration(void) {
+ char buf[SIZ];
+ int num_recs = 0;
+ char **recs = NULL;
+ char ch;
+ int badkey;
+ int i, j;
+ int quitting = 0;
+
+
+ sprintf(buf, "CONF getsys|%s", IGNETCFG);
+ serv_puts(buf);
+ serv_gets(buf);
+ if (buf[0] == '1') while (serv_gets(buf), strcmp(buf, "000")) {
+ ++num_recs;
+ if (num_recs == 1) recs = malloc(sizeof(char *));
+ else recs = realloc(recs, (sizeof(char *)) * num_recs);
+ recs[num_recs-1] = malloc(SIZ);
+ strcpy(recs[num_recs-1], buf);
+ }
+
+ do {
+ printf("\n");
+ color(BRIGHT_WHITE);
+ printf("### ");
+ printf(" Node ");
+ printf(" Secret \n");
+ color(DIM_WHITE);
+ printf("--- ");
+ printf("---------------- ");
+ printf("--------------------\n");
+ for (i=0; i<num_recs; ++i) {
+ color(DIM_WHITE);
+ printf("%3d ", i+1);
+ extract(buf, recs[i], 0);
+ color(BRIGHT_CYAN);
+ printf("%-16s ", buf);
+ extract(buf, recs[i], 1);
+ color(BRIGHT_MAGENTA);
+ printf("%-16s\n", buf);
+ color(DIM_WHITE);
+ }
+
+ ch = keymenu("", "<A>dd|<D>elete|<S>ave|<Q>uit");
+ switch(ch) {
+ case 'a':
+ ++num_recs;
+ if (num_recs == 1)
+ recs = malloc(sizeof(char *));
+ else recs = realloc(recs,
+ (sizeof(char *)) * num_recs);
+ newprompt("Enter host name : ", buf, 16);
+ strcat(buf, "|");
+ newprompt("Enter shared secret: ",
+ &buf[strlen(buf)], 16);
+ recs[num_recs-1] = strdup(buf);
+ break;
+ case 'd':
+ i = intprompt("Delete which one",
+ 1, 1, num_recs) - 1;
+ free(recs[i]);
+ --num_recs;
+ for (j=i; j<num_recs; ++j)
+ recs[j] = recs[j+1];
+ break;
+ case 's':
+ sprintf(buf, "CONF putsys|%s", IGNETCFG);
+ serv_puts(buf);
+ serv_gets(buf);
+ if (buf[0] == '4') {
+ for (i=0; i<num_recs; ++i) {
+ serv_puts(recs[i]);
+ }
+ serv_puts("000");
+ }
+ else {
+ printf("%s\n", &buf[4]);
+ }
+ quitting = 1;
+ break;
+ case 'q':
+ quitting = boolprompt(
+ "Quit without saving", 0);
+ break;
+ default:
+ badkey = 1;
+ }
+ } while (quitting == 0);
+
+ if (recs != NULL) {
+ for (i=0; i<num_recs; ++i) free(recs[i]);
+ free(recs);
+ }
+}
+
+
void cli_image_upload(char *keyname);
int room_prompt(int qrflags);
void do_internet_configuration(void);
+void do_ignet_configuration(void);
void mailing_list_management(void);
}
-
-/*
- * Add, change, or delete network nodes
- */
-void cmd_node(char *argbuf) {
- char command[SIZ];
- char nodename[SIZ];
- char secret[SIZ];
- FILE *fp;
-
- if (CtdlAccessCheck(ac_aide)) return;
-
- extract(command, argbuf, 0);
-
- if (!strcasecmp(command, "add")) {
- cprintf("%d bloopyblard\n", ERROR);
- return;
- }
-
- else {
- cprintf("%d Illegal option(s) specified.\n",
- ERROR+ILLEGAL_VALUE);
- return;
- }
-}
-
-
-
-
/*
* Module entry point
*/
{
CtdlRegisterProtoHook(cmd_gnet, "GNET", "Get network config");
CtdlRegisterProtoHook(cmd_snet, "SNET", "Get network config");
- CtdlRegisterProtoHook(cmd_node, "NODE", "Modify network nodes");
CtdlRegisterSessionHook(network_do_queue, EVT_TIMER);
return "$Id$";
}
CtdlAllocUserData(SYM_SMTP_RECP, SIZ);
sprintf(SMTP_RECP, "%s", "");
- cprintf("220 Citadel/UX ESMTP server at %s ready.\r\n",
- config.c_fqdn);
+ cprintf("220 %s ESMTP Citadel/UX server ready.\r\n", config.c_fqdn);
}
cprintf("250 Greetings and joyous salutations.\r\n");
}
else {
- cprintf("250-Greetings and joyous salutations.\r\n");
+ cprintf("250-Extended greetings and joyous salutations.\r\n");
cprintf("250-HELP\r\n");
cprintf("250-SIZE %ld\r\n", config.c_maxmsglen);
cprintf("250 AUTH=LOGIN\r\n");
26. Default moderation filter level for new users (-63 to +63)
27. Flag (0 or 1) - allow Aides to zap (forget) rooms
28. Port number for IMAP service
+
+ CONF also accepts two additional commands: GETSYS and PUTSYS followed by an
+arbitrary MIME type (such as application/x-citadel-internet-config) which
+provides a means of storing generic configuration data in the Global System
+Configuration room without the need to add extra get/set commands to the
+server.
EXPI (EXPIre system objects)