scfgsys.c 78.2 KB
Newer Older
1 2 3 4
/****************************************************************************
 * @format.tab-size 4		(Plain Text/Source Code File Header)			*
 * @format.use-tabs true	(see http://www.synchro.net/ptsc_hdr.html)		*
 *																			*
5
 * Copyright Rob Swindell - http://www.synchro.net/copyright.html			*
6 7 8 9 10 11 12 13 14 15 16 17 18
 *																			*
 * 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										*
 *																			*
 * For Synchronet coding style and modification guidelines, see				*
 * http://www.synchro.net/source.html										*
 *																			*
 * Note: If this box doesn't appear square, then you need to fix your tabs.	*
 ****************************************************************************/
rswindell's avatar
rswindell committed
19 20

#include "scfg.h"
21
#include "ssl.h"
rswindell's avatar
rswindell committed
22

23 24 25 26 27 28
static void configure_dst(void)
{
	strcpy(opt[0],"Yes");
	strcpy(opt[1],"No");
	strcpy(opt[2],"Automatic");
	opt[3][0]=0;
29 30 31
	int i = 2;
	if(!(cfg.sys_misc & SM_AUTO_DST))
		i = !(cfg.sys_timezone & DAYLIGHT);
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
	uifc.helpbuf=
		"`Daylight Saving Time (DST):`\n"
		"\n"
		"If your system is using a U.S. standard time zone, and you would like\n"
		"to have the daylight saving time `flag` automatically toggled for you,\n"
		"set this option to ~Automatic~ (recommended).\n"
		"\n"			
		"The ~DST~ `flag` is used for display purposes only (e.g. to display \"PDT\"\n"
		"instead of \"PST\" and calculate the correct offset from UTC), it does not\n"
		"actually change the time on your computer system(s) for you.\n"
	;
	i=uifc.list(WIN_MID|WIN_SAV,0,0,0,&i,0
		,"Daylight Saving Time (DST)",opt);
	if(i==-1)
        return;
	cfg.sys_misc&=~SM_AUTO_DST;
	switch(i) {
		case 0:
			cfg.sys_timezone|=DAYLIGHT;
			break;
		case 1:
			cfg.sys_timezone&=~DAYLIGHT;
			break;
		case 2:
			cfg.sys_misc|=SM_AUTO_DST;
			sys_timezone(&cfg);
			break;
	}
}

rswindell's avatar
rswindell committed
62 63 64
void sys_cfg(void)
{
	static int sys_dflt,adv_dflt,tog_dflt,new_dflt;
65
	static int adv_bar;
rswindell's avatar
rswindell committed
66 67
	char str[81],done=0;
	int i,j,k,dflt,bar;
68 69
	char sys_pass[sizeof(cfg.sys_pass)];
	SAFECOPY(sys_pass, cfg.sys_pass);
70 71 72 73 74 75 76 77 78
	while(1) {
		i=0;
		sprintf(opt[i++],"%-33.33s%s","BBS Name",cfg.sys_name);
		sprintf(opt[i++],"%-33.33s%s","Location",cfg.sys_location);
		sprintf(opt[i++],"%-33.33s%s %s","Local Time Zone"
			,smb_zonestr(cfg.sys_timezone,NULL)
			,SMB_TZ_HAS_DST(cfg.sys_timezone) && cfg.sys_misc&SM_AUTO_DST ? "(Auto-DST)" : "");
		sprintf(opt[i++],"%-33.33s%s","Operator",cfg.sys_op);
		sprintf(opt[i++],"%-33.33s%s","Password","**********");
rswindell's avatar
rswindell committed
79

80
		SAFEPRINTF(str,"%s Password"
81 82 83
			,cfg.sys_misc&SM_PWEDIT && cfg.sys_pwdays ? "Users Must Change"
			: cfg.sys_pwdays ? "Users Get New Random" : "Users Can Change");
		if(cfg.sys_pwdays)
84
			SAFEPRINTF(tmp,"Every %u Days",cfg.sys_pwdays);
85
		else if(cfg.sys_misc&SM_PWEDIT)
86
			SAFECOPY(tmp,"Yes");
87
		else
88 89 90
			SAFECOPY(tmp,"No");
		if(cfg.sys_misc&SM_PWEDIT)
			sprintf(tmp + strlen(tmp), ", %u chars minimum", cfg.min_pwlen);
91
		sprintf(opt[i++],"%-33.33s%s",str,tmp);
rswindell's avatar
rswindell committed
92

93 94 95 96 97
		sprintf(opt[i++],"%-33.33s%u","Days to Preserve Deleted Users"
			,cfg.sys_deldays);
		sprintf(opt[i++],"%-33.33s%s","Maximum Days of Inactivity"
			,cfg.sys_autodel ? ultoa(cfg.sys_autodel,tmp,10) : "Unlimited");
		sprintf(opt[i++],"%-33.33s%s","New User Password",cfg.new_pass);
rswindell's avatar
rswindell committed
98

99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120
		strcpy(opt[i++],"Toggle Options...");
		strcpy(opt[i++],"New User Values...");
		strcpy(opt[i++],"Advanced Options...");
		strcpy(opt[i++],"Loadable Modules...");
		strcpy(opt[i++],"Security Level Values...");
		strcpy(opt[i++],"Expired Account Values...");
		strcpy(opt[i++],"Quick-Validation Values...");
		opt[i][0]=0;
		uifc.helpbuf=
			"`System Configuration:`\n"
			"\n"
			"This menu contains options and sub-menus of options that affect the\n"
			"entire BBS system and the Synchronet Terminal Server in particular.\n"
		;
		switch(uifc.list(WIN_ORG|WIN_ACT|WIN_CHE,0,0,72,&sys_dflt,0
			,"System Configuration",opt)) {
			case -1:
				i=save_changes(WIN_MID);
				if(i==-1)
					break;
				if(!i) {
					cfg.new_install=new_install;
121
					if(strcmp(sys_pass, cfg.sys_pass) != 0) {
122
						if(fexist("ssl.cert") || fexist("cryptlib.key") || fexist("letsyncrypt.key")) {
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141
							CRYPT_KEYSET ssl_keyset;
							CRYPT_CONTEXT ssl_context = -1;
							int status;
							int ignoreme;

							if (cryptStatusOK(status = cryptKeysetOpen(&ssl_keyset, CRYPT_UNUSED, CRYPT_KEYSET_FILE, "ssl.cert", CRYPT_KEYOPT_NONE)))
								if (cryptStatusOK(status = cryptGetPrivateKey(ssl_keyset, &ssl_context, CRYPT_KEYID_NAME, "ssl_cert", sys_pass)))
									if (cryptStatusOK(status = cryptDeleteKey(ssl_keyset, CRYPT_KEYID_NAME, "ssl_cert"))) {
										ignoreme = cryptAddPrivateKey(ssl_keyset, ssl_context, cfg.sys_pass);
										cryptKeysetClose(ssl_keyset);
									}

							if (cryptStatusOK(status = cryptKeysetOpen(&ssl_keyset, CRYPT_UNUSED, CRYPT_KEYSET_FILE, "cryptlib.key", CRYPT_KEYOPT_NONE)))
								if (cryptStatusOK(status = cryptGetPrivateKey(ssl_keyset, &ssl_context, CRYPT_KEYID_NAME, "ssh_server", sys_pass)))
									if (cryptStatusOK(status = cryptDeleteKey(ssl_keyset, CRYPT_KEYID_NAME, "ssh_server"))) {
										ignoreme = cryptAddPrivateKey(ssl_keyset, ssl_context, cfg.sys_pass);
										cryptKeysetClose(ssl_keyset);
									}

142
							if (cryptStatusOK(status = cryptKeysetOpen(&ssl_keyset, CRYPT_UNUSED, CRYPT_KEYSET_FILE, "letsyncrypt.key", CRYPT_KEYOPT_NONE))) {
143 144 145 146 147 148 149 150 151
								char value[INI_MAX_VALUE_LEN];
								char* host = "acme-v02.api.letsencrypt.org";
								FILE* fp = fopen("letsyncrypt.ini", "r");
								if(fp != NULL) {
									host = iniReadString(fp, "state", "host", host, value);
									fclose(fp);
								}
								if (cryptStatusOK(status = cryptGetPrivateKey(ssl_keyset, &ssl_context, CRYPT_KEYID_NAME, host, sys_pass)))
									if (cryptStatusOK(status = cryptDeleteKey(ssl_keyset, CRYPT_KEYID_NAME, host))) {
152 153 154
										ignoreme = cryptAddPrivateKey(ssl_keyset, ssl_context, cfg.sys_pass);
										cryptKeysetClose(ssl_keyset);
									}
155
							}
156
							(void)ignoreme;
157 158
						}
					}
rswindell's avatar
rswindell committed
159
					save_main_cfg(&cfg,backup_level);
160 161 162 163 164 165 166 167 168 169
					refresh_cfg(&cfg);
				}
				return;
			case 0:
				uifc.helpbuf=
					"`BBS Name:`\n"
					"\n"
					"This is the name of the BBS.\n"
				;
				uifc.input(WIN_MID,0,0,"BBS Name",cfg.sys_name,sizeof(cfg.sys_name)-1,K_EDIT);
rswindell's avatar
rswindell committed
170
				break;
171 172 173 174 175 176 177 178
			case 1:
				uifc.helpbuf=
					"`System Location:`\n"
					"\n"
					"This is the location of the BBS. The format is flexible, but it is\n"
					"suggested you use the `City, State` format for clarity.\n"
				;
				uifc.input(WIN_MID,0,0,"Location",cfg.sys_location,sizeof(cfg.sys_location)-1,K_EDIT);
179
				break;
180
			case 2:
181
				i = !(cfg.sys_timezone & US_ZONE);
182
				uifc.helpbuf=
183
					"`United States Time Zone:`\n"
184
					"\n"
185
					"If your local time zone is the United States, select `Yes`.\n"
186
				;
187

188
				i=uifc.list(WIN_MID|WIN_SAV,0,0,0,&i,0
189
					,"United States Time Zone",uifcYesNoOpts);
190 191
				if(i==-1)
					break;
192 193 194 195 196 197 198 199 200 201 202
				if(i==0) {
					strcpy(opt[i++],"Atlantic");
					strcpy(opt[i++],"Eastern");
					strcpy(opt[i++],"Central");
					strcpy(opt[i++],"Mountain");
					strcpy(opt[i++],"Pacific");
					strcpy(opt[i++],"Yukon");
					strcpy(opt[i++],"Hawaii/Alaska");
					strcpy(opt[i++],"Bering");
					opt[i][0]=0;
					i=0;
203
					uifc.helpbuf=
204
						"`U.S. Time Zone:`\n"
205
						"\n"
206
						"Choose the region which most closely reflects your local U.S. time zone.\n"
207
					;
208 209 210
					i=uifc.list(WIN_MID|WIN_SAV,0,0,0,&i,0
						,"U.S. Time Zone",opt);
					if(i==-1)
rswindell's avatar
rswindell committed
211
						break;
212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240
					uifc.changes=1;
					switch(i) {
						case 0:
							cfg.sys_timezone=AST;
							break;
						case 1:
							cfg.sys_timezone=EST;
							break;
						case 2:
							cfg.sys_timezone=CST;
							break;
						case 3:
							cfg.sys_timezone=MST;
							break;
						case 4:
							cfg.sys_timezone=PST;
							break;
						case 5:
							cfg.sys_timezone=YST;
							break;
						case 6:
							cfg.sys_timezone=HST;
							break;
						case 7:
							cfg.sys_timezone=BST;
							break; 
					}
					configure_dst();
					break; 
241
				}
rswindell's avatar
rswindell committed
242
				i=0;
243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264
				strcpy(opt[i++],"Midway");
				strcpy(opt[i++],"Vancouver");
				strcpy(opt[i++],"Edmonton");
				strcpy(opt[i++],"Winnipeg");
				strcpy(opt[i++],"Bogota");
				strcpy(opt[i++],"Caracas");
				strcpy(opt[i++],"Rio de Janeiro");
				strcpy(opt[i++],"Fernando de Noronha");
				strcpy(opt[i++],"Azores");
				strcpy(opt[i++],"Western Europe (WET)");
				strcpy(opt[i++],"Central Europe (CET)");
				strcpy(opt[i++],"Eastern Europe (EET)");
				strcpy(opt[i++],"Moscow");
				strcpy(opt[i++],"Dubai");
				strcpy(opt[i++],"Kabul");
				strcpy(opt[i++],"Karachi");
				strcpy(opt[i++],"Bombay");
				strcpy(opt[i++],"Kathmandu");
				strcpy(opt[i++],"Dhaka");
				strcpy(opt[i++],"Bangkok");
				strcpy(opt[i++],"Hong Kong");
				strcpy(opt[i++],"Tokyo");
265 266
				strcpy(opt[i++],"Australian Central");
				strcpy(opt[i++],"Australian Eastern");
267
				strcpy(opt[i++],"Noumea");
268
				strcpy(opt[i++],"New Zealand");
269
				strcpy(opt[i++],"Other...");
rswindell's avatar
rswindell committed
270
				opt[i][0]=0;
271
				i=0;
272
				uifc.helpbuf=
273 274 275
					"`Non-U.S. Time Zone:`\n"
					"\n"
					"Choose the region which most closely reflects your local time zone.\n"
276
					"\n"
277 278
					"Choose `Other...` if a region representing your local time zone is\n"
					"not listed (you will be able to set the UTC offset manually)."
279
				;
280 281 282 283 284 285
				i=uifc.list(WIN_MID|WIN_SAV,0,0,0,&i,0
					,"None-U.S. Time Zone",opt);
				if(i==-1)
					break;
				uifc.changes=1;
				switch(i) {
rswindell's avatar
rswindell committed
286
					case 0:
287
						cfg.sys_timezone=MID;
rswindell's avatar
rswindell committed
288 289
						break;
					case 1:
290
						cfg.sys_timezone=VAN;
rswindell's avatar
rswindell committed
291 292
						break;
					case 2:
293 294
						cfg.sys_timezone=EDM;
						break;
rswindell's avatar
rswindell committed
295
					case 3:
296 297
						cfg.sys_timezone=WIN;
						break;
rswindell's avatar
rswindell committed
298
					case 4:
299 300
						cfg.sys_timezone=BOG;
						break;
rswindell's avatar
rswindell committed
301
					case 5:
302
						cfg.sys_timezone=CAR;
rswindell's avatar
rswindell committed
303 304
						break;
					case 6:
305
						cfg.sys_timezone=RIO;
rswindell's avatar
rswindell committed
306 307
						break;
					case 7:
308
						cfg.sys_timezone=FER;
rswindell's avatar
rswindell committed
309 310
						break;
					case 8:
311 312
						cfg.sys_timezone=AZO;
						break;
rswindell's avatar
rswindell committed
313
					case 9:
314
						cfg.sys_timezone=WET;
rswindell's avatar
rswindell committed
315 316
						break;
					case 10:
317
						cfg.sys_timezone=CET;
rswindell's avatar
rswindell committed
318 319
						break;
					case 11:
320
						cfg.sys_timezone=EET;
rswindell's avatar
rswindell committed
321 322
						break;
					case 12:
323 324
						cfg.sys_timezone=MOS;
						break;
rswindell's avatar
rswindell committed
325
					case 13:
326 327
						cfg.sys_timezone=DUB;
						break;
rswindell's avatar
rswindell committed
328
					case 14:
329
						cfg.sys_timezone=KAB;
rswindell's avatar
rswindell committed
330
						break;
rswindell's avatar
rswindell committed
331
					case 15:
332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352
						cfg.sys_timezone=KAR;
						break;
					case 16:
						cfg.sys_timezone=BOM;
						break;
					case 17:
						cfg.sys_timezone=KAT;
						break;
					case 18:
						cfg.sys_timezone=DHA;
						break;
					case 19:
						cfg.sys_timezone=BAN;
						break;
					case 20:
						cfg.sys_timezone=HON;
						break;
					case 21:
						cfg.sys_timezone=TOK;
						break;
					case 22:
353
						cfg.sys_timezone=ACST;
354 355
						break;
					case 23:
356
						cfg.sys_timezone=AEST;
357 358
						break;
					case 24:
359 360 361 362
						cfg.sys_timezone=NOU;
						break;
					case 25:
						cfg.sys_timezone=NZST;
363 364 365 366 367 368 369 370 371 372
						break;
					default:
						if(cfg.sys_timezone>720 || cfg.sys_timezone<-720)
							cfg.sys_timezone=0;
						if(cfg.sys_timezone==0)
							str[0]=0;
						else
							sprintf(str,"%02d:%02d"
								,cfg.sys_timezone/60,cfg.sys_timezone<0
								? (-cfg.sys_timezone)%60 : cfg.sys_timezone%60);
373
						uifc.helpbuf=
374
							"`Time Zone Offset:`\n"
375
							"\n"
376 377
							"Enter your local time zone offset from Universal Time (UTC/GMT)\n"
							"in `HH:MM` format.\n"
378
						;
379
						uifc.input(WIN_MID|WIN_SAV,0,0
380 381 382 383 384 385 386 387 388 389 390
							,"Time (HH:MM) East (+) or West (-) of Universal "
								"Time"
							,str,6,K_EDIT|K_UPPER);
						cfg.sys_timezone=atoi(str)*60;
						char *p=strchr(str,':');
						if(p) {
							if(cfg.sys_timezone<0)
								cfg.sys_timezone-=atoi(p+1);
							else
								cfg.sys_timezone+=atoi(p+1); 
						}
rswindell's avatar
rswindell committed
391
						break;
392
				}
393 394
				if(SMB_TZ_HAS_DST(cfg.sys_timezone))
					configure_dst();
rswindell's avatar
rswindell committed
395
				break;
396
			case 3:
397
				uifc.helpbuf=
398
					"`System Operator:`\n"
399
					"\n"
400 401 402 403 404 405 406 407 408
					"This is the name or alias of the system operator. This does not have to\n"
					"be the same as user #1. This field is used for informational purposes\n"
					"only.\n"
				;
				uifc.input(WIN_MID,0,0,"System Operator",cfg.sys_op,sizeof(cfg.sys_op)-1,K_EDIT);
				break;
			case 4:
				uifc.helpbuf=
					"`System Password:`\n"
409
					"\n"
410 411 412 413
					"This is an extra security password required for sysop logon and certain\n"
					"sysop functions. This password should be something not easily guessed\n"
					"and should be kept absolutely confidential. This password must be\n"
					"entered at the Terminal Server `SY:` prompt.\n"
414 415 416 417 418 419 420 421
					"\n"
					"This system password can also be used to enable sysop access to the\n"
					"FTP Server by authenticating with a password that combines a sysop's\n"
					"password with the system password, separated by a colon\n"
					"(i.e. '`user-pass:system-pass`').\n"
					"\n"
					"`Note:` When the `Allow Sysop Access` Toggle Option is set to `No`,\n"
					"      The system password is effectively disabled."
422 423 424 425
				;
				uifc.input(WIN_MID,0,0,"System Password",cfg.sys_pass,sizeof(cfg.sys_pass)-1,K_EDIT|K_UPPER);
				break;
			case 5:
Rob Swindell's avatar
Rob Swindell committed
426
				i = (cfg.sys_misc&SM_PWEDIT) ? 0 : 1;
427 428
				uifc.helpbuf=
					"`Allow Users to Change Their Password:`\n"
429
					"\n"
430 431 432 433 434
					"If you want the users of your system to have the option of changing\n"
					"their password to a string of their choice, set this option to `Yes`.\n"
					"For the highest level of security, set this option to `No.`\n"
				;
				i=uifc.list(WIN_MID|WIN_SAV,0,0,0,&i,0
435
					,"Allow Users to Change Their Password",uifcYesNoOpts);
436 437 438 439 440 441 442
				if(!i && !(cfg.sys_misc&SM_PWEDIT)) {
					cfg.sys_misc|=SM_PWEDIT;
					uifc.changes=1; 
				}
				else if(i==1 && cfg.sys_misc&SM_PWEDIT) {
					cfg.sys_misc&=~SM_PWEDIT;
					uifc.changes=1; 
443 444 445 446 447 448 449 450 451 452 453 454 455 456
				} else if(i == -1)
					break;

				if(cfg.sys_misc&SM_PWEDIT) {
					SAFEPRINTF(tmp, "%u", cfg.min_pwlen);
					SAFEPRINTF2(str, "Minimum Password Length (between %u and %u)", MIN_PASS_LEN, LEN_PASS);
					if(uifc.input(WIN_MID|WIN_SAV,0,0, str
						,tmp, 2, K_NUMBER|K_EDIT) < 1)
						break;
					cfg.min_pwlen=atoi(tmp);
					if(cfg.min_pwlen < MIN_PASS_LEN)
						cfg.min_pwlen = MIN_PASS_LEN;
					if(cfg.min_pwlen > LEN_PASS)
						cfg.min_pwlen = LEN_PASS;
457
				}
Rob Swindell's avatar
Rob Swindell committed
458
				i = cfg.sys_pwdays ? 0 : 1;
459
				uifc.helpbuf=
Rob Swindell's avatar
Rob Swindell committed
460
					"`Force Periodic New Password:`\n"
461
					"\n"
Rob Swindell's avatar
Rob Swindell committed
462 463
					"If you want your users to be forced to have a new password periodically,\n"
					"select `Yes`.\n"
464 465
				;
				i=uifc.list(WIN_MID|WIN_SAV,0,0,0,&i,0
Rob Swindell's avatar
Rob Swindell committed
466
					,"Force Periodic New Password",uifcYesNoOpts);
467 468 469
				if(!i) {
					ultoa(cfg.sys_pwdays,str,10);
				uifc.helpbuf=
Rob Swindell's avatar
Rob Swindell committed
470
					"`Maximum Days Between New Passwords:`\n"
471
					"\n"
Rob Swindell's avatar
Rob Swindell committed
472
					"Enter the maximum number of days allowed between password changes.\n"
473 474 475
					"If a user has not voluntarily changed his or her password in this\n"
					"many days, he or she will be forced to change their password upon\n"
					"logon.\n"
476
				;
Rob Swindell's avatar
Rob Swindell committed
477
					uifc.input(WIN_MID,0,0,"Maximum Days Between New Password"
478 479
						,str,5,K_NUMBER|K_EDIT);
					cfg.sys_pwdays=atoi(str); 
480
				}
481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502
				else if(i==1 && cfg.sys_pwdays) {
					cfg.sys_pwdays=0;
					uifc.changes=1; 
				}
			
				break;
			case 6:
				sprintf(str,"%u",cfg.sys_deldays);
				uifc.helpbuf=
					"`Days Since Last Logon to Preserve Deleted Users:`\n"
					"\n"
					"Deleted user slots can be `undeleted` until the slot is written over\n"
					"by a new user. If you want deleted user slots to be preserved for period\n"
					"of time since their last logon, set this value to the number of days to\n"
					"keep new users from taking over a deleted user's slot.\n"
				;
				uifc.input(WIN_MID,0,0,"Days Since Last Logon to Preserve Deleted Users"
					,str,5,K_EDIT|K_NUMBER);
				cfg.sys_deldays=atoi(str);
				break;
			case 7:
				sprintf(str,"%u",cfg.sys_autodel);
503
				uifc.helpbuf=
504
					"`Maximum Days of Inactivity Before Auto-Deletion:`\n"
505
					"\n"
Rob Swindell's avatar
Rob Swindell committed
506
					"If you want users that have not logged-on in a certain period of time to\n"
507 508 509
					"be automatically deleted, set this value to the maximum number of days\n"
					"of inactivity before the user is deleted. Setting this value to `0`\n"
					"disables this feature.\n"
510
					"\n"
511
					"Users with the `P` exemption will not be deleted due to inactivity.\n"
512
				;
513 514 515 516 517 518 519 520
				uifc.input(WIN_MID,0,0,"Maximum Days of Inactivity Before Auto-Deletion"
					,str,5,K_EDIT|K_NUMBER);
				cfg.sys_autodel=atoi(str);
				break;
			case 8:
				uifc.helpbuf=
					"`New User Password:`\n"
					"\n"
Rob Swindell's avatar
Rob Swindell committed
521 522 523
					"If you want callers to only be able to logon as `New` ~ only ~ if they know\n"
					"a secret password, enter that password here.  If you prefer any caller\n"
					"be able to logon as `New`, leave this option blank.\n"
524 525 526 527 528 529 530 531
				;
				uifc.input(WIN_MID,0,0,"New User Password",cfg.new_pass,sizeof(cfg.new_pass)-1
					,K_EDIT|K_UPPER);
				break;
			case 9:    /* Toggle Options */
				done=0;
				while(!done) {
					i=0;
rswindell's avatar
rswindell committed
532
					sprintf(opt[i++],"%-33.33s%s","Allow User Aliases"
533 534 535 536 537
						,cfg.uq&UQ_ALIASES ? "Yes" : "No");
					sprintf(opt[i++],"%-33.33s%s","Allow Time Banking"
						,cfg.sys_misc&SM_TIMEBANK ? "Yes" : "No");
					sprintf(opt[i++],"%-33.33s%s","Allow Credit Conversions"
						,cfg.sys_misc&SM_NOCDTCVT ? "No" : "Yes");
538
					sprintf(opt[i++],"%-33.33s%s","Allow Sysop Access"
539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555
						,cfg.sys_misc&SM_R_SYSOP ? "Yes" : "No");
					sprintf(opt[i++],"%-33.33s%s","Display/Log Passwords Locally"
						,cfg.sys_misc&SM_ECHO_PW ? "Yes" : "No");
					sprintf(opt[i++],"%-33.33s%s","Short Sysop Page"
						,cfg.sys_misc&SM_SHRTPAGE ? "Yes" : "No");
					sprintf(opt[i++],"%-33.33s%s","Include Sysop in Statistics"
						,cfg.sys_misc&SM_SYSSTAT ? "Yes" : "No");
					sprintf(opt[i++],"%-33.33s%s","Closed to New Users"
						,cfg.sys_misc&SM_CLOSED ? "Yes" : "No");
					sprintf(opt[i++],"%-33.33s%s","Use Location in User Lists"
						,cfg.sys_misc&SM_LISTLOC ? "Yes" : "No");
					sprintf(opt[i++],"%-33.33s%s","Military (24 hour) Time Format"
						,cfg.sys_misc&SM_MILITARY ? "Yes" : "No");
					sprintf(opt[i++],"%-33.33s%s","European Date Format (DD/MM/YY)"
						,cfg.sys_misc&SM_EURODATE ? "Yes" : "No");
					sprintf(opt[i++],"%-33.33s%s","User Expires When Out-of-time"
						,cfg.sys_misc&SM_TIME_EXP ? "Yes" : "No");
556 557
					sprintf(opt[i++],"%-33.33s%s","Require Sys Pass During Login"
						,cfg.sys_misc&SM_SYSPASSLOGIN ? "Yes" : "No");
558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573
					sprintf(opt[i++],"%-33.33s%s","Display Sys Info During Logon"
						,cfg.sys_misc&SM_NOSYSINFO ? "No" : "Yes");
					sprintf(opt[i++],"%-33.33s%s","Display Node List During Logon"
						,cfg.sys_misc&SM_NONODELIST ? "No" : "Yes");
					opt[i][0]=0;
					uifc.helpbuf=
						"`System Toggle Options:`\n"
						"\n"
						"This is a menu of system related options that can be toggled between\n"
						"two or more states, such as `Yes` and `No`.\n"
					;
					switch(uifc.list(WIN_ACT|WIN_BOT|WIN_RHT,0,0,41,&tog_dflt,0
						,"Toggle Options",opt)) {
						case -1:
							done=1;
							break;
rswindell's avatar
rswindell committed
574
						case 0:
575 576 577 578 579 580 581 582 583
							i=cfg.uq&UQ_ALIASES ? 0:1;
							uifc.helpbuf=
								"`Allow Users to Use Aliases:`\n"
								"\n"
								"If you want the users of your system to be allowed to be known by a\n"
								"false name, handle, or alias, set this option to `Yes`. If you want all\n"
								"users on your system to be known only by their real names, select `No`.\n"
							;
							i=uifc.list(WIN_MID|WIN_SAV,0,0,0,&i,0
584
								,"Allow Users to Use Aliases",uifcYesNoOpts);
585 586 587 588 589 590 591 592
							if(!i && !(cfg.uq&UQ_ALIASES)) {
								cfg.uq|=UQ_ALIASES;
								uifc.changes=1; 
							}
							else if(i==1 && cfg.uq&UQ_ALIASES) {
								cfg.uq&=~UQ_ALIASES;
								uifc.changes=1; 
							}
rswindell's avatar
rswindell committed
593 594
							break;
						case 1:
595 596 597 598
							i=cfg.sys_misc&SM_TIMEBANK ? 0:1;
							uifc.helpbuf=
								"`Allow Time Banking:`\n"
								"\n"
599
								"If you want the users of your system to be allowed to deposit\n"
600 601 602 603 604 605
								"any extra time they may have left during a call into their minute bank,\n"
								"set this option to `Yes`. If this option is set to `No`, then the only\n"
								"way a user may get minutes in their minute bank is to purchase them\n"
								"with credits.\n"
							;
							i=uifc.list(WIN_MID|WIN_SAV,0,0,0,&i,0
606
								,"Allow Users to Deposit Time in Minute Bank",uifcYesNoOpts);
607 608 609 610 611 612 613 614 615
							if(!i && !(cfg.sys_misc&SM_TIMEBANK)) {
								cfg.sys_misc|=SM_TIMEBANK;
								uifc.changes=1; 
							}
							else if(i==1 && cfg.sys_misc&SM_TIMEBANK) {
								cfg.sys_misc&=~SM_TIMEBANK;
								uifc.changes=1; 
							}
							break;
rswindell's avatar
rswindell committed
616
						case 2:
617 618 619 620
							i=cfg.sys_misc&SM_NOCDTCVT ? 1:0;
							uifc.helpbuf=
								"`Allow Credits to be Converted into Minutes:`\n"
								"\n"
621
								"If you want the users of your system to be allowed to convert\n"
622 623 624 625 626
								"any credits they may have into minutes for their minute bank,\n"
								"set this option to `Yes`.\n"
							;
							i=uifc.list(WIN_MID|WIN_SAV,0,0,0,&i,0
								,"Allow Users to Convert Credits into Minutes"
627
								,uifcYesNoOpts);
628 629 630 631 632 633 634 635 636
							if(!i && cfg.sys_misc&SM_NOCDTCVT) {
								cfg.sys_misc&=~SM_NOCDTCVT;
								uifc.changes=1; 
							}
							else if(i==1 && !(cfg.sys_misc&SM_NOCDTCVT)) {
								cfg.sys_misc|=SM_NOCDTCVT;
								uifc.changes=1; 
							}
							break;
rswindell's avatar
rswindell committed
637
						case 3:
638 639
							i=cfg.sys_misc&SM_R_SYSOP ? 0:1;
							uifc.helpbuf=
640
								"`Allow Sysop Access:`\n"
641
								"\n"
642 643
								"Setting this option to `No` will prevent users with sysop security level\n"
								"from invoking functions that require system-password authentication.\n"
644 645
							;
							i=uifc.list(WIN_MID|WIN_SAV,0,0,0,&i,0
646
								,"Allow Sysop Access",uifcYesNoOpts);
647 648 649 650 651 652 653 654 655
							if(!i && !(cfg.sys_misc&SM_R_SYSOP)) {
								cfg.sys_misc|=SM_R_SYSOP;
								uifc.changes=1; 
							}
							else if(i==1 && cfg.sys_misc&SM_R_SYSOP) {
								cfg.sys_misc&=~SM_R_SYSOP;
								uifc.changes=1; 
							}
							break;
rswindell's avatar
rswindell committed
656
						case 4:
657 658 659 660 661 662 663 664 665 666
							i=cfg.sys_misc&SM_ECHO_PW ? 0:1;
							uifc.helpbuf=
								"`Display/Log Passwords Locally:`\n"
								"\n"
								"If you want to passwords to be displayed locally and/or logged to disk\n"
								"(e.g. when there's a failed login attempt), set this option to `Yes`.\n"
								"\n"
								"For elevated security, set this option to `No`.\n"
							;
							i=uifc.list(WIN_MID|WIN_SAV,0,0,0,&i,0
667
								,"Display/Log Passwords Locally",uifcYesNoOpts);
668 669 670 671 672 673 674 675 676
							if(!i && !(cfg.sys_misc&SM_ECHO_PW)) {
								cfg.sys_misc|=SM_ECHO_PW;
								uifc.changes=1; 
							}
							else if(i==1 && cfg.sys_misc&SM_ECHO_PW) {
								cfg.sys_misc&=~SM_ECHO_PW;
								uifc.changes=1; 
							}
							break;
rswindell's avatar
rswindell committed
677
						case 5:
678 679 680 681 682 683 684 685
							i=cfg.sys_misc&SM_SHRTPAGE ? 0:1;
							uifc.helpbuf=
								"`Short Sysop Page:`\n"
								"\n"
								"If you would like the sysop page to be a short series of beeps rather\n"
								"than continuous random tones, set this option to `Yes`.\n"
							;
							i=uifc.list(WIN_MID|WIN_SAV,0,0,0,&i,0,"Short Sysop Page"
686
								,uifcYesNoOpts);
687 688 689 690 691 692 693 694
							if(i==1 && cfg.sys_misc&SM_SHRTPAGE) {
								cfg.sys_misc&=~SM_SHRTPAGE;
								uifc.changes=1; 
							}
							else if(!i && !(cfg.sys_misc&SM_SHRTPAGE)) {
								cfg.sys_misc|=SM_SHRTPAGE;
								uifc.changes=1; 
							}
rswindell's avatar
rswindell committed
695 696
							break;
						case 6:
697 698 699 700 701 702 703 704 705 706 707
							i=cfg.sys_misc&SM_SYSSTAT ? 0:1;
							uifc.helpbuf=
								"`Include Sysop Activity in System Statistics:`\n"
								"\n"
								"If you want sysops to be included in the statistical data of the BBS,\n"
								"set this option to `Yes`. The suggested setting for this option is\n"
								"`No` so that statistical data will only reflect user usage and not\n"
								"include sysop maintenance activity.\n"
							;
							i=uifc.list(WIN_MID|WIN_SAV,0,0,0,&i,0
								,"Include Sysop Activity in System Statistics"
708
								,uifcYesNoOpts);
709 710 711 712 713 714 715 716
							if(!i && !(cfg.sys_misc&SM_SYSSTAT)) {
								cfg.sys_misc|=SM_SYSSTAT;
								uifc.changes=1; 
							}
							else if(i==1 && cfg.sys_misc&SM_SYSSTAT) {
								cfg.sys_misc&=~SM_SYSSTAT;
								uifc.changes=1; 
							}
rswindell's avatar
rswindell committed
717 718
							break;
						case 7:
719 720 721 722 723 724 725
							i=cfg.sys_misc&SM_CLOSED ? 0:1;
							uifc.helpbuf=
								"`Closed to New Users:`\n"
								"\n"
								"If you want callers to be able to logon as `New`, set this option to `No`.\n"
							;
							i=uifc.list(WIN_MID|WIN_SAV,0,0,0,&i,0
726
								,"Closed to New Users",uifcYesNoOpts);
727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746
							if(!i && !(cfg.sys_misc&SM_CLOSED)) {
								cfg.sys_misc|=SM_CLOSED;
								uifc.changes=1; 
							}
							else if(i==1 && cfg.sys_misc&SM_CLOSED) {
								cfg.sys_misc&=~SM_CLOSED;
								uifc.changes=1; 
							}
							break;
						case 8:
							i=cfg.sys_misc&SM_LISTLOC ? 0:1;
							uifc.helpbuf=
								"`User Location in User Lists:`\n"
								"\n"
								"If you want user locations (city, state) displayed in the user lists,\n"
								"set this option to `Yes`. If this option is set to `No`, the user notes\n"
								"(if they exist) are displayed in the user lists.\n"
							;
							i=uifc.list(WIN_MID|WIN_SAV,0,0,0,&i,0
								,"User Location (Instead of Note) in User Lists"
747
								,uifcYesNoOpts);
748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765
							if(!i && !(cfg.sys_misc&SM_LISTLOC)) {
								cfg.sys_misc|=SM_LISTLOC;
								uifc.changes=1; 
							}
							else if(i==1 && cfg.sys_misc&SM_LISTLOC) {
								cfg.sys_misc&=~SM_LISTLOC;
								uifc.changes=1; 
							}
							break;
						case 9:
							i=cfg.sys_misc&SM_MILITARY ? 0:1;
							uifc.helpbuf=
								"`Military:`\n"
								"\n"
								"If you would like the time-of-day to be displayed and entered in 24 hour\n"
								"format always, set this option to `Yes`.\n"
							;
							i=uifc.list(WIN_MID|WIN_SAV,0,0,0,&i,0
766
								,"Use Military Time Format",uifcYesNoOpts);
767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784
							if(!i && !(cfg.sys_misc&SM_MILITARY)) {
								cfg.sys_misc|=SM_MILITARY;
								uifc.changes=1; 
							}
							else if(i==1 && cfg.sys_misc&SM_MILITARY) {
								cfg.sys_misc&=~SM_MILITARY;
								uifc.changes=1; 
							}
							break;
						case 10:
							i=cfg.sys_misc&SM_EURODATE ? 0:1;
							uifc.helpbuf=
								"`European Date Format:`\n"
								"\n"
								"If you would like dates to be displayed and entered in `DD/MM/YY` format\n"
								"instead of `MM/DD/YY` format, set this option to `Yes`.\n"
							;
							i=uifc.list(WIN_MID|WIN_SAV,0,0,0,&i,0
785
								,"European Date Format",uifcYesNoOpts);
786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803
							if(!i && !(cfg.sys_misc&SM_EURODATE)) {
								cfg.sys_misc|=SM_EURODATE;
								uifc.changes=1; 
							}
							else if(i==1 && cfg.sys_misc&SM_EURODATE) {
								cfg.sys_misc&=~SM_EURODATE;
								uifc.changes=1; 
							}
							break;
						case 11:
							i=cfg.sys_misc&SM_TIME_EXP ? 0:1;
							uifc.helpbuf=
								"`User Expires When Out-of-time:`\n"
								"\n"
								"If you want users to be set to `Expired User Values` if they run out of\n"
								"time online, then set this option to `Yes`.\n"
							;
							i=uifc.list(WIN_MID|WIN_SAV,0,0,0,&i,0
804
								,"User Expires When Out-of-time",uifcYesNoOpts);
805 806 807 808 809 810 811 812 813 814
							if(!i && !(cfg.sys_misc&SM_TIME_EXP)) {
								cfg.sys_misc|=SM_TIME_EXP;
								uifc.changes=1; 
							}
							else if(i==1 && cfg.sys_misc&SM_TIME_EXP) {
								cfg.sys_misc&=~SM_TIME_EXP;
								uifc.changes=1; 
							}
							break;
						case 12:
815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834
							i=cfg.sys_misc&SM_SYSPASSLOGIN ? 0:1;
							uifc.helpbuf=
								"`Require System Password for Sysop Login:`\n"
								"\n"
								"If you want to require the correct system password to be provided during\n"
								"system operator logins (in addition to the sysop's personal user account\n"
								"password), set this option to `Yes`.\n"
							;
							i=uifc.list(WIN_MID|WIN_SAV,0,0,0,&i,0
								,"Require System Password for Sysop Logon",uifcYesNoOpts);
							if(i==1 && cfg.sys_misc&SM_SYSPASSLOGIN) {
								cfg.sys_misc&=~SM_SYSPASSLOGIN;
								uifc.changes=1; 
							}
							else if(i==0 && !(cfg.sys_misc&SM_SYSPASSLOGIN)) {
								cfg.sys_misc|=SM_SYSPASSLOGIN;
								uifc.changes=1; 
							}
							break;
						case 13:
835 836 837 838 839 840 841 842
							i=cfg.sys_misc&SM_NOSYSINFO ? 1:0;
							uifc.helpbuf=
								"`Display System Information During Logon:`\n"
								"\n"
								"If you want system information displayed during logon, set this option\n"
								"to `Yes`.\n"
							;
							i=uifc.list(WIN_MID|WIN_SAV,0,0,0,&i,0
843
								,"Display System Information During Logon",uifcYesNoOpts);
844 845 846 847 848 849 850 851 852
							if(!i && cfg.sys_misc&SM_NOSYSINFO) {
								cfg.sys_misc&=~SM_NOSYSINFO;
								uifc.changes=1; 
							}
							else if(i==1 && !(cfg.sys_misc&SM_NOSYSINFO)) {
								cfg.sys_misc|=SM_NOSYSINFO;
								uifc.changes=1; 
							}
							break;
853
						case 14:
854 855 856 857 858 859 860 861
							i=cfg.sys_misc&SM_NONODELIST ? 1:0;
							uifc.helpbuf=
								"`Display Active Node List During Logon:`\n"
								"\n"
								"If you want the active nodes displayed during logon, set this option\n"
								"to `Yes`.\n"
							;
							i=uifc.list(WIN_MID|WIN_SAV,0,0,0,&i,0
862
								,"Display Active Node List During Logon",uifcYesNoOpts);
863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894
							if(!i && cfg.sys_misc&SM_NONODELIST) {
								cfg.sys_misc&=~SM_NONODELIST;
								uifc.changes=1; 
							}
							else if(i==1 && !(cfg.sys_misc&SM_NONODELIST)) {
								cfg.sys_misc|=SM_NONODELIST;
								uifc.changes=1; 
							}
							break;
						} 
					}
				break;
			case 10:    /* New User Values */
				done=0;
				while(!done) {
					i=0;
					sprintf(opt[i++],"%-27.27s%u","Level",cfg.new_level);
					sprintf(opt[i++],"%-27.27s%s","Flag Set #1"
						,ltoaf(cfg.new_flags1,str));
					sprintf(opt[i++],"%-27.27s%s","Flag Set #2"
						,ltoaf(cfg.new_flags2,str));
					sprintf(opt[i++],"%-27.27s%s","Flag Set #3"
						,ltoaf(cfg.new_flags3,str));
					sprintf(opt[i++],"%-27.27s%s","Flag Set #4"
						,ltoaf(cfg.new_flags4,str));
					sprintf(opt[i++],"%-27.27s%s","Exemptions"
						,ltoaf(cfg.new_exempt,str));
					sprintf(opt[i++],"%-27.27s%s","Restrictions"
						,ltoaf(cfg.new_rest,str));
					sprintf(opt[i++],"%-27.27s%s","Expiration Days"
						,ultoa(cfg.new_expire,str,10));

895
					u32toac(cfg.new_cdt,str,',');
896
					sprintf(opt[i++],"%-27.27s%s","Credits",str);
897
					u32toac(cfg.new_min,str,',');
898 899 900 901 902 903 904 905 906 907 908
					sprintf(opt[i++],"%-27.27s%s","Minutes",str);
					sprintf(opt[i++],"%-27.27s%s","Editor"
						,cfg.new_xedit);
					sprintf(opt[i++],"%-27.27s%s","Command Shell"
						,cfg.shell[cfg.new_shell]->code);
					if(cfg.new_prot!=' ')
						sprintf(str,"%c",cfg.new_prot);
					else
						strcpy(str,"None");
					sprintf(opt[i++],"%-27.27s%s","Download Protocol",str);
					sprintf(opt[i++],"%-27.27s%hu","Days of New Messages", cfg.new_msgscan_init);
909
					sprintf(opt[i++],"%-27.27s%s", "Gender Options", cfg.new_genders);
910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983
					strcpy(opt[i++],"Default Toggles...");
					strcpy(opt[i++],"Question Toggles...");
					opt[i][0]=0;
					uifc.helpbuf=
						"`New User Values:`\n"
						"\n"
						"This menu allows you to determine the default settings for new users.\n"
					;
					switch(uifc.list(WIN_ACT|WIN_BOT|WIN_RHT,0,0,60,&new_dflt,0
						,"New User Values",opt)) {
						case -1:
							done=1;
							break;
						case 0:
							ultoa(cfg.new_level,str,10);
							uifc.helpbuf=
								"`New User Security Level:`\n"
								"\n"
								"This is the security level automatically given to new users.\n"
							;
							uifc.input(WIN_SAV|WIN_MID,0,0,"Security Level"
								,str,2,K_EDIT|K_NUMBER);
							cfg.new_level=atoi(str);
							break;
						case 1:
							truncsp(ltoaf(cfg.new_flags1,str));
							uifc.helpbuf=
								"`New User Security Flags:`\n"
								"\n"
								"These are the security flags automatically given to new users.\n"
							;
							uifc.input(WIN_SAV|WIN_MID,0,0,"Flag Set #1"
								,str,26,K_EDIT|K_UPPER|K_ALPHA);
							cfg.new_flags1=aftol(str);
							break;
						case 2:
							truncsp(ltoaf(cfg.new_flags2,str));
							uifc.helpbuf=
								"`New User Security Flags:`\n"
								"\n"
								"These are the security flags automatically given to new users.\n"
							;
							uifc.input(WIN_SAV|WIN_MID,0,0,"Flag Set #2"
								,str,26,K_EDIT|K_UPPER|K_ALPHA);
							cfg.new_flags2=aftol(str);
							break;
						case 3:
							truncsp(ltoaf(cfg.new_flags3,str));
							uifc.helpbuf=
								"`New User Security Flags:`\n"
								"\n"
								"These are the security flags automatically given to new users.\n"
							;
							uifc.input(WIN_SAV|WIN_MID,0,0,"Flag Set #3"
								,str,26,K_EDIT|K_UPPER|K_ALPHA);
							cfg.new_flags3=aftol(str);
							break;
						case 4:
							truncsp(ltoaf(cfg.new_flags4,str));
							uifc.helpbuf=
								"`New User Security Flags:`\n"
								"\n"
								"These are the security flags automatically given to new users.\n"
							;
							uifc.input(WIN_SAV|WIN_MID,0,0,"Flag Set #4"
								,str,26,K_EDIT|K_UPPER|K_ALPHA);
							cfg.new_flags4=aftol(str);
							break;
						case 5:
							truncsp(ltoaf(cfg.new_exempt,str));
							uifc.helpbuf=
								"`New User Exemption Flags:`\n"
								"\n"
								"These are the exemptions that are automatically given to new users.\n"
Rob Swindell's avatar
Rob Swindell committed
984 985
								"\n"
								"See `http://wiki.synchro.net/access:exemptions` for details.\n"
986 987 988 989 990 991 992 993 994 995 996
							;
							uifc.input(WIN_SAV|WIN_MID,0,0,"Exemption Flags",str,26
								,K_EDIT|K_UPPER|K_ALPHA);
							cfg.new_exempt=aftol(str);
							break;
						case 6:
							truncsp(ltoaf(cfg.new_rest,str));
							uifc.helpbuf=
								"`New User Restriction Flags:`\n"
								"\n"
								"These are the restrictions that are automatically given to new users.\n"
Rob Swindell's avatar
Rob Swindell committed
997 998
								"\n"
								"See `http://wiki.synchro.net/access:restrictions` for details.\n"
999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041
							;
							uifc.input(WIN_SAV|WIN_MID,0,0,"Restriction Flags",str,26
								,K_EDIT|K_UPPER|K_ALPHA);
							cfg.new_rest=aftol(str);
							break;
						case 7:
							ultoa(cfg.new_expire,str,10);
							uifc.helpbuf=
								"`New User Expiration Days:`\n"
								"\n"
								"If you wish new users to have an automatic expiration date, set this\n"
								"value to the number of days before the user will expire. To disable\n"
								"New User expiration, set this value to `0`.\n"
							;
							uifc.input(WIN_SAV|WIN_MID,0,0,"Expiration Days",str,4
								,K_EDIT|K_NUMBER);
							cfg.new_expire=atoi(str);
							break;
						case 8:
							ultoa(cfg.new_cdt,str,10);
							uifc.helpbuf=
								"`New User Credits:`\n"
								"\n"
								"This is the amount of credits that are automatically given to new users.\n"
							;
							uifc.input(WIN_SAV|WIN_MID,0,0,"Credits",str,10
								,K_EDIT|K_NUMBER);
							cfg.new_cdt=atol(str);
							break;
						case 9:
							ultoa(cfg.new_min,str,10);
							uifc.helpbuf=
								"`New User Minutes:`\n"
								"\n"
								"This is the number of extra minutes automatically given to new users.\n"
							;
							uifc.input(WIN_SAV|WIN_MID,0,0,"Minutes (Time Credit)"
								,str,10,K_EDIT|K_NUMBER);
							cfg.new_min=atol(str);
							break;
						case 10:
							if(!cfg.total_xedits) {
								uifc.msg("No External Editors Configured");
1042 1043
								break; 
							}
1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111
							strcpy(opt[0],"Internal");
							for(i=1;i<=cfg.total_xedits;i++)
								strcpy(opt[i],cfg.xedit[i-1]->code);
							opt[i][0]=0;
							i=0;
							uifc.helpbuf=
								"`New User Editor:`\n"
								"\n"
								"You can use this option to select the default editor for new users.\n"
							;
							i=uifc.list(WIN_SAV|WIN_RHT,2,1,13,&i,0,"Editors",opt);
							if(i==-1)
								break;
							uifc.changes=1;
							if(i && i<=cfg.total_xedits)
								sprintf(cfg.new_xedit,"%-.8s",cfg.xedit[i-1]->code);
							else
								cfg.new_xedit[0]=0;
							break;
						case 11:
							for(i=0;i<cfg.total_shells && i<MAX_OPTS;i++)
								sprintf(opt[i],"%-.8s",cfg.shell[i]->code);
							opt[i][0]=0;
							i=0;
							uifc.helpbuf=
								"`New User Command Shell:`\n"
								"\n"
								"You can use this option to select the default command shell for new\n"
								"users.\n"
							;
							i=uifc.list(WIN_SAV|WIN_RHT,2,1,13,&i,0
								,"Command Shells",opt);
							if(i==-1)
								break;
							cfg.new_shell=i;
							uifc.changes=1;
							break;
						case 12:
							uifc.helpbuf=
								"`New User Default Download Protocol:`\n"
								"\n"
								"This option allows you to set the default download protocol of new users\n"
								"(protocol command key or `BLANK` for no default).\n"
							;
							sprintf(str,"%c",cfg.new_prot);
							uifc.input(WIN_SAV|WIN_MID,0,0
								,"Default Download Protocol (SPACE=Disabled)"
								,str,1,K_EDIT|K_UPPER);
							cfg.new_prot=str[0];
							if(cfg.new_prot<' ')
								cfg.new_prot=' ';
							break;
						case 13:
							uifc.helpbuf=
								"`New User Days of New Messages:`\n"
								"\n"
								"This option allows you to set the number of days worth of messages\n"
								"which will be included in the new user's first `new message scan`.\n"
								"\n"
								"The value `0` means there will be `no` new messages for the new user.\n"
							;
							sprintf(str,"%hu",cfg.new_msgscan_init);
							uifc.input(WIN_SAV|WIN_MID,0,0
								,"Days of New Messages for New User's first new message scan"
								,str,4,K_EDIT|K_NUMBER);
							cfg.new_msgscan_init=atoi(str);
							break;
						case 14:
1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123
							uifc.helpbuf=
								"`New User Gender Options:`\n"
								"\n"
								"This is a list of single-character gender options for new users to\n"
								"choose from.\n"
								"\n"
								"Default: `MFX`\n"
							;
							uifc.input(WIN_SAV|WIN_MID,0,0,"Gender Options"
								,cfg.new_genders, sizeof(cfg.new_genders) -1 , K_EDIT|K_UPPER);
							break;
						case 15:
1124 1125 1126 1127 1128 1129 1130 1131
							uifc.helpbuf=
								"`New User Default Toggle Options:`\n"
								"\n"
								"This menu contains the default state of new user toggle options. All new\n"
								"users on your system will have their defaults set according to the\n"
								"settings on this menu. The user can then change them to his or her\n"
								"liking.\n"
								"\n"
Rob Swindell's avatar
Rob Swindell committed
1132 1133
								"See the Synchronet User Manual (`http://synchro.net/docs/user.html`)\n"
								"for more information on the individual options available.\n"
1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175
							;
							j=0;
							k=0;
							while(1) {
								i=0;
								sprintf(opt[i++],"%-27.27s %-3.3s"
									,"Expert Menu Mode"
									,cfg.new_misc&EXPERT ? "Yes":"No");
								sprintf(opt[i++],"%-27.27s %-3.3s"
									,"Screen Pause"
									,cfg.new_misc&UPAUSE ? "Yes":"No");
								sprintf(opt[i++],"%-27.27s %-3.3s"
									,"Spinning Cursor"
									,cfg.new_misc&SPIN ? "Yes":"No");
								sprintf(opt[i++],"%-27.27s %-3.3s"
									,"Clear Screen"
									,cfg.new_misc&CLRSCRN ? "Yes":"No");
								sprintf(opt[i++],"%-27.27s %-3.3s"
									,"Ask For New Scan"
									,cfg.new_misc&ASK_NSCAN ? "Yes":"No");
								sprintf(opt[i++],"%-27.27s %-3.3s"
									,"Ask For Your Msg Scan"
									,cfg.new_misc&ASK_SSCAN ? "Yes":"No");
								sprintf(opt[i++],"%-27.27s %-3.3s"
									,"Automatic New File Scan"
									,cfg.new_misc&ANFSCAN ? "Yes":"No");
								sprintf(opt[i++],"%-27.27s %-3.3s"
									,"Remember Current Sub-board"
									,cfg.new_misc&CURSUB ? "Yes":"No");
								sprintf(opt[i++],"%-27.27s %-3.3s"
									,"Batch Download File Flag"
									,cfg.new_misc&BATCHFLAG ? "Yes":"No");
								sprintf(opt[i++],"%-27.27s %-3.3s"
									,"Extended File Descriptions"
									,cfg.new_misc&EXTDESC ? "Yes":"No");
								sprintf(opt[i++],"%-27.27s %-3.3s"
									,"Hot Keys"
									,cfg.new_misc&COLDKEYS ? "No":"Yes");
								sprintf(opt[i++],"%-27.27s %-3.3s"
									,"Auto Hang-up After Xfer"
									,cfg.new_misc&AUTOHANG ? "Yes":"No");
								opt[i][0]=0;
Rob Swindell's avatar
Rob Swindell committed
1176
								j=uifc.list(WIN_BOT|WIN_RHT|WIN_SAV,2,1,0,&j,&k
1177 1178 1179
									,"Default Toggle Options",opt);
								if(j==-1)
									break;
1180
								uifc.changes=1;
1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219
								switch(j) {
									case 0:
										cfg.new_misc^=EXPERT;
										break;
									case 1:
										cfg.new_misc^=UPAUSE;
										break;
									case 2:
										cfg.new_misc^=SPIN;
										break;
									case 3:
										cfg.new_misc^=CLRSCRN;
										break;
									case 4:
										cfg.new_misc^=ASK_NSCAN;
										break;
									case 5:
										cfg.new_misc^=ASK_SSCAN;
										break;
									case 6:
										cfg.new_misc^=ANFSCAN;
										break;
									case 7:
										cfg.new_misc^=CURSUB;
										break;
									case 8:
										cfg.new_misc^=BATCHFLAG;
										break;
									case 9:
										cfg.new_misc^=EXTDESC;
										break;
									case 10:
										cfg.new_misc^=COLDKEYS;
										break;
									case 11:
										cfg.new_misc^=AUTOHANG;
										break;
									
								} 
1220
							}
rswindell's avatar
rswindell committed
1221
							break;
1222
						case 16: