+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
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 */
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
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 */
};
#include "file_ops.h"
#include "dynloader.h"
#include "policy.h"
+#include "control.h"
struct CitContext *ContextList = NULL;
int ScheduledShutdown = 0;
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",
#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.
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);
+ }
+ }
void put_control (void);
long int get_new_message_number (void);
long int get_new_user_number (void);
+void cmd_conf(char *argbuf);
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"))
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"))
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);
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