]> code.citadel.org Git - citadel.git/commitdiff
Client: added <.A>ide <S>ystem configuration command
authorArt Cancro <ajc@citadel.org>
Sun, 25 Oct 1998 03:47:19 +0000 (03:47 +0000)
committerArt Cancro <ajc@citadel.org>
Sun, 25 Oct 1998 03:47:19 +0000 (03:47 +0000)
citadel/ChangeLog
citadel/citadel.c
citadel/citadel.rc
citadel/citadel_decls.h
citadel/routines2.c

index 02305c3b9ee5ea99949b1d5e4ebeb46b14904ea5..bbc401fa126bf028d82d457c4fd1fd662beaaf01 100644 (file)
@@ -1,5 +1,6 @@
 Sat Oct 24 22:07:56 EDT 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
        * Client: added message expiration policy questions to room edit
+       * Client: added <.A>ide <S>ystem configuration command
 
 1998-10-24 Nathan Bryant <bryant@cs.usm.maine.edu>
        * Makefile.in: Auto dependency generation (may require GNU make, but
index 7ee7c9bc3c871752f221aed9ac030ec2125402ba..f0ee9303644b938e1eb0a63e83ad3d1caa336140 100644 (file)
@@ -1147,6 +1147,10 @@ case 79:
        who_is_online(1);
        break;
 
+case 80:
+       do_system_configuration();
+       break;
+
 case 50:
        enter_config(2);
        break;
index f4345a0f69b9d19f8a3bb65507b2d6b114b132c7..83253fa684b88e7d5e746fe94844eddd893b33f2 100644 (file)
@@ -155,6 +155,8 @@ cmd=53,1,&.,&Aide,&File,&Send over net
 cmd=54,1,&.,&Aide,&File,&Move
 cmd=70,2,&.,&Aide,&Message edit:
 cmd=78,1,&.,&Aide,&Post
+cmd=80,2,&.,&Aide,&System configuration
+
 cmd=29,0,&.,&Terminate,and &Quit
 cmd=30,0,&.,&Terminate,and &Stay online
 cmd=32,0,&.,&Read,&User listing
@@ -215,7 +217,6 @@ cmd=68,0,&;,&Known rooms
 cmd=66,0,&.,&Enter,&Bio
 cmd=67,0,&.,&Read,&Bio
 
-
 cmd=79,0,&.,&Wholist,&Long
 cmd=75,0,&.,&Wholist,&Roomname
 cmd=76,0,&.,&Wholist,&Hostname
index e1415336b62c25ae6015ea858b5ac7b490cb9299..26f64b887eb79abf6b9aef63149b6ddfff19bbe4 100644 (file)
@@ -16,3 +16,4 @@ extern char express_msgs;
 void logoff(int code);
 void formout(char *name);
 void sighandler(int which_sig);
+void do_system_configuration(void);
index b75124c209875cd212f152579d6092d59b5683d2..000a75eee5336dff83f6df836c9050076994e6cd 100644 (file)
@@ -17,6 +17,7 @@
 #include <errno.h>
 #include "citadel.h"
 #include "routines2.h"
+#include "routines.h"
 
 void interr(int errnum);
 void strprompt(char *prompt, char *str, int len);
@@ -30,7 +31,6 @@ int haschar(char *st, int ch);
 void progress(long int curr, long int cmax);
 void citedit(FILE *fp, long int base_pos);
 int yesno(void);
-void nukedir(char *dirname);
 
 extern char temp[];
 extern char tempdir[];
@@ -576,3 +576,56 @@ void read_bio(void) {
                printf("%s\n",buf);
                }
        }
+
+
+/* 
+ * General system configuration command
+ */
+void do_system_configuration() {
+       char buf[256];
+       int expire_mode = 0;
+       int expire_value = 0;
+
+       /* Fetch the expire policy (this will silently fail on old servers,
+        * resulting in "default" policy)
+        */
+       serv_puts("GPEX site");
+       serv_gets(buf);
+       if (buf[0]=='2') {
+               expire_mode = extract_int(&buf[4], 0);
+               expire_value = extract_int(&buf[4], 1);
+               }
+
+       /* Angels and demons dancing in my head... */
+       do {
+               sprintf(buf, "%d", expire_mode);
+               strprompt("System default essage expire policy (? for list)",
+                       buf, 1);
+               if (buf[0] == '?') {
+                       printf("\n");
+                       printf("1. Never automatically expire messages\n");
+                       printf("2. Expire by message count\n");
+                       printf("3. Expire by message age\n");
+                       }
+               } while((buf[0]<49)||(buf[0]>51));
+       expire_mode = buf[0] - 48;
+
+       /* ...lunatics and monsters underneath my bed */
+       if (expire_mode == 2) {
+               sprintf(buf, "%d", expire_value);
+               strprompt("Keep how many messages online?", buf, 10);
+               expire_value = atol(buf);
+               }
+
+       if (expire_mode == 3) {
+               sprintf(buf, "%d", expire_value);
+               strprompt("Keep messages for how many days?", buf, 10);
+               expire_value = atol(buf);
+               }
+
+       /* Save it */
+       snprintf(buf, sizeof buf, "SPEX site|%d|%d",
+               expire_mode, expire_value);
+       serv_puts(buf);
+       serv_gets(buf);
+       }