scfgxtrn.c 66.3 KB
Newer Older
rswindell's avatar
rswindell committed
1
2
/* scfgxtrn.c */

3
4
5
6
7
8
/* $Id$ */

/****************************************************************************
 * @format.tab-size 4		(Plain Text/Source Code File Header)			*
 * @format.use-tabs true	(see http://www.synchro.net/ptsc_hdr.html)		*
 *																			*
9
 * Copyright 2013 Rob Swindell - http://www.synchro.net/copyright.html		*
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
 *																			*
 * This program is free software; you can redistribute it and/or			*
 * modify it under the terms of the GNU General Public License				*
 * as published by the Free Software Foundation; either version 2			*
 * of the License, or (at your option) any later version.					*
 * See the GNU General Public License for more details: gpl.txt or			*
 * http://www.fsf.org/copyleft/gpl.html										*
 *																			*
 * Anonymous FTP access to the most recent released source is available at	*
 * ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net	*
 *																			*
 * Anonymous CVS access to the development source and modification history	*
 * is available at cvs.synchro.net:/cvsroot/sbbs, example:					*
 * cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs login			*
 *     (just hit return, no password is necessary)							*
 * cvs -d :pserver:anonymous@cvs.synchro.net:/cvsroot/sbbs checkout src		*
 *																			*
 * For Synchronet coding style and modification guidelines, see				*
 * http://www.synchro.net/source.html										*
 *																			*
 * You are encouraged to submit any modifications (preferably in Unix diff	*
 * format) via e-mail to mods@synchro.net									*
 *																			*
 * Note: If this box doesn't appear square, then you need to fix your tabs.	*
 ****************************************************************************/
rswindell's avatar
rswindell committed
35
36
37
38
39
40
/****************************************************************************/
/* Synchronet configuration utility 										*/
/****************************************************************************/

#include "scfg.h"

41
char *daystr(char days);
42
43
static void hotkey_cfg(void);

44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
static char* monthstr(uint16_t months)
{
	int		i;
	static	char str[256];

	if(months==0)
		return("Any");

	str[0]=0;
	for(i=0;i<12;i++) {
		if((months&(1<<i))==0)
			continue;
		if(str[0])
			strcat(str," ");
		strcat(str,mon[i]);
	}
	
	return(str);
}

64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
static char* mdaystr(long mdays)
{
	int		i;
	char	tmp[16];
	static	char str[256];

	if(mdays==0 || mdays==1)
		return("Any");

	str[0]=0;
	for(i=1;i<32;i++) {
		if((mdays&(1<<i))==0)
			continue;
		if(str[0])
			strcat(str," ");
		sprintf(tmp,"%u",i);
		strcat(str,tmp);
	}
	
	return(str);
}

86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
static char* dropfile(int type, ulong misc)
{
	static char str[128];
	char fname[64]="";

	switch(type) {
		case XTRN_SBBS:
			strcpy(fname,"XTRN.DAT");
			break;
		case XTRN_WWIV:
			strcpy(fname,"CHAIN.TXT");
			break;
		case XTRN_GAP:
			strcpy(fname,"DOOR.SYS");
			break;
		case XTRN_RBBS:
			strcpy(fname,"DORINFO#.DEF");
			break;
		case XTRN_RBBS1:
			strcpy(fname,"DORINFO1.DEF");
            break;
		case XTRN_WILDCAT:
			strcpy(fname,"CALLINFO.BBS");
			break;
		case XTRN_PCBOARD:
			strcpy(fname,"PCBOARD.SYS");
			break;
		case XTRN_SPITFIRE:
			strcpy(fname,"SFDOORS.DAT");
			break;
		case XTRN_UTI:
			strcpy(fname,"UTIDOOR.TXT");
			break;
		case XTRN_SR:
			strcpy(fname,"DOORFILE.SR");
			break;
		case XTRN_TRIBBS:
			strcpy(fname,"TRIBBS.SYS");
			break;
        case XTRN_DOOR32:
            strcpy(fname,"DOOR32.SYS");
            break;
	}

	if(misc&XTRN_LWRCASE)
		strlwr(fname);

	switch(type) {
		case XTRN_SBBS:
			sprintf(str,"%-15s %s","Synchronet",fname);
			break;
		case XTRN_WWIV:
			sprintf(str,"%-15s %s","WWIV",fname);
			break;
		case XTRN_GAP:
			sprintf(str,"%-15s %s","GAP",fname);
			break;
		case XTRN_RBBS:
			sprintf(str,"%-15s %s","RBBS/QuickBBS",fname);
			break;
		case XTRN_RBBS1:
			sprintf(str,"%-15s %s","RBBS/QuickBBS",fname);
            break;
		case XTRN_WILDCAT:
			sprintf(str,"%-15s %s","Wildcat",fname);
			break;
		case XTRN_PCBOARD:
			sprintf(str,"%-15s %s","PCBoard",fname);
			break;
		case XTRN_SPITFIRE:
			sprintf(str,"%-15s %s","SpitFire",fname);
			break;
		case XTRN_UTI:
			sprintf(str,"%-15s %s","MegaMail",fname);
			break;
		case XTRN_SR:
			sprintf(str,"%-15s %s","Solar Realms",fname);
			break;
		case XTRN_TRIBBS:
			sprintf(str,"%-15s %s","TriBBS",fname);
			break;
        case XTRN_DOOR32:
            sprintf(str,"%-15s %s","Mystic",fname);
            break;
		default:
			strcpy(str,"None");
			break; 
	}
	return(str);
}

rswindell's avatar
rswindell committed
177
178
179
180
181
182
183
184
185
void xprogs_cfg()
{
	static int xprogs_dflt;
	int 	i;

while(1) {
	i=0;
	strcpy(opt[i++],"Fixed Events");
	strcpy(opt[i++],"Timed Events");
186
	strcpy(opt[i++],"Native Program List");
rswindell's avatar
rswindell committed
187
	strcpy(opt[i++],"External Editors");
188
	strcpy(opt[i++],"Global Hot Key Events");
189
	strcpy(opt[i++],"Online Programs (Doors)");
rswindell's avatar
rswindell committed
190
191
192
	opt[i][0]=0;
	SETHELP(WHERE);
/*
193
`Online External Programs:`
rswindell's avatar
rswindell committed
194
195
196
197

From this menu, you can configure external events, external editors, or
online external programs (doors).
*/
198
	switch(uifc.list(WIN_ORG|WIN_CHE|WIN_ACT,0,0,0,&xprogs_dflt,0
rswindell's avatar
rswindell committed
199
200
201
202
203
204
		,"External Programs",opt)) {
		case -1:
			i=save_changes(WIN_MID);
            if(i==-1)
                break;
			if(!i) {
205
				cfg.new_install=new_install;
rswindell's avatar
rswindell committed
206
                write_xtrn_cfg(&cfg,backup_level);
207
				write_main_cfg(&cfg,backup_level);
208
                refresh_cfg(&cfg);
209
            }
rswindell's avatar
rswindell committed
210
211
212
213
214
215
216
			return;
		case 0:
			fevents_cfg();
			break;
		case 1:
			tevents_cfg();
			break;
217
		case 2:
rswindell's avatar
rswindell committed
218
219
			natvpgm_cfg();
			break;
220
		case 3:
rswindell's avatar
rswindell committed
221
222
			xedit_cfg();
			break;
223
224
225
226
        case 4:
            hotkey_cfg();
            break;
		case 5:
rswindell's avatar
rswindell committed
227
			xtrnsec_cfg();
228
229
230
			break; 
		}
	}
rswindell's avatar
rswindell committed
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
}

void fevents_cfg()
{
	static int event_dflt;
	int i;

while(1) {
	i=0;
	sprintf(opt[i++],"%-32.32s%.40s","Logon Event",cfg.sys_logon);
	sprintf(opt[i++],"%-32.32s%.40s","Logout Event",cfg.sys_logout);
	sprintf(opt[i++],"%-32.32s%.40s","Daily Event",cfg.sys_daily);
	opt[i][0]=0;
	SETHELP(WHERE);
/*
246
`External Events:`
rswindell's avatar
rswindell committed
247
248
249
250

From this menu, you can configure the logon and logout events, and the
system daily event.
*/
251
	switch(uifc.list(WIN_ACT|WIN_SAV|WIN_CHE|WIN_BOT|WIN_RHT,0,0,60,&event_dflt,0
rswindell's avatar
rswindell committed
252
253
254
255
256
257
		,"Fixed Events",opt)) {
		case -1:
			return;
		case 0:
			SETHELP(WHERE);
/*
258
`Logon Event:`
rswindell's avatar
rswindell committed
259
260
261
262
263
264
265
266
267

This is the command line for a program that will execute during the
logon sequence of every user. The program cannot have user interaction.
The program will be executed after the LOGON message is displayed and
before the logon user list is displayed. If you wish to place a program
in the logon sequence of users that includes interaction or requires
account information, you probably want to use an online external
program configured to run as a logon event.
*/
268
			uifc.input(WIN_MID|WIN_SAV,0,0,"Logon Event"
269
				,cfg.sys_logon,sizeof(cfg.sys_logon)-1,K_EDIT);
rswindell's avatar
rswindell committed
270
271
272
273
			break;
		case 1:
			SETHELP(WHERE);
/*
274
`Logout Event:`
rswindell's avatar
rswindell committed
275
276
277
278
279

This is the command line for a program that will execute during the
logout sequence of every user. This program cannot have user
interaction because it is executed after carrier is dropped. If you
wish to have a program execute before carrier is dropped, you probably
280
want to use an `Online External Program` configured to run as a logoff
rswindell's avatar
rswindell committed
281
282
event.
*/
283
			uifc.input(WIN_MID|WIN_SAV,0,0,"Logout Event"
284
				,cfg.sys_logout,sizeof(cfg.sys_logout)-1,K_EDIT);
rswindell's avatar
rswindell committed
285
286
287
288
			break;
		case 2:
			SETHELP(WHERE);
/*
289
`Daily Event:`
rswindell's avatar
rswindell committed
290
291
292
293

This is the command line for a program that will run after the first
user that logs on after midnight, logs off (regardless of what node).
*/
294
			uifc.input(WIN_MID|WIN_SAV,0,0,"Daily Event"
295
				,cfg.sys_daily,sizeof(cfg.sys_daily)-1,K_EDIT);
rswindell's avatar
rswindell committed
296

297
298
299
			break; 
		} 
	}
rswindell's avatar
rswindell committed
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
}

void tevents_cfg()
{
	static int dflt,dfltopt,bar;
	char str[81],done=0,*p;
	int j,k;
	uint i;
	static event_t savevent;

while(1) {
	for(i=0;i<cfg.total_events && i<MAX_OPTS;i++)
		sprintf(opt[i],"%-8.8s      %.50s",cfg.event[i]->code,cfg.event[i]->cmd);
	opt[i][0]=0;
	j=WIN_SAV|WIN_ACT|WIN_CHE|WIN_RHT;
	if(cfg.total_events)
		j|=WIN_DEL|WIN_GET;
	if(cfg.total_events<MAX_OPTS)
318
		j|=WIN_INS|WIN_INSACT|WIN_XTR;
rswindell's avatar
rswindell committed
319
320
321
322
	if(savevent.code[0])
		j|=WIN_PUT;
	SETHELP(WHERE);
/*
323
`Timed Events:`
rswindell's avatar
rswindell committed
324
325
326

This is a list of the configured timed external events.

327
To add an event hit ~ INS ~.
rswindell's avatar
rswindell committed
328

329
To delete an event, select it and hit ~ DEL ~.
rswindell's avatar
rswindell committed
330

331
To configure an event, select it and hit ~ ENTER ~.
rswindell's avatar
rswindell committed
332
*/
333
	i=uifc.list(j,0,0,45,&dflt,&bar,"Timed Events",opt);
rswindell's avatar
rswindell committed
334
335
336
337
338
339
	if((signed)i==-1)
		return;
	if((i&MSK_ON)==MSK_INS) {
		i=cfg.total_events;
		SETHELP(WHERE);
/*
340
`Timed Event Internal Code:`
rswindell's avatar
rswindell committed
341
342
343

This is the internal code for the timed event.
*/
344
		if(uifc.input(WIN_MID|WIN_SAV,0,0,"Event Internal Code",str,LEN_CODE
rswindell's avatar
rswindell committed
345
346
			,K_UPPER)<1)
            continue;
deuce's avatar
deuce committed
347
		if((cfg.event=(event_t **)realloc(cfg.event
rswindell's avatar
rswindell committed
348
349
350
351
			,sizeof(event_t *)*(cfg.total_events+1)))==NULL) {
			errormsg(WHERE,ERR_ALLOC,nulstr,cfg.total_events+1);
			cfg.total_events=0;
			bail(1);
352
353
            continue; 
		}
deuce's avatar
deuce committed
354
		if((cfg.event[i]=(event_t *)malloc(sizeof(event_t)))==NULL) {
rswindell's avatar
rswindell committed
355
			errormsg(WHERE,ERR_ALLOC,nulstr,sizeof(event_t));
356
357
			continue; 
		}
rswindell's avatar
rswindell committed
358
359
360
		memset((event_t *)cfg.event[i],0,sizeof(event_t));
		strcpy(cfg.event[i]->code,str);
		cfg.event[i]->node=1;
361
		cfg.event[i]->days=(uchar)0xff;
rswindell's avatar
rswindell committed
362
		cfg.total_events++;
363
		uifc.changes=1;
364
365
		continue; 
	}
rswindell's avatar
rswindell committed
366
367
	if((i&MSK_ON)==MSK_DEL) {
		i&=MSK_OFF;
deuce's avatar
deuce committed
368
		free(cfg.event[i]);
rswindell's avatar
rswindell committed
369
370
371
		cfg.total_events--;
		for(j=i;j<cfg.total_events;j++)
			cfg.event[j]=cfg.event[j+1];
372
		uifc.changes=1;
373
374
		continue; 
	}
rswindell's avatar
rswindell committed
375
376
377
	if((i&MSK_ON)==MSK_GET) {
		i&=MSK_OFF;
		savevent=*cfg.event[i];
378
379
		continue; 
	}
rswindell's avatar
rswindell committed
380
381
382
	if((i&MSK_ON)==MSK_PUT) {
		i&=MSK_OFF;
		*cfg.event[i]=savevent;
383
		uifc.changes=1;
384
385
        continue; 
	}
rswindell's avatar
rswindell committed
386
387
388
389
390
391
	done=0;
	while(!done) {
		k=0;
		sprintf(opt[k++],"%-32.32s%s","Internal Code",cfg.event[i]->code);
		sprintf(opt[k++],"%-32.32s%.40s","Start-up Directory",cfg.event[i]->dir);
		sprintf(opt[k++],"%-32.32s%.40s","Command Line",cfg.event[i]->cmd);
392
393
		sprintf(opt[k++],"%-32.32s%s","Enabled"
			,cfg.event[i]->misc&EVENT_DISABLED ? "No":"Yes");
rswindell's avatar
rswindell committed
394
		sprintf(opt[k++],"%-32.32s%u","Execution Node",cfg.event[i]->node);
395
396
		sprintf(opt[k++],"%-32.32s%s","Execution Months"
			,monthstr(cfg.event[i]->months));
397
398
		sprintf(opt[k++],"%-32.32s%s","Execution Days of Month"
			,mdaystr(cfg.event[i]->mdays));
399
		sprintf(opt[k++],"%-32.32s%s","Execution Days of Week",daystr(cfg.event[i]->days));
400
401
402
403
404
405
406
407
        if(cfg.event[i]->freq) {
            sprintf(str,"%u times a day",1440/cfg.event[i]->freq);
            sprintf(opt[k++],"%-32.32s%s","Execution Frequency",str);
        } else {
            sprintf(str,"%2.2u:%2.2u"
                ,cfg.event[i]->time/60,cfg.event[i]->time%60);
            sprintf(opt[k++],"%-32.32s%s","Execution Time",str);
        }
rswindell's avatar
rswindell committed
408
409
410
411
		sprintf(opt[k++],"%-32.32s%s","Requires Exclusive Execution"
			,cfg.event[i]->misc&EVENT_EXCL ? "Yes":"No");
		sprintf(opt[k++],"%-32.32s%s","Force Users Off-line For Event"
			,cfg.event[i]->misc&EVENT_FORCE ? "Yes":"No");
412
		sprintf(opt[k++],"%-32.32s%s","Native Executable"
413
			,cfg.event[i]->misc&EX_NATIVE ? "Yes" : "No");
414
415
		sprintf(opt[k++],"%-32.32s%s","Use Shell to Execute"
			,cfg.event[i]->misc&XTRN_SH ? "Yes" : "No");
416
417
		sprintf(opt[k++],"%-32.32s%s","Background Execution"
			,cfg.event[i]->misc&EX_BG ? "Yes" : "No");
418
		sprintf(opt[k++],"%-32.32s%s","Always Run After Init/Re-init"
419
			,cfg.event[i]->misc&EVENT_INIT ? "Yes":"No");
420

rswindell's avatar
rswindell committed
421
422
423
		opt[k][0]=0;
		SETHELP(WHERE);
/*
424
`Timed Event:`
rswindell's avatar
rswindell committed
425
426
427
428
429
430
431
432

This is the configuration menu for a timed event. An event is an
external program that performs some type of automated function on the
system. Use this menu to configure how and when this event will be
executed.

If you need the BBS to swap out of memory for this event (to make more
available memory), add the program name (first word of the command line)
433
to `Global Swap List` from the `External Programs` menu.
rswindell's avatar
rswindell committed
434
435
*/
		sprintf(str,"%s Timed Event",cfg.event[i]->code);
436
		switch(uifc.list(WIN_SAV|WIN_ACT|WIN_L2R|WIN_BOT,0,0,70,&dfltopt,0
rswindell's avatar
rswindell committed
437
438
439
440
441
442
443
444
			,str,opt)) {
			case -1:
				done=1;
				break;
			case 0:
				strcpy(str,cfg.event[i]->code);
				SETHELP(WHERE);
/*
445
`Timed Event Internal Code:`
rswindell's avatar
rswindell committed
446
447
448
449
450

Every timed event must have its own unique internal code for Synchronet
to reference it by. It is helpful if this code is an abreviation of the
command line.
*/
451
				uifc.input(WIN_MID|WIN_SAV,0,17,"Internal Code (unique)"
452
					,str,LEN_CODE,K_EDIT|K_UPPER);
rswindell's avatar
rswindell committed
453
454
455
				if(code_ok(str))
					strcpy(cfg.event[i]->code,str);
				else {
456
457
					uifc.helpbuf=invalid_code;
					uifc.msg("Invalid Code");
458
459
					uifc.helpbuf=0; 
				}
rswindell's avatar
rswindell committed
460
461
462
463
                break;
			case 1:
				SETHELP(WHERE);
/*
464
`Timed Event Start-up Directory:`
rswindell's avatar
rswindell committed
465
466
467
468
469
470
471
472
473
474

This is the DOS drive/directory where the event program is located.
If a path is specified here, it will be made the current directory
before the event's command line is executed. This eliminates the need
for batch files that just change the current drive and directory before
executing the event.

If this option is not used, the current NODE's directory will be the
current DOS drive/directory before the command line is executed.
*/
475
				uifc.input(WIN_MID|WIN_SAV,0,10,"Directory"
476
					,cfg.event[i]->dir,sizeof(cfg.event[i]->dir)-1,K_EDIT);
rswindell's avatar
rswindell committed
477
478
479
480
                break;
			case 2:
				SETHELP(WHERE);
/*
481
`Timed Event Command Line:`
rswindell's avatar
rswindell committed
482
483
484

This is the command line to execute upon this timed event.
*/
485
				uifc.input(WIN_MID|WIN_SAV,0,10,"Command"
486
					,cfg.event[i]->cmd,sizeof(cfg.event[i]->cmd)-1,K_EDIT);
rswindell's avatar
rswindell committed
487
				break;
488

rswindell's avatar
rswindell committed
489
			case 3:
490
				k=(cfg.event[i]->misc&EVENT_DISABLED) ? 1:0;
491
492
493
494
495
496
497
				SETHELP(WHERE);
/*
`Event Enabled:`

If you want disable this event from executing, set this option to ~No~.
*/
				k=uifc.list(WIN_MID|WIN_SAV,0,0,0,&k,0
498
					,"Enabled",uifcYesNoOpts);
499
500
501
502
503
504
505
506
				if((k==0 && cfg.event[i]->misc&EVENT_DISABLED) 
					|| (k==1 && !(cfg.event[i]->misc&EVENT_DISABLED))) {
					cfg.event[i]->misc^=EVENT_DISABLED;
					uifc.changes=1; 
				}
                break;

			case 4:
rswindell's avatar
rswindell committed
507
508
				SETHELP(WHERE);
/*
509
`Timed Event Node:`
rswindell's avatar
rswindell committed
510
511
512
513

This is the node number to execute the timed event.
*/
				sprintf(str,"%u",cfg.event[i]->node);
514
				uifc.input(WIN_MID|WIN_SAV,0,0,"Node Number"
rswindell's avatar
rswindell committed
515
516
517
					,str,3,K_EDIT|K_NUMBER);
				cfg.event[i]->node=atoi(str);
				break;
518
			case 5:
519
520
				SETHELP(WHERE);
/*
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
`Months to Execute Event:`

Specifies the months (`Jan`-`Dec`, separated by spaces) on which 
to execute this event, or `Any` to execute event for any/all months.
*/
				SAFECOPY(str,monthstr(cfg.event[i]->months));
				uifc.input(WIN_MID|WIN_SAV,0,0,"Months to Execute Event (or Any)"
					,str,50,K_EDIT);
				cfg.event[i]->months=0;
				for(p=str;*p;p++) {
					if(atoi(p)) {
						cfg.event[i]->months|=(1<<(atoi(p)-1));
						while(*p && isdigit(*p))
							p++;
					} else {
						for(j=0;j<12;j++)
							if(strnicmp(mon[j],p,3)==0) {
								cfg.event[i]->months|=(1<<j);
								p+=2;
								break;
							}
						p++;
					}
				}
				break;
			case 6:
				SETHELP(WHERE);
/*
549
`Days of Month to Execute Event:`
550

551
552
553
Specifies the days of the month (`1-31`, separated by spaces) on which 
to execute this event, or `Any` to execute event on any and all days of
the month.
554
*/
555
556
557
558
559
560
561
562
563
564
565
				SAFECOPY(str,mdaystr(cfg.event[i]->mdays));
				uifc.input(WIN_MID|WIN_SAV,0,0,"Days of Month to Execute Event (or Any)"
					,str,16,K_EDIT);
				cfg.event[i]->mdays=0;
				for(p=str;*p;p++) {
					if(!isdigit(*p))
						continue;
					cfg.event[i]->mdays|=(1<<atoi(p));
					while(*p && isdigit(*p))
						p++;
				}
566
				break;
567
			case 7:
rswindell's avatar
rswindell committed
568
569
570
				j=0;
				while(1) {
					for(k=0;k<7;k++)
571
						sprintf(opt[k],"%-30s %3s"
rswindell's avatar
rswindell committed
572
							,wday[k],(cfg.event[i]->days&(1<<k)) ? "Yes":"No");
573
574
					strcpy(opt[k++],"All");
					strcpy(opt[k++],"None");
rswindell's avatar
rswindell committed
575
576
577
					opt[k][0]=0;
					SETHELP(WHERE);
/*
578
`Days of Week to Execute Event:`
rswindell's avatar
rswindell committed
579
580
581

These are the days of the week that this event will be executed.
*/
582
					k=uifc.list(WIN_MID|WIN_SAV|WIN_ACT,0,0,0,&j,0
583
						,"Days of Week to Execute Event",opt);
rswindell's avatar
rswindell committed
584
585
					if(k==-1)
						break;
586
					if(k==7)
587
						cfg.event[i]->days=(uchar)0xff;
588
589
590
591
592
593
					else if(k==8)
						cfg.event[i]->days=0;
					else
						cfg.event[i]->days^=(1<<k);
					uifc.changes=1; 
				}
rswindell's avatar
rswindell committed
594
				break;
595
			case 8:
596
597
598
599
600
601
                if(cfg.event[i]->freq==0)
                    k=0;
                else
                    k=1;
                SETHELP(WHERE);
/*
602
`Execute Event at a Specific Time:`
603
604

If you want the system execute this event at a specific time, set
605
606
this option to `Yes`. If you want the system to execute this event more
than once a day at predetermined intervals, set this option to `No`.
607
*/
608
                k=uifc.list(WIN_MID|WIN_SAV,0,0,0,&k,0
609
                    ,"Execute Event at a Specific Time",uifcYesNoOpts);
610
611
612
613
614
                if(k==0) {
                    sprintf(str,"%2.2u:%2.2u",cfg.event[i]->time/60
                        ,cfg.event[i]->time%60);
                    SETHELP(WHERE);
/*
615
`Time to Execute Event:`
616
617
618

This is the time (in 24 hour HH:MM format) to execute the event.
*/
619
                    if(uifc.input(WIN_MID|WIN_SAV,0,0
620
621
622
623
624
                        ,"Time to Execute Event (HH:MM)"
                        ,str,5,K_UPPER|K_EDIT)>0) {
                        cfg.event[i]->freq=0;
                        cfg.event[i]->time=atoi(str)*60;
                        if((p=strchr(str,':'))!=NULL)
625
626
627
                            cfg.event[i]->time+=atoi(p+1); 
					} 
				}
628
629
630
631
632
633
                else if(k==1) {
                    sprintf(str,"%u"
                        ,cfg.event[i]->freq && cfg.event[i]->freq<=1440
                            ? 1440/cfg.event[i]->freq : 0);
                    SETHELP(WHERE);
/*
634
`Number of Executions Per Day:`
635
636
637
638

This is the maximum number of times the system will execute this event
per day.
*/
639
                    if(uifc.input(WIN_MID|WIN_SAV,0,0
640
641
642
643
644
645
646
647
648
649
650
                        ,"Number of Executions Per Day"
                        ,str,4,K_NUMBER|K_EDIT)>0) {
                        cfg.event[i]->time=0;
                        k=atoi(str);
                        if(k && k<=1440)
                            cfg.event[i]->freq=1440/k;
                        else
                            cfg.event[i]->freq=0;
                        }
                    }
                break;
651
			case 9:
652
				k=(cfg.event[i]->misc&EVENT_EXCL) ? 0:1;
rswindell's avatar
rswindell committed
653
654
				SETHELP(WHERE);
/*
655
`Exclusive Event Execution:`
rswindell's avatar
rswindell committed
656
657

If this event must be run exclusively (all nodes inactive), set this
658
option to `Yes`.
rswindell's avatar
rswindell committed
659
*/
660
				k=uifc.list(WIN_MID|WIN_SAV,0,0,0,&k,0,"Exclusive Execution"
661
					,uifcYesNoOpts);
rswindell's avatar
rswindell committed
662
663
				if(!k && !(cfg.event[i]->misc&EVENT_EXCL)) {
					cfg.event[i]->misc|=EVENT_EXCL;
664
665
					uifc.changes=1; 
				}
rswindell's avatar
rswindell committed
666
667
				else if(k==1 && cfg.event[i]->misc&EVENT_EXCL) {
					cfg.event[i]->misc&=~EVENT_EXCL;
668
669
					uifc.changes=1; 
				}
rswindell's avatar
rswindell committed
670
                break;
671
			case 10:
672
				k=(cfg.event[i]->misc&EVENT_FORCE) ? 0:1;
rswindell's avatar
rswindell committed
673
674
				SETHELP(WHERE);
/*
675
`Force Users Off-line for Event:`
rswindell's avatar
rswindell committed
676
677

If you want to have your users' on-line time reduced so the event can
678
execute precisely on time, set this option to `Yes`.
rswindell's avatar
rswindell committed
679
*/
680
				k=uifc.list(WIN_MID|WIN_SAV,0,0,0,&k,0
681
					,"Force Users Off-line for Event",uifcYesNoOpts);
rswindell's avatar
rswindell committed
682
683
				if(!k && !(cfg.event[i]->misc&EVENT_FORCE)) {
					cfg.event[i]->misc|=EVENT_FORCE;
684
685
686
					uifc.changes=1; 
				}
				else if(k==1 && (cfg.event[i]->misc&EVENT_FORCE)) {
rswindell's avatar
rswindell committed
687
					cfg.event[i]->misc&=~EVENT_FORCE;
688
689
                    uifc.changes=1; 
				}
rswindell's avatar
rswindell committed
690
691
                break;

692
			case 11:
693
				k=(cfg.event[i]->misc&EX_NATIVE) ? 0:1;
694
695
				SETHELP(WHERE);
/*
696
`Native Executable:`
697

698
699
If this event program is a native (e.g. non-DOS) executable,
set this option to `Yes`.
700
701
*/
				k=uifc.list(WIN_MID|WIN_SAV,0,0,0,&k,0
702
					,"Native",uifcYesNoOpts);
703
704
705
706
				if(!k && !(cfg.event[i]->misc&EX_NATIVE)) {
					cfg.event[i]->misc|=EX_NATIVE;
					uifc.changes=TRUE;
                }
707
				else if(k==1 && (cfg.event[i]->misc&EX_NATIVE)) {
708
709
710
711
712
					cfg.event[i]->misc&=~EX_NATIVE;
					uifc.changes=TRUE;
                }
                break;

713
			case 12:
714
				k=(cfg.event[i]->misc&XTRN_SH) ? 0:1;
715
716
717
718
719
720
721
722
				SETHELP(WHERE);
/*
`Use Shell to Execute Command:`

If this command-line requires the system command shell to execute, (Unix 
shell script or DOS batch file), set this option to ~Yes~.
*/
				k=uifc.list(WIN_MID|WIN_SAV,0,0,0,&k,0
723
					,"Use Shell",uifcYesNoOpts);
724
725
726
727
				if(!k && !(cfg.event[i]->misc&XTRN_SH)) {
					cfg.event[i]->misc|=XTRN_SH;
					uifc.changes=TRUE;
                }
728
				else if(k==1 && (cfg.event[i]->misc&XTRN_SH)) {
729
730
731
732
733
					cfg.event[i]->misc&=~XTRN_SH;
					uifc.changes=TRUE;
                }
                break;

734
			case 13:
735
				k=(cfg.event[i]->misc&EX_BG) ? 0:1;
736
737
				SETHELP(WHERE);
/*
738
`Execute Event in Background (Asynchronously):`
739
740

If you would like this event to run simultaneously with other events,
741
set this option to `Yes`. Exclusive events will not run in the background.
742
743
*/
				k=uifc.list(WIN_MID|WIN_SAV,0,0,0,&k,0
744
					,"Background (Asynchronous) Execution",uifcYesNoOpts);
745
746
747
748
				if(!k && !(cfg.event[i]->misc&EX_BG)) {
					cfg.event[i]->misc|=EX_BG;
					uifc.changes=TRUE;
                }
749
				else if(k==1 && (cfg.event[i]->misc&EX_BG)) {
750
751
752
753
754
					cfg.event[i]->misc&=~EX_BG;
                    uifc.changes=TRUE;
                }
                break;

755
			case 14:
756
				k=(cfg.event[i]->misc&EVENT_INIT) ? 0:1;
757
758
				SETHELP(WHERE);
/*
759
`Always Run After Initialization or Re-initialization:`
760
761
762
763
764

If you want this event to always run after the BBS is initialized or
re-initialized, set this option to ~Yes~.
*/
				k=uifc.list(WIN_MID|WIN_SAV,0,0,0,&k,0
765
					,"Always Run After Initialization or Re-initialization",uifcYesNoOpts);
766
767
768
769
				if(!k && !(cfg.event[i]->misc&EVENT_INIT)) {
					cfg.event[i]->misc|=EVENT_INIT;
					uifc.changes=1; 
				}
770
				else if(k==1 && (cfg.event[i]->misc&EVENT_INIT)) {
771
772
773
774
775
776
777
					cfg.event[i]->misc&=~EVENT_INIT;
                    uifc.changes=1; 
				}
                break;
			} 
		} 
	}
rswindell's avatar
rswindell committed
778
779
780
781
782
}


void xtrn_cfg(uint section)
{
783
	static int ext_dflt,ext_bar,sub_bar,opt_dflt,time_dflt;
784
	char str[128],code[128],done=0;
rswindell's avatar
rswindell committed
785
786
787
788
	int j,k;
	uint i,n,xtrnnum[MAX_OPTS+1];
	static xtrn_t savxtrn;

789
790
791
	sub_bar=0;
	opt_dflt=0;

rswindell's avatar
rswindell committed
792
793
794
795
while(1) {
	for(i=0,j=0;i<cfg.total_xtrns && j<MAX_OPTS;i++)
		if(cfg.xtrn[i]->sec==section) {
			sprintf(opt[j],"%-25s",cfg.xtrn[i]->name);
796
797
			xtrnnum[j++]=i; 
		}
rswindell's avatar
rswindell committed
798
799
800
801
802
803
804
805
806
807
808
	xtrnnum[j]=cfg.total_xtrns;
	opt[j][0]=0;
	i=WIN_ACT|WIN_CHE|WIN_SAV|WIN_RHT;
	if(j)
		i|=WIN_DEL|WIN_GET;
	if(cfg.total_xtrns<MAX_OPTS)
		i|=WIN_INS|WIN_INSACT|WIN_XTR;
	if(savxtrn.name[0])
		i|=WIN_PUT;
	SETHELP(WHERE);
/*
809
`Online External Programs:`
rswindell's avatar
rswindell committed
810
811
812
813

This is a list of the configured online external programs (doors).

To add a program, select the desired location with the arrow keys and
814
hit ~ INS ~.
rswindell's avatar
rswindell committed
815

816
To delete a program, select it with the arrow keys and hit ~ DEL ~.
rswindell's avatar
rswindell committed
817

818
To configure a program, select it with the arrow keys and hit ~ ENTER ~.
rswindell's avatar
rswindell committed
819
820
*/
	sprintf(str,"%s Online Programs",cfg.xtrnsec[section]->name);
821
	i=uifc.list(i,0,0,45,&ext_dflt,&ext_bar,str,opt);
rswindell's avatar
rswindell committed
822
823
824
825
826
827
	if((signed)i==-1)
		return;
	if((i&MSK_ON)==MSK_INS) {
		i&=MSK_OFF;
		SETHELP(WHERE);
/*
828
`Online Program Name:`
rswindell's avatar
rswindell committed
829
830
831

This is the name or description of the online program (door).
*/
832
		if(uifc.input(WIN_MID|WIN_SAV,0,0,"Online Program Name",str,25
rswindell's avatar
rswindell committed
833
834
			,0)<1)
            continue;
835
836
		SAFECOPY(code,str);
		prep_code(code,/* prefix: */NULL);
rswindell's avatar
rswindell committed
837
838
		SETHELP(WHERE);
/*
839
`Online Program Internal Code:`
rswindell's avatar
rswindell committed
840
841
842
843
844

Every online program must have its own unique code for Synchronet to
refer to it internally. This code is usually an abreviation of the
online program name.
*/
845
		if(uifc.input(WIN_MID|WIN_SAV,0,0,"Internal Code"
846
			,code,LEN_CODE,K_EDIT|K_UPPER)<1)
rswindell's avatar
rswindell committed
847
848
			continue;
		if(!code_ok(code)) {
849
850
851
			uifc.helpbuf=invalid_code;
			uifc.msg("Invalid Code");
			uifc.helpbuf=0;
852
853
            continue; 
		}
deuce's avatar
deuce committed
854
		if((cfg.xtrn=(xtrn_t **)realloc(cfg.xtrn,sizeof(xtrn_t *)*(cfg.total_xtrns+1)))
rswindell's avatar
rswindell committed
855
856
857
858
            ==NULL) {
            errormsg(WHERE,ERR_ALLOC,nulstr,cfg.total_xtrns+1);
			cfg.total_xtrns=0;
			bail(1);
859
860
            continue; 
		}
rswindell's avatar
rswindell committed
861
862
863
		if(j)
			for(n=cfg.total_xtrns;n>xtrnnum[i];n--)
				cfg.xtrn[n]=cfg.xtrn[n-1];
deuce's avatar
deuce committed
864
		if((cfg.xtrn[xtrnnum[i]]=(xtrn_t *)malloc(sizeof(xtrn_t)))==NULL) {
rswindell's avatar
rswindell committed
865
			errormsg(WHERE,ERR_ALLOC,nulstr,sizeof(xtrn_t));
866
867
			continue; 
		}
rswindell's avatar
rswindell committed
868
869
870
871
872
		memset((xtrn_t *)cfg.xtrn[xtrnnum[i]],0,sizeof(xtrn_t));
		strcpy(cfg.xtrn[xtrnnum[i]]->name,str);
		strcpy(cfg.xtrn[xtrnnum[i]]->code,code);
		cfg.xtrn[xtrnnum[i]]->sec=section;
		cfg.total_xtrns++;
873
		uifc.changes=TRUE;
874
875
		continue; 
	}
rswindell's avatar
rswindell committed
876
877
	if((i&MSK_ON)==MSK_DEL) {
		i&=MSK_OFF;
deuce's avatar
deuce committed
878
		free(cfg.xtrn[xtrnnum[i]]);
rswindell's avatar
rswindell committed
879
880
881
		cfg.total_xtrns--;
		for(j=xtrnnum[i];j<cfg.total_xtrns;j++)
			cfg.xtrn[j]=cfg.xtrn[j+1];
882
		uifc.changes=TRUE;
883
884
		continue; 
	}
rswindell's avatar
rswindell committed
885
886
887
	if((i&MSK_ON)==MSK_GET) {
		i&=MSK_OFF;
		savxtrn=*cfg.xtrn[xtrnnum[i]];
888
889
		continue; 
	}
rswindell's avatar
rswindell committed
890
891
892
893
	if((i&MSK_ON)==MSK_PUT) {
		i&=MSK_OFF;
		*cfg.xtrn[xtrnnum[i]]=savxtrn;
		cfg.xtrn[xtrnnum[i]]->sec=section;
894
		uifc.changes=TRUE;
895
896
        continue; 
	}
rswindell's avatar
rswindell committed
897
898
899
900
901
902
903
904
905
906
	done=0;
	i=xtrnnum[i];
	while(!done) {
		k=0;
		sprintf(opt[k++],"%-27.27s%s","Name",cfg.xtrn[i]->name);
		sprintf(opt[k++],"%-27.27s%s","Internal Code",cfg.xtrn[i]->code);
		sprintf(opt[k++],"%-27.27s%.40s","Start-up Directory",cfg.xtrn[i]->path);
		sprintf(opt[k++],"%-27.27s%.40s","Command Line",cfg.xtrn[i]->cmd);
		sprintf(opt[k++],"%-27.27s%.40s","Clean-up Command Line",cfg.xtrn[i]->clean);
		if(cfg.xtrn[i]->cost)
deuce's avatar
deuce committed
907
			sprintf(str,"%"PRIu32" credits",cfg.xtrn[i]->cost);
rswindell's avatar
rswindell committed
908
909
910
911
912
913
914
915
		else
			strcpy(str,"None");
		sprintf(opt[k++],"%-27.27s%s","Execution Cost",str);
		sprintf(opt[k++],"%-27.27s%.40s","Access Requirements",cfg.xtrn[i]->arstr);
		sprintf(opt[k++],"%-27.27s%.40s","Execution Requirements"
			,cfg.xtrn[i]->run_arstr);
		sprintf(opt[k++],"%-27.27s%s","Multiple Concurrent Users"
			,cfg.xtrn[i]->misc&MULTIUSER ? "Yes" : "No");
916
917
918
919
920
921
922
923
		sprintf(opt[k++],"%-27.27s%s%s%s","Intercept I/O"
			,cfg.xtrn[i]->misc&XTRN_STDIO ? "Standard"
				: cfg.xtrn[i]->misc&XTRN_CONIO ? "Console":"No"
			,(cfg.xtrn[i]->misc&(XTRN_STDIO|WWIVCOLOR))
				==(XTRN_STDIO|WWIVCOLOR) ? ", WWIV Color" : nulstr
			,(cfg.xtrn[i]->misc&(XTRN_STDIO|XTRN_NOECHO))
				==(XTRN_STDIO|XTRN_NOECHO) ? ", No Echo" : nulstr);
		sprintf(opt[k++],"%-27.27s%s","Native Executable"
924
			,cfg.xtrn[i]->misc&XTRN_NATIVE ? "Yes" : "No");
925
926
		sprintf(opt[k++],"%-27.27s%s","Use Shell to Execute"
			,cfg.xtrn[i]->misc&XTRN_SH ? "Yes" : "No");
rswindell's avatar
rswindell committed
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
		sprintf(opt[k++],"%-27.27s%s","Modify User Data"
            ,cfg.xtrn[i]->misc&MODUSERDAT ? "Yes" : "No");
		switch(cfg.xtrn[i]->event) {
			case EVENT_LOGON:
				strcpy(str,"Logon");
				break;
			case EVENT_LOGOFF:
				strcpy(str,"Logoff");
				break;
			case EVENT_NEWUSER:
				strcpy(str,"New User");
				break;
			case EVENT_BIRTHDAY:
				strcpy(str,"Birthday");
				break;
942
943
944
945
946
947
948
949
950
			case EVENT_POST:
				strcpy(str,"Message Posted");
				break;
			case EVENT_UPLOAD:
				strcpy(str,"File Uploaded");
				break;
			case EVENT_DOWNLOAD:
				strcpy(str,"File Downloaded");
				break;
951
952
953
			case EVENT_LOCAL_CHAT:
				strcpy(str,"Local/Sysop Chat");
				break;
rswindell's avatar
rswindell committed
954
955
			default:
				strcpy(str,"No");
956
957
				break; 
		}
958
		if((cfg.xtrn[i]->misc&EVENTONLY) && cfg.xtrn[i]->event)
rswindell's avatar
rswindell committed
959
960
			strcat(str,", Only");
		sprintf(opt[k++],"%-27.27s%s","Execute on Event",str);
961
962
		sprintf(opt[k++],"%-27.27s%s","Pause After Execution"
			,cfg.xtrn[i]->misc&XTRN_PAUSE ? "Yes" : "No");
rswindell's avatar
rswindell committed
963
		sprintf(opt[k++],"%-23.23s%-4s%s","BBS Drop File Type"
964
965
			,cfg.xtrn[i]->misc&REALNAME ? "(R)":nulstr
			,dropfile(cfg.xtrn[i]->type,cfg.xtrn[i]->misc));
rswindell's avatar
rswindell committed
966
967
968
969
970
971
		sprintf(opt[k++],"%-27.27s%s","Place Drop File In"
			,cfg.xtrn[i]->misc&STARTUPDIR ? "Start-Up Directory":"Node Directory");
		sprintf(opt[k++],"Time Options...");
		opt[k][0]=0;
		SETHELP(WHERE);
/*
972
`Online Program Configuration:`
rswindell's avatar
rswindell committed
973
974
975

This menu is for configuring the selected online program.
*/
976
		switch(uifc.list(WIN_SAV|WIN_ACT|WIN_MID,0,0,60,&opt_dflt,&sub_bar,cfg.xtrn[i]->name
rswindell's avatar
rswindell committed
977
978
979
980
981
982
983
			,opt)) {
			case -1:
				done=1;
				break;
			case 0:
				SETHELP(WHERE);
/*
984
`Online Program Name:`
rswindell's avatar
rswindell committed
985
986
987
988

This is the name or description of the online program (door).
*/
				strcpy(str,cfg.xtrn[i]->name);
989
				if(!uifc.input(WIN_MID|WIN_SAV,0,10,"Online Program Name"
990
					,cfg.xtrn[i]->name,sizeof(cfg.xtrn[i]->name)-1,K_EDIT))
rswindell's avatar
rswindell committed
991
992
993
994
995
					strcpy(cfg.xtrn[i]->name,str);
				break;
			case 1:
				SETHELP(WHERE);
/*
996
`Online Program Internal Code:`
rswindell's avatar
rswindell committed
997
998
999
1000
1001
1002

Every online program must have its own unique code for Synchronet to
refer to it internally. This code is usually an abreviation of the
online program name.
*/
				strcpy(str,cfg.xtrn[i]->code);
1003
				uifc.input(WIN_MID|WIN_SAV,0,10,"Internal Code"
1004
					,str,LEN_CODE,K_UPPER|K_EDIT);
rswindell's avatar
rswindell committed
1005
1006
1007
				if(code_ok(str))
					strcpy(cfg.xtrn[i]->code,str);
				else {
1008
1009
					uifc.helpbuf=invalid_code;
					uifc.msg("Invalid Code");
1010
1011
                    uifc.helpbuf=0; 
				}
rswindell's avatar
rswindell committed
1012
1013
1014
1015
                break;
			case 2:
                SETHELP(WHERE);
/*
1016
`Online Program Start-up Directory:`
rswindell's avatar
rswindell committed
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026

This is the DOS drive/directory where the online program is located.
If a path is specified here, it will be made the current directory
before the program's command line is executed. This eliminates the need
for batch files that just change the current drive and directory before
executing the program.

If this option is not used, the current NODE's directory will be the
current DOS drive/directory before the command line is executed.
*/
1027
1028
				uifc.input(WIN_MID|WIN_SAV,0,10,""
					,cfg.xtrn[i]->path,sizeof(cfg.xtrn[i]->path)-1,K_EDIT);
rswindell's avatar
rswindell committed
1029
1030
1031
1032
                break;
			case 3:
				SETHELP(WHERE);
/*
1033
`Online Program Command Line:`
rswindell's avatar
rswindell committed
1034
1035
1036

This is the command line to execute to run the online program.
*/
1037
				uifc.input(WIN_MID|WIN_SAV,0,10,"Command"
1038
					,cfg.xtrn[i]->cmd,sizeof(cfg.xtrn[i]->cmd)-1,K_EDIT);
rswindell's avatar
rswindell committed
1039
1040
1041
1042
				break;
			case 4:
				SETHELP(WHERE);
/*
1043
`Online Program Clean-up Command:`
rswindell's avatar
rswindell committed
1044
1045
1046
1047

This is the command line to execute after the main command line. This
option is usually only used for multiuser online programs.
*/
1048
				uifc.input(WIN_MID|WIN_SAV,0,10,"Clean-up"
1049
					,cfg.xtrn[i]->clean,sizeof(cfg.xtrn[i]->clean)-1,K_EDIT);
rswindell's avatar
rswindell committed
1050
1051
1052
1053
1054
                break;
			case 5:
                ultoa(cfg.xtrn[i]->cost,str,10);
                SETHELP(WHERE);
/*
1055
`Online Program Cost to Run:`
rswindell's avatar
rswindell committed
1056
1057
1058

If you want users to be charged credits to run this online program,
set this value to the number of credits to charge. If you want this
1059
online program to be free, set this value to `0`.
rswindell's avatar
rswindell committed
1060
*/
1061
                uifc.input(WIN_MID|WIN_SAV,0,0,"Cost to Run (in Credits)"
rswindell's avatar
rswindell committed
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
                    ,str,10,K_EDIT|K_NUMBER);
                cfg.xtrn[i]->cost=atol(str);
                break;
			case 6:
				sprintf(str,"%s Access",cfg.xtrn[i]->name);
				getar(str,cfg.xtrn[i]->arstr);
                break;
			case 7:
				sprintf(str,"%s Execution",cfg.xtrn[i]->name);
				getar(str,cfg.xtrn[i]->run_arstr);
                break;
			case 8:
1074
				k=(cfg.xtrn[i]->misc&MULTIUSER) ? 0:1;
rswindell's avatar
rswindell committed
1075
1076
				SETHELP(WHERE);
/*
1077
`Supports Multiple Users:`
rswindell's avatar
rswindell committed
1078
1079

If this online program supports multiple simultaneous users (nodes),
1080
set this option to `Yes`.
rswindell's avatar
rswindell committed
1081
*/
1082
				k=uifc.list(WIN_MID|WIN_SAV,0,0,0,&k,0,"Supports Multiple Users"
1083
					,uifcYesNoOpts);
rswindell's avatar
rswindell committed
1084
1085
				if(!k && !(cfg.xtrn[i]->misc&MULTIUSER)) {
					cfg.xtrn[i]->misc|=MULTIUSER;
1086
1087
1088
					uifc.changes=TRUE; 
				}
				else if(k==1 && (cfg.xtrn[i]->misc&MULTIUSER)) {
rswindell's avatar
rswindell committed
1089
					cfg.xtrn[i]->misc&=~MULTIUSER;
1090
1091
					uifc.changes=TRUE; 
				}
rswindell's avatar
rswindell committed
1092
1093
                break;
			case 9:
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
				switch(cfg.xtrn[i]->misc&(XTRN_STDIO|XTRN_CONIO)) {
					case XTRN_STDIO:
						k=0;
						break;
					case XTRN_CONIO:
						k=1;
						break;
					default:
						k=2;
				}
				strcpy(opt[0],"Standard");
				strcpy(opt[1],"Console");
				strcpy(opt[2],"No");
				opt[3][0]=0;
rswindell's avatar
rswindell committed
1108
1109
				SETHELP(WHERE);
/*
1110
`Intercept I/O:`
rswindell's avatar
rswindell committed
1111

rswindell's avatar
rswindell committed
1112
If this online program uses a FOSSIL driver or SOCKET communications,
1113
set this option to `No`.
rswindell's avatar
rswindell committed
1114
*/
1115
1116
1117
				switch(uifc.list(WIN_MID|WIN_SAV,0,0,0,&k,0,"Intercept I/O"
					,opt)) {
					case 0: /* Standard I/O */
1118
						if((cfg.xtrn[i]->misc&(XTRN_STDIO|XTRN_CONIO)) != XTRN_STDIO) {
1119
1120
1121
1122
1123
1124
							cfg.xtrn[i]->misc|=XTRN_STDIO;
							cfg.xtrn[i]->misc&=~XTRN_CONIO;
							uifc.changes=1;
						}
						k=(cfg.xtrn[i]->misc&WWIVCOLOR) ? 0:1;
						SETHELP(WHERE);
rswindell's avatar
rswindell committed
1125
/*
1126
`Program Uses WWIV Color Codes:`
rswindell's avatar
rswindell committed
1127

1128
1129
If this program was written for use exclusively under ~WWIV~ BBS
software, set this option to ~Yes~.
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142