]> code.citadel.org Git - citadel.git/commitdiff
* Realized that I am stupid and started implementing server commands to load
authorArt Cancro <ajc@citadel.org>
Sat, 11 Aug 2001 19:18:43 +0000 (19:18 +0000)
committerArt Cancro <ajc@citadel.org>
Sat, 11 Aug 2001 19:18:43 +0000 (19:18 +0000)
  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.

citadel/ChangeLog
citadel/citadel.c
citadel/citadel.h
citadel/citadel.rc
citadel/routines2.c
citadel/routines2.h
citadel/serv_network.c
citadel/serv_smtp.c
citadel/techdoc/session.txt

index 996b9b66f3813c59d2a6a9a3d52b3433f5104f36..2548b209ad3b40a07383a0e7ee6e10bfdfb03522 100644 (file)
@@ -1,4 +1,11 @@
  $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.
 
@@ -2665,4 +2672,3 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import 
-
index d6ef993f2b62f7d5cdef071961390668250ab8db..9221bf387a6dfa8a18a539d5142e2ddf1f19e9a7 100644 (file)
@@ -1389,6 +1389,10 @@ PWOK:
                                mailing_list_management();
                                break;
 
+                       case 88:
+                               do_ignet_configuration();
+                               break;
+
                        case 6:
                                gotonext();
                                break;
index 9b30987b3052442b8eae8d3779fffe1592e7f188..41f331c87b069b8febbd56d7c6914fd7d5457280 100644 (file)
@@ -259,6 +259,7 @@ struct floor {
  */
 #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__)
 
index cefea1279ae93aef47ca23e22f07b009aaac2b19..5aa359c736721203467f0d04b2bc68554eb60141 100644 (file)
@@ -178,6 +178,7 @@ cmd=78,1,&.,&Aide,&Post
 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
index e6deb9e4c811a60d7fb2275073d63aaa484bdbb9..d64d77b631b97ec0bed52239e36d56115c65c3f8 100644 (file)
@@ -1020,3 +1020,104 @@ void mailing_list_management(void) {
        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);
+       }
+}
+
+
index 1374c5eedd0d9eaf2b3372b9841d488077ef670e..7da25d4d05ab1f70536dd791717596a51987238a 100644 (file)
@@ -13,4 +13,5 @@ void read_bio(void);
 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);
index 9c428c8c271ed1462d5d09c11f78078eb7bdb9b7..8eeb9b804e14ca38a8cb3637bf201082d9334d9f 100644 (file)
@@ -340,35 +340,6 @@ void network_do_queue(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
  */
@@ -376,7 +347,6 @@ char *Dynamic_Module_Init(void)
 {
        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$";
 }
index 55d81f57b3d45d3a897f466e21fe8a060c4d7c0d..f10de741f2190dc18be17d15e1433f16e6b2d5c0 100644 (file)
@@ -101,8 +101,7 @@ void smtp_greeting(void) {
        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);
 }
 
 
@@ -117,7 +116,7 @@ void smtp_hello(char *argbuf, int is_esmtp) {
                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");
index 3a93e745efc74d11c1d52d40f8850e0002ac3415..3e580bf35af4be82f814c7b2d5a686232135e0a8 100644 (file)
@@ -1718,6 +1718,12 @@ fails for any reason, ERROR is returned.
  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)