* citadel.h (and related files): removed defunct parameters,
authorArt Cancro <ajc@citadel.org>
Sat, 7 Nov 1998 01:38:25 +0000 (01:38 +0000)
committerArt Cancro <ajc@citadel.org>
Sat, 7 Nov 1998 01:38:25 +0000 (01:38 +0000)
          c_defent and c_msgbase (erase your test bbs)
        * Began implementing CONF server command for site-global configs

citadel/ChangeLog
citadel/citadel.h
citadel/citserver.c
citadel/control.c
citadel/control.h
citadel/import.c
citadel/serv_upgrade.c
citadel/techdoc/session.txt

index 9890c4fa46822955de415b074371519325f04696..9da9eff5d8c20248486046a019cd21f9c7c0093e 100644 (file)
@@ -1,3 +1,8 @@
+Fri Nov  6 20:22:20 EST 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
+       * citadel.h (and related files): removed defunct parameters,
+         c_defent and c_msgbase (erase your test bbs)
+       * Began implementing CONF server command for site-global configs
+
 1998-11-05 Nathan Bryant <bryant@cs.usm.maine.edu>
        * snprintf.c: warning fix propagated over from gcit
 
index 1a5aa805b3b0612858901520e68cccfe2bd348c2..8f519dcd93274a840eb3025b000e9ba7caca7982 100644 (file)
@@ -59,7 +59,6 @@ struct config {
        char c_regiscall;               /* call number to register on       */
        char c_twitdetect;              /* twit detect flag                 */
        char c_twitroom[ROOMNAMELEN];   /* twit detect msg move to room     */
-       int c_defent;                   /* command generated by <E> key     */
        char c_moreprompt[80];          /* paginator prompt                 */
        char c_restrict;                /* restrict Internet mail flag      */
        long c_msgbase;                 /* size of message base             */
@@ -72,6 +71,7 @@ struct config {
        int c_port_number;              /* TCP port to run the server on    */
        int c_ipgm_secret;              /* Internal program authentication  */
        struct ExpirePolicy c_ep;       /* System default msg expire policy */
+       int c_userpurge;                /* System default user purge (days) */
        };
 
 #define NODENAME               config.c_nodename
@@ -105,6 +105,7 @@ struct usersupp {                   /* User record                      */
        char USzip[10];                 /* ZIP code                         */
        char USphone[11];               /* Voice telephone number           */
        char USemail[32];               /* E-mail address (elsewhere)       */
+       int USuserpurge;                /* Purge time (in days) for user    */
        };
 
 
index fc58d166b9640b6b8a819a54801a53857b308d08..ca34147a783011f0667dd4c200f311716041d418 100644 (file)
@@ -28,6 +28,7 @@
 #include "file_ops.h"
 #include "dynloader.h"
 #include "policy.h"
+#include "control.h"
 
 struct CitContext *ContextList = NULL;
 int ScheduledShutdown = 0;
@@ -1067,6 +1068,10 @@ void *context_loop(struct CitContext *con)
                        cmd_spex(&cmdbuf[5]);
                        }
 
+               else if (!strncasecmp(cmdbuf, "CONF", 4)) {
+                       cmd_conf(&cmdbuf[5]);
+                       }
+
                else if (!DLoader_Exec_Cmd(cmdbuf))
                        {
                           cprintf("%d Unrecognized or unsupported command.\n",
index 540863412d6d9d36b08372d5054f6cdb964c9dc5..44d8cdb4a48db9fed5ea2ec5a3bcd6b63d08de15 100644 (file)
 #include "server.h"
 #include "control.h"
 #include "sysdep_decls.h"
+#include "support.h"
 
 struct CitControl CitControl;
+struct config config;
 
 /*
  * get_control  -  read the control record into memory.
@@ -81,3 +83,59 @@ long get_new_user_number(void) {
        end_critical_section(S_CONTROL);
        return(CitControl.MMnextuser);
        }
+
+
+
+/* 
+ * Get or set global configuration options
+ */
+void cmd_conf(char *argbuf) {
+       char cmd[256];
+       char buf[256];
+       int a;
+
+       if (!(CC->logged_in)) {
+               cprintf("%d Not logged in.\n",ERROR+NOT_LOGGED_IN);
+               return;
+               }
+
+       if (CC->usersupp.axlevel < 6) {
+               cprintf("%d Higher access required.\n",
+                       ERROR+HIGHER_ACCESS_REQUIRED);
+               return;
+               }
+
+       extract(cmd, argbuf, 0);
+       if (!strcasecmp(cmd, "GET")) {
+               cprintf("%d Configuration...\n", LISTING_FOLLOWS);
+               cprintf("%s\n", config.c_nodename);
+               cprintf("%s\n", config.c_fqdn);
+               cprintf("%s\n", config.c_humannode);
+               cprintf("%s\n", config.c_phonenum);
+               cprintf("%d\n", config.c_creataide);
+               cprintf("%d\n", config.c_sleeping);
+               cprintf("%d\n", config.c_initax);
+               cprintf("%d\n", config.c_regiscall);
+               cprintf("%d\n", config.c_twitdetect);
+               cprintf("%s\n", config.c_twitroom);
+               cprintf("%s\n", config.c_moreprompt);
+               cprintf("%d\n", config.c_restrict);
+               cprintf("%s\n", config.c_bbs_city);
+               cprintf("%s\n", config.c_sysadm);
+               cprintf("%d\n", config.c_maxsessions);
+               cprintf("%s\n", config.c_net_password);
+               cprintf("%d\n", config.c_userpurge);
+               cprintf("000\n");
+               }
+
+       /*      
+       else if (!strcasecmp(cmd, "SET")) {
+               cprintf("%d Send configuration...\n");
+               }
+       */
+
+       else {
+               cprintf("%d The only valid options are GET and SET.\n",
+                       ERROR+ILLEGAL_VALUE);
+               }
+       }
index 17967bc471c9fc0fa7341948ca01049bc9ba4c31..04f73036f861eaaed1ae61f7f7332efe2f6d3860 100644 (file)
@@ -3,3 +3,4 @@ void get_control (void);
 void put_control (void);
 long int get_new_message_number (void);
 long int get_new_user_number (void);
+void cmd_conf(char *argbuf);
index 812d8ecccd3204e3cff4aa69b5c5ad304c86c644..9a72f4cb29349daa281091ec5d4d830fde761c78 100644 (file)
@@ -115,8 +115,6 @@ void imp_config() {
                        config.c_twitdetect = atoi(value);
                if (!strcasecmp(key, "c_twitroom"))
                        strcpy(config.c_twitroom, value);
-               if (!strcasecmp(key, "c_defent"))
-                       config.c_defent = atoi(value);
                if (!strcasecmp(key, "c_moreprompt"))
                        strcpy(config.c_moreprompt, value);
                if (!strcasecmp(key, "c_restrict"))
index 8f39b2b8ff821186b842abb7568fa86ae064115a..35c6e8677c4e0a6b3897ab32baf2a3bddfdadb44 100644 (file)
@@ -368,8 +368,6 @@ void imp_config(void) {
                        config.c_twitdetect = atoi(value);
                if (!strcasecmp(key, "c_twitroom"))
                        strcpy(config.c_twitroom, value);
-               if (!strcasecmp(key, "c_defent"))
-                       config.c_defent = atoi(value);
                if (!strcasecmp(key, "c_moreprompt"))
                        strcpy(config.c_moreprompt, value);
                if (!strcasecmp(key, "c_restrict"))
@@ -648,7 +646,6 @@ void do_export(char *argbuf) {
        fprintf(exfp, "c_regiscall%c%d%c", 0, config.c_regiscall, 0);
        fprintf(exfp, "c_twitdetect%c%d%c", 0, config.c_twitdetect, 0);
        fprintf(exfp, "c_twitroom%c%s%c", 0, config.c_twitroom, 0);
-       fprintf(exfp, "c_defent%c%d%c", 0, config.c_defent, 0);
        fprintf(exfp, "c_moreprompt%c%s%c", 0, config.c_moreprompt, 0);
        fprintf(exfp, "c_restrict%c%d%c", 0, config.c_restrict, 0);
        fprintf(exfp, "c_bbs_city%c%s%c", 0, config.c_bbs_city, 0);
index 2bd0f652e96ceb965d0367e72c9d015b17f0864c..6c2d14f782cda3df5d3a1184bee0ce662e3ff0f0 100644 (file)
@@ -1642,3 +1642,37 @@ the list of available policies.
  The value of <which> must be one of: "room" "floor" "site"
  
  If successful, GPEX returns OK; otherwise, an ERROR code is returned.
+ CONF   (get or set global CONFiguration options)
+ Retrieves or sets various system-wide configuration and policy options.  This
+command is only available to Aides.  The sole parameter accepted is a command,
+which should be either GET or SET.  If the GET command succeeds, CONF will
+return LISTING_FOLLOWS followed by the fields described below, one line at a
+time.  If the SET command succeeds, CONF will return SEND_LISTING and expect
+the fields described below, one line at a time (don't worry about other fields
+being added in the future; if a 'short' configuration list is sent, the missing
+values at the end will be left unchanged on the system).  If either command
+fails for any reason, ERROR is returned.
+ The configuration lines are as follows:
+ 1. Node name
+ 2. Fully qualified domain name
+ 3. Human-readable node name
+ 4. Landline telephone number of this system
+ 5. Flag (0 or 1) - creator of private room automatically becomes room aide
+ 6. Server connection idle timeout (in seconds)
+ 7. Initial access level for new users
+ 8. Flag (0 or 1) - require registration for new users
+ 9. Flag (0 or 1) - automatically move Problem User messages to twit room
+ 10. Name of twit room
+ 11. Text of <more> prompt
+ 12. Flag (0 or 1) - restrict access to Internet mail
+ 13. Geographic location of this system
+ 14. Name of the system administrator
+ 15. Number of maximum concurrent sessions allowed on the server
+ 16. Password for server-to-server networking
+ 17. Default purge time (in days) for users