Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

scfgsys.c 76 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;
rswindell's avatar
rswindell committed
65 66
	char str[81],done=0;
	int i,j,k,dflt,bar;
67 68
	char sys_pass[sizeof(cfg.sys_pass)];
	SAFECOPY(sys_pass, cfg.sys_pass);
69 70 71 72 73 74 75 76 77
	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
78

79
		SAFEPRINTF(str,"%s Password"
80 81 82
			,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)
83
			SAFEPRINTF(tmp,"Every %u Days",cfg.sys_pwdays);
84
		else if(cfg.sys_misc&SM_PWEDIT)
85
			SAFECOPY(tmp,"Yes");
86
		else
87 88 89
			SAFECOPY(tmp,"No");
		if(cfg.sys_misc&SM_PWEDIT)
			sprintf(tmp + strlen(tmp), ", %u chars minimum", cfg.min_pwlen);
90
		sprintf(opt[i++],"%-33.33s%s",str,tmp);
rswindell's avatar
rswindell committed
91

92 93 94 95 96
		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
97

98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119
		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;
120
					if(strcmp(sys_pass, cfg.sys_pass) != 0) {
121
						if(fexist("ssl.cert") || fexist("cryptlib.key") || fexist("letsyncrypt.key")) {
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140
							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);
									}

141
							if (cryptStatusOK(status = cryptKeysetOpen(&ssl_keyset, CRYPT_UNUSED, CRYPT_KEYSET_FILE, "letsyncrypt.key", CRYPT_KEYOPT_NONE))) {
142 143 144 145 146 147 148 149 150
								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))) {
151 152 153
										ignoreme = cryptAddPrivateKey(ssl_keyset, ssl_context, cfg.sys_pass);
										cryptKeysetClose(ssl_keyset);
									}
154
							}
155
							(void)ignoreme;
156 157
						}
					}
rswindell's avatar
rswindell committed
158
					save_main_cfg(&cfg,backup_level);
159 160 161 162 163 164 165 166 167 168
					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
169
				break;
170 171 172 173 174 175 176 177
			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);
178
				break;
179
			case 2:
180
				i = !(cfg.sys_timezone & US_ZONE);
181
				uifc.helpbuf=
182
					"`United States Time Zone:`\n"
183
					"\n"
184
					"If your local time zone is the United States, select `Yes`.\n"
185
				;
186

187
				i=uifc.list(WIN_MID|WIN_SAV,0,0,0,&i,0
188
					,"United States Time Zone",uifcYesNoOpts);
189 190
				if(i==-1)
					break;
191 192 193 194 195 196 197 198 199 200 201
				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;
202
					uifc.helpbuf=
203
						"`U.S. Time Zone:`\n"
204
						"\n"
205
						"Choose the region which most closely reflects your local U.S. time zone.\n"
206
					;
207 208 209
					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
210
						break;
211 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
					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; 
240
				}
rswindell's avatar
rswindell committed
241
				i=0;
242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263
				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");
264 265
				strcpy(opt[i++],"Australian Central");
				strcpy(opt[i++],"Australian Eastern");
266
				strcpy(opt[i++],"Noumea");
267
				strcpy(opt[i++],"New Zealand");
268
				strcpy(opt[i++],"Other...");
rswindell's avatar
rswindell committed
269
				opt[i][0]=0;
270
				i=0;
271
				uifc.helpbuf=
272 273 274
					"`Non-U.S. Time Zone:`\n"
					"\n"
					"Choose the region which most closely reflects your local time zone.\n"
275
					"\n"
276 277
					"Choose `Other...` if a region representing your local time zone is\n"
					"not listed (you will be able to set the UTC offset manually)."
278
				;
279 280 281 282 283 284
				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
285
					case 0:
286
						cfg.sys_timezone=MID;
rswindell's avatar
rswindell committed
287 288
						break;
					case 1:
289
						cfg.sys_timezone=VAN;
rswindell's avatar
rswindell committed
290 291
						break;
					case 2:
292 293
						cfg.sys_timezone=EDM;
						break;
rswindell's avatar
rswindell committed
294
					case 3:
295 296
						cfg.sys_timezone=WIN;
						break;
rswindell's avatar
rswindell committed
297
					case 4:
298 299
						cfg.sys_timezone=BOG;
						break;
rswindell's avatar
rswindell committed
300
					case 5:
301
						cfg.sys_timezone=CAR;
rswindell's avatar
rswindell committed
302 303
						break;
					case 6:
304
						cfg.sys_timezone=RIO;
rswindell's avatar
rswindell committed
305 306
						break;
					case 7:
307
						cfg.sys_timezone=FER;
rswindell's avatar
rswindell committed
308 309
						break;
					case 8:
310 311
						cfg.sys_timezone=AZO;
						break;
rswindell's avatar
rswindell committed
312
					case 9:
313
						cfg.sys_timezone=WET;
rswindell's avatar
rswindell committed
314 315
						break;
					case 10:
316
						cfg.sys_timezone=CET;
rswindell's avatar
rswindell committed
317 318
						break;
					case 11:
319
						cfg.sys_timezone=EET;
rswindell's avatar
rswindell committed
320 321
						break;
					case 12:
322 323
						cfg.sys_timezone=MOS;
						break;
rswindell's avatar
rswindell committed
324
					case 13:
325 326
						cfg.sys_timezone=DUB;
						break;
rswindell's avatar
rswindell committed
327
					case 14:
328
						cfg.sys_timezone=KAB;
rswindell's avatar
rswindell committed
329
						break;
rswindell's avatar
rswindell committed
330
					case 15:
331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351
						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:
352
						cfg.sys_timezone=ACST;
353 354
						break;
					case 23:
355
						cfg.sys_timezone=AEST;
356 357
						break;
					case 24:
358 359 360 361
						cfg.sys_timezone=NOU;
						break;
					case 25:
						cfg.sys_timezone=NZST;
362 363 364 365 366 367 368 369 370 371
						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);
372
						uifc.helpbuf=
373
							"`Time Zone Offset:`\n"
374
							"\n"
375 376
							"Enter your local time zone offset from Universal Time (UTC/GMT)\n"
							"in `HH:MM` format.\n"
377
						;
378
						uifc.input(WIN_MID|WIN_SAV,0,0
379 380 381 382 383 384 385 386 387 388 389
							,"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
390
						break;
391
				}
392 393
				if(SMB_TZ_HAS_DST(cfg.sys_timezone))
					configure_dst();
rswindell's avatar
rswindell committed
394
				break;
395
			case 3:
396
				uifc.helpbuf=
397
					"`System Operator:`\n"
398
					"\n"
399 400 401 402 403 404 405 406 407
					"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"
408
					"\n"
409 410 411 412 413 414 415 416
					"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"
				;
				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
417
				i = (cfg.sys_misc&SM_PWEDIT) ? 0 : 1;
418 419
				uifc.helpbuf=
					"`Allow Users to Change Their Password:`\n"
420
					"\n"
421 422 423 424 425
					"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
426
					,"Allow Users to Change Their Password",uifcYesNoOpts);
427 428 429 430 431 432 433
				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; 
434 435 436 437 438 439 440 441 442 443 444 445 446 447
				} 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;
448
				}
Rob Swindell's avatar
Rob Swindell committed
449
				i = cfg.sys_pwdays ? 0 : 1;
450
				uifc.helpbuf=
Rob Swindell's avatar
Rob Swindell committed
451
					"`Force Periodic New Password:`\n"
452
					"\n"
Rob Swindell's avatar
Rob Swindell committed
453 454
					"If you want your users to be forced to have a new password periodically,\n"
					"select `Yes`.\n"
455 456
				;
				i=uifc.list(WIN_MID|WIN_SAV,0,0,0,&i,0
Rob Swindell's avatar
Rob Swindell committed
457
					,"Force Periodic New Password",uifcYesNoOpts);
458 459 460
				if(!i) {
					ultoa(cfg.sys_pwdays,str,10);
				uifc.helpbuf=
Rob Swindell's avatar
Rob Swindell committed
461
					"`Maximum Days Between New Passwords:`\n"
462
					"\n"
Rob Swindell's avatar
Rob Swindell committed
463
					"Enter the maximum number of days allowed between password changes.\n"
464 465 466
					"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"
467
				;
Rob Swindell's avatar
Rob Swindell committed
468
					uifc.input(WIN_MID,0,0,"Maximum Days Between New Password"
469 470
						,str,5,K_NUMBER|K_EDIT);
					cfg.sys_pwdays=atoi(str); 
471
				}
472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493
				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);
494
				uifc.helpbuf=
495
					"`Maximum Days of Inactivity Before Auto-Deletion:`\n"
496
					"\n"
Rob Swindell's avatar
Rob Swindell committed
497
					"If you want users that have not logged-on in a certain period of time to\n"
498 499 500
					"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"
501
					"\n"
502
					"Users with the `P` exemption will not be deleted due to inactivity.\n"
503
				;
504 505 506 507 508 509 510 511
				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
512 513 514
					"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"
515 516 517 518 519 520 521 522
				;
				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
523
					sprintf(opt[i++],"%-33.33s%s","Allow User Aliases"
524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546
						,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");
					sprintf(opt[i++],"%-33.33s%s","Allow Sysop Logins"
						,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");
547 548
					sprintf(opt[i++],"%-33.33s%s","Require Sys Pass During Login"
						,cfg.sys_misc&SM_SYSPASSLOGIN ? "Yes" : "No");
549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564
					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
565
						case 0:
566 567 568 569 570 571 572 573 574
							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
575
								,"Allow Users to Use Aliases",uifcYesNoOpts);
576 577 578 579 580 581 582 583
							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
584 585
							break;
						case 1:
586 587 588 589
							i=cfg.sys_misc&SM_TIMEBANK ? 0:1;
							uifc.helpbuf=
								"`Allow Time Banking:`\n"
								"\n"
590
								"If you want the users of your system to be allowed to deposit\n"
591 592 593 594 595 596
								"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
597
								,"Allow Users to Deposit Time in Minute Bank",uifcYesNoOpts);
598 599 600 601 602 603 604 605 606
							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
607
						case 2:
608 609 610 611
							i=cfg.sys_misc&SM_NOCDTCVT ? 1:0;
							uifc.helpbuf=
								"`Allow Credits to be Converted into Minutes:`\n"
								"\n"
612
								"If you want the users of your system to be allowed to convert\n"
613 614 615 616 617
								"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"
618
								,uifcYesNoOpts);
619 620 621 622 623 624 625 626 627
							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
628
						case 3:
629 630 631 632
							i=cfg.sys_misc&SM_R_SYSOP ? 0:1;
							uifc.helpbuf=
								"`Allow Sysop Logins:`\n"
								"\n"
Rob Swindell's avatar
Rob Swindell committed
633 634
								"If you want to be able to login with system operator access, set this\n"
								"option to `Yes`.\n"
635 636
							;
							i=uifc.list(WIN_MID|WIN_SAV,0,0,0,&i,0
637
								,"Allow Sysop Logins",uifcYesNoOpts);
638 639 640 641 642 643 644 645 646
							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
647
						case 4:
648 649 650 651 652 653 654 655 656 657
							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
658
								,"Display/Log Passwords Locally",uifcYesNoOpts);
659 660 661 662 663 664 665 666 667
							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
668
						case 5:
669 670 671 672 673 674 675 676
							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"
677
								,uifcYesNoOpts);
678 679 680 681 682 683 684 685
							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
686 687
							break;
						case 6:
688 689 690 691 692 693 694 695 696 697 698
							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"
699
								,uifcYesNoOpts);
700 701 702 703 704 705 706 707
							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
708 709
							break;
						case 7:
710 711 712 713 714 715 716
							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
717
								,"Closed to New Users",uifcYesNoOpts);
718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737
							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"
738
								,uifcYesNoOpts);
739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756
							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
757
								,"Use Military Time Format",uifcYesNoOpts);
758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775
							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
776
								,"European Date Format",uifcYesNoOpts);
777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794
							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
795
								,"User Expires When Out-of-time",uifcYesNoOpts);
796 797 798 799 800 801 802 803 804 805
							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:
806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825
							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:
826 827 828 829 830 831 832 833
							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
834
								,"Display System Information During Logon",uifcYesNoOpts);
835 836 837 838 839 840 841 842 843
							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;
844
						case 14:
845 846 847 848 849 850 851 852
							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
853
								,"Display Active Node List During Logon",uifcYesNoOpts);
854 855 856 857 858 859 860 861 862 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 895 896 897 898 899
							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));

					ultoac(cfg.new_cdt,str);
					sprintf(opt[i++],"%-27.27s%s","Credits",str);
					ultoac(cfg.new_min,str);
					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);
900
					sprintf(opt[i++],"%-27.27s%s", "Gender Options", cfg.new_genders);
901 902 903 904 905 906 907 908 909 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
					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
975 976
								"\n"
								"See `http://wiki.synchro.net/access:exemptions` for details.\n"
977 978 979 980 981 982 983 984 985 986 987
							;
							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
988 989
								"\n"
								"See `http://wiki.synchro.net/access:restrictions` for details.\n"
990 991 992 993 994 995 996 997 998 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
							;
							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");
1033 1034
								break; 
							}
1035 1036 1037 1038 1039 1040 1041 1042 1043 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
							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:
1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114
							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:
1115 1116 1117 1118 1119 1120 1121 1122
							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
1123 1124
								"See the Synchronet User Manual (`http://synchro.net/docs/user.html`)\n"
								"for more information on the individual options available.\n"
1125 1126 1127 1128 1129 1130 1131 1132 1133 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
							;
							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
1167
								j=uifc.list(WIN_BOT|WIN_RHT|WIN_SAV,2,1,0,&j,&k
1168 1169 1170
									,"Default Toggle Options",opt);
								if(j==-1)
									break;
1171
								uifc.changes=1;
1172 1173 1174 1175 1176 1177 1178 1179 1180 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
								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;
									
								} 
1211
							}
rswindell's avatar
rswindell committed
1212
							break;
1213
						case 16:
1214
							uifc.helpbuf=
1215
								"`New User Question Toggles:`\n"
1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269