|
|
1.1.1.2 ! root 1: /* scfgmsg.c */ ! 2: ! 3: /* $Id: scfgmsg.c,v 1.35 2011/06/30 03:07:04 rswindell Exp $ */ ! 4: ! 5: /**************************************************************************** ! 6: * @format.tab-size 4 (Plain Text/Source Code File Header) * ! 7: * @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) * ! 8: * * ! 9: * Copyright 2011 Rob Swindell - http://www.synchro.net/copyright.html * ! 10: * * ! 11: * This program is free software; you can redistribute it and/or * ! 12: * modify it under the terms of the GNU General Public License * ! 13: * as published by the Free Software Foundation; either version 2 * ! 14: * of the License, or (at your option) any later version. * ! 15: * See the GNU General Public License for more details: gpl.txt or * ! 16: * http://www.fsf.org/copyleft/gpl.html * ! 17: * * ! 18: * Anonymous FTP access to the most recent released source is available at * ! 19: * ftp://vert.synchro.net, ftp://cvs.synchro.net and ftp://ftp.synchro.net * ! 20: * * ! 21: * Anonymous CVS access to the development source and modification history * ! 22: * is available at cvs.synchro.net:/cvsroot/sbbs, example: * ! 23: * cvs -d :pserver:[email protected]:/cvsroot/sbbs login * ! 24: * (just hit return, no password is necessary) * ! 25: * cvs -d :pserver:[email protected]:/cvsroot/sbbs checkout src * ! 26: * * ! 27: * For Synchronet coding style and modification guidelines, see * ! 28: * http://www.synchro.net/source.html * ! 29: * * ! 30: * You are encouraged to submit any modifications (preferably in Unix diff * ! 31: * format) via e-mail to [email protected] * ! 32: * * ! 33: * Note: If this box doesn't appear square, then you need to fix your tabs. * ! 34: ****************************************************************************/ ! 35: ! 36: #include "scfg.h" ! 37: ! 38: char *utos(char *str) ! 39: { ! 40: static char out[128]; ! 41: int i; ! 42: ! 43: for(i=0;str[i] && i<sizeof(out)-1;i++) ! 44: if(str[i]=='_') ! 45: out[i]=' '; ! 46: else ! 47: out[i]=str[i]; ! 48: out[i]=0; ! 49: return(out); ! 50: } ! 51: ! 52: char *stou(char *str) ! 53: { ! 54: static char out[128]; ! 55: int i; ! 56: ! 57: for(i=0;str[i];i++) ! 58: if(str[i]==' ') ! 59: out[i]='_'; ! 60: else ! 61: out[i]=str[i]; ! 62: out[i]=0; ! 63: return(out); ! 64: } ! 65: ! 66: void clearptrs(int subnum) ! 67: { ! 68: char str[256]; ! 69: ushort idx,scancfg; ! 70: int file,i,gi; ! 71: long l=0L; ! 72: glob_t g; ! 73: ! 74: uifc.pop("Clearing Pointers..."); ! 75: sprintf(str,"%suser/ptrs/*.ixb",cfg.data_dir); ! 76: ! 77: glob(str,0,NULL,&g); ! 78: for(gi=0;gi<g.gl_pathc;gi++) { ! 79: ! 80: if(flength(g.gl_pathv[gi])>=((long)cfg.sub[subnum]->ptridx+1L)*10L) { ! 81: if((file=nopen(g.gl_pathv[gi],O_WRONLY))==-1) { ! 82: errormsg(WHERE,ERR_OPEN,g.gl_pathv[gi],O_WRONLY); ! 83: bail(1); ! 84: } ! 85: while(filelength(file)<(long)(cfg.sub[subnum]->ptridx)*10) { ! 86: lseek(file,0L,SEEK_END); ! 87: idx=tell(file)/10; ! 88: for(i=0;i<cfg.total_subs;i++) ! 89: if(cfg.sub[i]->ptridx==idx) ! 90: break; ! 91: write(file,&l,sizeof(l)); ! 92: write(file,&l,sizeof(l)); ! 93: scancfg=0xff; ! 94: if(i<cfg.total_subs) { ! 95: if(!(cfg.sub[i]->misc&SUB_NSDEF)) ! 96: scancfg&=~SUB_CFG_NSCAN; ! 97: if(!(cfg.sub[i]->misc&SUB_SSDEF)) ! 98: scancfg&=~SUB_CFG_SSCAN; ! 99: } else /* Default to scan OFF for unknown sub */ ! 100: scancfg&=~(SUB_CFG_NSCAN|SUB_CFG_SSCAN); ! 101: write(file,&scancfg,sizeof(scancfg)); ! 102: } ! 103: lseek(file,((long)cfg.sub[subnum]->ptridx)*10L,SEEK_SET); ! 104: write(file,&l,sizeof(l)); /* date set to null */ ! 105: write(file,&l,sizeof(l)); /* date set to null */ ! 106: scancfg=0xff; ! 107: if(!(cfg.sub[subnum]->misc&SUB_NSDEF)) ! 108: scancfg&=~SUB_CFG_NSCAN; ! 109: if(!(cfg.sub[subnum]->misc&SUB_SSDEF)) ! 110: scancfg&=~SUB_CFG_SSCAN; ! 111: write(file,&scancfg,sizeof(scancfg)); ! 112: close(file); ! 113: } ! 114: } ! 115: globfree(&g); ! 116: uifc.pop(0); ! 117: } ! 118: ! 119: void msgs_cfg() ! 120: { ! 121: static int dflt,msgs_dflt,bar; ! 122: char str[256],str2[256],done=0; ! 123: char* p; ! 124: char* tp; ! 125: char tmp[128]; ! 126: char tmp_code[32]; ! 127: int j,k,l,q,s; ! 128: int i,file,ptridx,n; ! 129: unsigned total_subs; ! 130: long ported; ! 131: sub_t tmpsub; ! 132: static grp_t savgrp; ! 133: FILE* stream; ! 134: ! 135: while(1) { ! 136: for(i=0;i<cfg.total_grps && i<MAX_OPTS;i++) ! 137: sprintf(opt[i],"%-25s",cfg.grp[i]->lname); ! 138: opt[i][0]=0; ! 139: j=WIN_ORG|WIN_ACT|WIN_CHE; ! 140: if(cfg.total_grps) ! 141: j|=WIN_DEL|WIN_DELACT|WIN_GET; ! 142: if(cfg.total_grps<MAX_OPTS) ! 143: j|=WIN_INS|WIN_INSACT|WIN_XTR; ! 144: if(savgrp.sname[0]) ! 145: j|=WIN_PUT; ! 146: SETHELP(WHERE); ! 147: /* ! 148: `Message Groups:` ! 149: ! 150: This is a listing of message groups for your BBS. Message groups are ! 151: used to logically separate your message `sub-boards` into groups. Every ! 152: sub-board belongs to a message group. You must have at least one message ! 153: group and one sub-board configured. ! 154: ! 155: One popular use for message groups is to separate local sub-boards and ! 156: networked sub-boards. One might have a `Local` message group that contains ! 157: non-networked sub-boards of various topics and also have a `FidoNet` ! 158: message group that contains sub-boards that are echoed across FidoNet. ! 159: Some sysops separate sub-boards into more specific areas such as `Main`, ! 160: `Technical`, or `Adult`. If you have many sub-boards that have a common ! 161: subject denominator, you may want to have a separate message group for ! 162: those sub-boards for a more organized message structure. ! 163: */ ! 164: i=uifc.list(j,0,0,45,&msgs_dflt,&bar,"Message Groups",opt); ! 165: if(i==-1) { ! 166: j=save_changes(WIN_MID); ! 167: if(j==-1) ! 168: continue; ! 169: if(!j) { ! 170: write_msgs_cfg(&cfg,backup_level); ! 171: refresh_cfg(&cfg); ! 172: } ! 173: return; ! 174: } ! 175: if((i&MSK_ON)==MSK_INS) { ! 176: i&=MSK_OFF; ! 177: SETHELP(WHERE); ! 178: /* ! 179: `Group Long Name:` ! 180: ! 181: This is a description of the message group which is displayed when a ! 182: user of the system uses the `/*` command from the main menu. ! 183: */ ! 184: strcpy(str,"Main"); ! 185: if(uifc.input(WIN_MID|WIN_SAV,0,0,"Group Long Name",str,LEN_GLNAME ! 186: ,K_EDIT)<1) ! 187: continue; ! 188: SETHELP(WHERE); ! 189: /* ! 190: `Group Short Name:` ! 191: ! 192: This is a short description of the message group which is used for the ! 193: main menu and reading message prompts. ! 194: */ ! 195: sprintf(str2,"%.*s",LEN_GSNAME,str); ! 196: if(uifc.input(WIN_MID,0,0,"Group Short Name",str2,LEN_GSNAME,K_EDIT)<1) ! 197: continue; ! 198: if((cfg.grp=(grp_t **)realloc(cfg.grp,sizeof(grp_t *)*(cfg.total_grps+1)))==NULL) { ! 199: errormsg(WHERE,ERR_ALLOC,nulstr,cfg.total_grps+1); ! 200: cfg.total_grps=0; ! 201: bail(1); ! 202: continue; ! 203: } ! 204: ! 205: if(cfg.total_grps) { /* was cfg.total_subs (?) */ ! 206: for(j=cfg.total_grps;j>i;j--) /* insert above */ ! 207: cfg.grp[j]=cfg.grp[j-1]; ! 208: for(j=0;j<cfg.total_subs;j++) /* move sub group numbers */ ! 209: if(cfg.sub[j]->grp>=i) ! 210: cfg.sub[j]->grp++; ! 211: } ! 212: ! 213: if((cfg.grp[i]=(grp_t *)malloc(sizeof(grp_t)))==NULL) { ! 214: errormsg(WHERE,ERR_ALLOC,nulstr,sizeof(grp_t)); ! 215: continue; ! 216: } ! 217: memset((grp_t *)cfg.grp[i],0,sizeof(grp_t)); ! 218: strcpy(cfg.grp[i]->lname,str); ! 219: strcpy(cfg.grp[i]->sname,str2); ! 220: cfg.total_grps++; ! 221: uifc.changes=1; ! 222: continue; ! 223: } ! 224: if((i&MSK_ON)==MSK_DEL) { ! 225: i&=MSK_OFF; ! 226: SETHELP(WHERE); ! 227: /* ! 228: `Delete All Data in Group:` ! 229: ! 230: If you wish to delete the messages in all the sub-boards in this group, ! 231: select `Yes`. ! 232: */ ! 233: j=1; ! 234: strcpy(opt[0],"Yes"); ! 235: strcpy(opt[1],"No"); ! 236: opt[2][0]=0; ! 237: j=uifc.list(WIN_MID|WIN_SAV,0,0,0,&j,0,"Delete All Data in Group",opt); ! 238: if(j==-1) ! 239: continue; ! 240: if(j==0) ! 241: for(j=0;j<cfg.total_subs;j++) ! 242: if(cfg.sub[j]->grp==i) { ! 243: sprintf(str,"%s%s.s*" ! 244: ,cfg.grp[cfg.sub[j]->grp]->code_prefix ! 245: ,cfg.sub[j]->code_suffix); ! 246: strlwr(str); ! 247: if(!cfg.sub[j]->data_dir[0]) ! 248: sprintf(tmp,"%ssubs/",cfg.data_dir); ! 249: else ! 250: strcpy(tmp,cfg.sub[j]->data_dir); ! 251: delfiles(tmp,str); ! 252: clearptrs(j); ! 253: } ! 254: free(cfg.grp[i]); ! 255: for(j=0;j<cfg.total_subs;) { ! 256: if(cfg.sub[j]->grp==i) { /* delete subs of this group */ ! 257: free(cfg.sub[j]); ! 258: cfg.total_subs--; ! 259: k=j; ! 260: while(k<cfg.total_subs) { /* move all subs down */ ! 261: cfg.sub[k]=cfg.sub[k+1]; ! 262: for(q=0;q<cfg.total_qhubs;q++) ! 263: for(s=0;s<cfg.qhub[q]->subs;s++) ! 264: if(cfg.qhub[q]->sub[s]==k) ! 265: cfg.qhub[q]->sub[s]--; ! 266: k++; ! 267: } ! 268: } ! 269: else j++; ! 270: } ! 271: for(j=0;j<cfg.total_subs;j++) /* move sub group numbers down */ ! 272: if(cfg.sub[j]->grp>i) ! 273: cfg.sub[j]->grp--; ! 274: cfg.total_grps--; ! 275: while(i<cfg.total_grps) { ! 276: cfg.grp[i]=cfg.grp[i+1]; ! 277: i++; ! 278: } ! 279: uifc.changes=1; ! 280: continue; ! 281: } ! 282: if((i&MSK_ON)==MSK_GET) { ! 283: i&=MSK_OFF; ! 284: savgrp=*cfg.grp[i]; ! 285: continue; ! 286: } ! 287: if((i&MSK_ON)==MSK_PUT) { ! 288: i&=MSK_OFF; ! 289: *cfg.grp[i]=savgrp; ! 290: uifc.changes=1; ! 291: continue; ! 292: } ! 293: done=0; ! 294: while(!done) { ! 295: j=0; ! 296: sprintf(opt[j++],"%-27.27s%s","Long Name",cfg.grp[i]->lname); ! 297: sprintf(opt[j++],"%-27.27s%s","Short Name",cfg.grp[i]->sname); ! 298: sprintf(opt[j++],"%-27.27s%s","Internal Code Prefix",cfg.grp[i]->code_prefix); ! 299: sprintf(opt[j++],"%-27.27s%.40s","Access Requirements" ! 300: ,cfg.grp[i]->arstr); ! 301: strcpy(opt[j++],"Clone Options"); ! 302: strcpy(opt[j++],"Export Areas..."); ! 303: strcpy(opt[j++],"Import Areas..."); ! 304: strcpy(opt[j++],"Message Sub-boards..."); ! 305: opt[j][0]=0; ! 306: sprintf(str,"%s Group",cfg.grp[i]->sname); ! 307: SETHELP(WHERE); ! 308: /* ! 309: `Message Group Configuration:` ! 310: ! 311: This menu allows you to configure the security requirements for access ! 312: to this message group. You can also add, delete, and configure the ! 313: sub-boards of this group by selecting the `Messages Sub-boards...` option. ! 314: */ ! 315: switch(uifc.list(WIN_ACT,6,4,60,&dflt,0,str,opt)) { ! 316: case -1: ! 317: done=1; ! 318: break; ! 319: case 0: ! 320: SETHELP(WHERE); ! 321: /* ! 322: `Group Long Name:` ! 323: ! 324: This is a description of the message group which is displayed when a ! 325: user of the system uses the `/*` command from the main menu. ! 326: */ ! 327: strcpy(str,cfg.grp[i]->lname); /* save incase setting to null */ ! 328: if(!uifc.input(WIN_MID|WIN_SAV,0,17,"Name to use for Listings" ! 329: ,cfg.grp[i]->lname,LEN_GLNAME,K_EDIT)) ! 330: strcpy(cfg.grp[i]->lname,str); ! 331: break; ! 332: case 1: ! 333: SETHELP(WHERE); ! 334: /* ! 335: `Group Short Name:` ! 336: ! 337: This is a short description of the message group which is used for ! 338: main menu and reading messages prompts. ! 339: */ ! 340: uifc.input(WIN_MID|WIN_SAV,0,17,"Name to use for Prompts" ! 341: ,cfg.grp[i]->sname,LEN_GSNAME,K_EDIT); ! 342: break; ! 343: case 2: ! 344: SETHELP(WHERE); ! 345: /* ! 346: `Internal Code Prefix:` ! 347: ! 348: This is an `optional` code prefix used to help generate unique internal ! 349: codes for the sub-boards in this message group. If this option ! 350: is used, sub-board internal codes will be constructed from this prefix ! 351: and the specified code suffix for each sub-board. ! 352: */ ! 353: uifc.input(WIN_MID|WIN_SAV,0,17,"Internal Code Prefix" ! 354: ,cfg.grp[i]->code_prefix,LEN_CODE,K_EDIT|K_UPPER); ! 355: break; ! 356: case 3: ! 357: sprintf(str,"%s Group",cfg.grp[i]->sname); ! 358: getar(str,cfg.grp[i]->arstr); ! 359: break; ! 360: case 4: /* Clone Options */ ! 361: j=0; ! 362: strcpy(opt[0],"Yes"); ! 363: strcpy(opt[1],"No"); ! 364: opt[2][0]=0; ! 365: SETHELP(WHERE); ! 366: /* ! 367: `Clone Sub-board Options:` ! 368: ! 369: If you want to clone the options of the first sub-board of this group ! 370: into all sub-boards of this group, select `Yes`. ! 371: ! 372: The options cloned are posting requirements, reading requirements, ! 373: operator requirments, moderated user requirments, toggle options, ! 374: network options (including EchoMail origin line, EchoMail address, ! 375: and QWK Network tagline), maximum number of messages, maximum number ! 376: of CRCs, maximum age of messages, storage method, and data directory. ! 377: */ ! 378: j=uifc.list(WIN_MID|WIN_SAV,0,0,0,&j,0 ! 379: ,"Clone Options of First Sub-board into All of Group",opt); ! 380: if(j==0) { ! 381: k=-1; ! 382: for(j=0;j<cfg.total_subs;j++) ! 383: if(cfg.sub[j]->grp==i) { ! 384: if(k==-1) ! 385: k=j; ! 386: else { ! 387: uifc.changes=1; ! 388: cfg.sub[j]->misc=(cfg.sub[k]->misc|SUB_HDRMOD); ! 389: strcpy(cfg.sub[j]->post_arstr,cfg.sub[k]->post_arstr); ! 390: strcpy(cfg.sub[j]->read_arstr,cfg.sub[k]->read_arstr); ! 391: strcpy(cfg.sub[j]->op_arstr,cfg.sub[k]->op_arstr); ! 392: strcpy(cfg.sub[j]->mod_arstr,cfg.sub[k]->mod_arstr); ! 393: strcpy(cfg.sub[j]->origline,cfg.sub[k]->origline); ! 394: strcpy(cfg.sub[j]->tagline,cfg.sub[k]->tagline); ! 395: strcpy(cfg.sub[j]->data_dir,cfg.sub[k]->data_dir); ! 396: strcpy(cfg.sub[j]->post_sem,cfg.sub[k]->post_sem); ! 397: cfg.sub[j]->maxmsgs=cfg.sub[k]->maxmsgs; ! 398: cfg.sub[j]->maxcrcs=cfg.sub[k]->maxcrcs; ! 399: cfg.sub[j]->maxage=cfg.sub[k]->maxage; ! 400: ! 401: cfg.sub[j]->faddr=cfg.sub[k]->faddr; ! 402: } ! 403: } ! 404: } ! 405: break; ! 406: case 5: ! 407: k=0; ! 408: ported=0; ! 409: q=uifc.changes; ! 410: strcpy(opt[k++],"SUBS.TXT (Synchronet)"); ! 411: strcpy(opt[k++],"AREAS.BBS (MSG)"); ! 412: strcpy(opt[k++],"AREAS.BBS (SBBSecho)"); ! 413: strcpy(opt[k++],"FIDONET.NA (Fido)"); ! 414: opt[k][0]=0; ! 415: SETHELP(WHERE); ! 416: /* ! 417: `Export Area File Format:` ! 418: ! 419: This menu allows you to choose the format of the area file you wish to ! 420: export the current message group into. ! 421: */ ! 422: k=0; ! 423: k=uifc.list(WIN_MID|WIN_SAV,0,0,0,&k,0 ! 424: ,"Export Area File Format",opt); ! 425: if(k==-1) ! 426: break; ! 427: if(k==0) ! 428: sprintf(str,"%sSUBS.TXT",cfg.ctrl_dir); ! 429: else if(k==1) ! 430: sprintf(str,"AREAS.BBS"); ! 431: else if(k==2) ! 432: sprintf(str,"%sAREAS.BBS",cfg.data_dir); ! 433: else if(k==3) ! 434: sprintf(str,"FIDONET.NA"); ! 435: if(k && k<3) ! 436: if(uifc.input(WIN_MID|WIN_SAV,0,0,"Uplinks" ! 437: ,str2,sizeof(str2)-1,0)<=0) { ! 438: uifc.changes=q; ! 439: break; ! 440: } ! 441: if(uifc.input(WIN_MID|WIN_SAV,0,0,"Filename" ! 442: ,str,sizeof(str)-1,K_EDIT)<=0) { ! 443: uifc.changes=q; ! 444: break; ! 445: } ! 446: if(fexist(str)) { ! 447: strcpy(opt[0],"Overwrite"); ! 448: strcpy(opt[1],"Append"); ! 449: opt[2][0]=0; ! 450: j=0; ! 451: j=uifc.list(WIN_MID|WIN_SAV,0,0,0,&j,0 ! 452: ,"File Exists",opt); ! 453: if(j==-1) ! 454: break; ! 455: if(j==0) j=O_WRONLY|O_TRUNC; ! 456: else j=O_WRONLY|O_APPEND; ! 457: } ! 458: else ! 459: j=O_WRONLY|O_CREAT; ! 460: if((stream=fnopen(&file,str,j))==NULL) { ! 461: sprintf(str,"Open Failure: %d (%s)" ! 462: ,errno,strerror(errno)); ! 463: uifc.msg(str); ! 464: uifc.changes=q; ! 465: break; ! 466: } ! 467: uifc.pop("Exporting Areas..."); ! 468: for(j=0;j<cfg.total_subs;j++) { ! 469: if(cfg.sub[j]->grp!=i) ! 470: continue; ! 471: ported++; ! 472: if(k==1) { /* AREAS.BBS *.MSG */ ! 473: sprintf(str,"%s%s%s/" ! 474: ,cfg.echomail_dir ! 475: ,cfg.grp[cfg.sub[j]->grp]->code_prefix ! 476: ,cfg.sub[j]->code_suffix); ! 477: fprintf(stream,"%-30s %-20s %s\r\n" ! 478: ,str,stou(cfg.sub[j]->sname),str2); ! 479: continue; ! 480: } ! 481: if(k==2) { /* AREAS.BBS SBBSecho */ ! 482: fprintf(stream,"%s%-30s %-20s %s\r\n" ! 483: ,cfg.grp[cfg.sub[j]->grp]->code_prefix ! 484: ,cfg.sub[j]->code_suffix ! 485: ,stou(cfg.sub[j]->sname) ! 486: ,str2); ! 487: continue; ! 488: } ! 489: if(k==3) { /* FIDONET.NA */ ! 490: fprintf(stream,"%-20s %s\r\n" ! 491: ,stou(cfg.sub[j]->sname),cfg.sub[j]->lname); ! 492: continue; ! 493: } ! 494: fprintf(stream,"%s\r\n%s\r\n%s\r\n%s\r\n%s\r\n%s\r\n" ! 495: "%s\r\n%s\r\n%s\r\n" ! 496: ,cfg.sub[j]->lname ! 497: ,cfg.sub[j]->sname ! 498: ,cfg.sub[j]->qwkname ! 499: ,cfg.sub[j]->code_suffix ! 500: ,cfg.sub[j]->data_dir ! 501: ,cfg.sub[j]->arstr ! 502: ,cfg.sub[j]->read_arstr ! 503: ,cfg.sub[j]->post_arstr ! 504: ,cfg.sub[j]->op_arstr ! 505: ); ! 506: fprintf(stream,"%lX\r\n%s\r\n%s\r\n%s\r\n%s\r\n%s\r\n" ! 507: ,cfg.sub[j]->misc ! 508: ,cfg.sub[j]->tagline ! 509: ,cfg.sub[j]->origline ! 510: ,cfg.sub[j]->post_sem ! 511: ,cfg.sub[j]->newsgroup ! 512: ,smb_faddrtoa(&cfg.sub[j]->faddr,tmp) ! 513: ); ! 514: fprintf(stream,"%lu\r\n%lu\r\n%u\r\n%u\r\n%s\r\n" ! 515: ,cfg.sub[j]->maxmsgs ! 516: ,cfg.sub[j]->maxcrcs ! 517: ,cfg.sub[j]->maxage ! 518: ,cfg.sub[j]->ptridx ! 519: ,cfg.sub[j]->mod_arstr ! 520: ); ! 521: fprintf(stream,"***END-OF-SUB***\r\n\r\n"); ! 522: } ! 523: fclose(stream); ! 524: uifc.pop(0); ! 525: sprintf(str,"%lu Message Areas Exported Successfully",ported); ! 526: uifc.msg(str); ! 527: uifc.changes=q; ! 528: break; ! 529: case 6: ! 530: ported=0; ! 531: k=0; ! 532: strcpy(opt[k++],"SUBS.TXT (Synchronet)"); ! 533: strcpy(opt[k++],"AREAS.BBS (Generic)"); ! 534: strcpy(opt[k++],"AREAS.BBS (SBBSecho)"); ! 535: strcpy(opt[k++],"FIDONET.NA (Fido)"); ! 536: opt[k][0]=0; ! 537: SETHELP(WHERE); ! 538: /* ! 539: `Import Area File Format:` ! 540: ! 541: This menu allows you to choose the format of the area file you wish to ! 542: import into the current message group. ! 543: */ ! 544: k=0; ! 545: k=uifc.list(WIN_MID|WIN_SAV,0,0,0,&k,0 ! 546: ,"Import Area File Format",opt); ! 547: if(k==-1) ! 548: break; ! 549: if(k==0) ! 550: sprintf(str,"%sSUBS.TXT",cfg.ctrl_dir); ! 551: else if(k==1) ! 552: sprintf(str,"AREAS.BBS"); ! 553: else if(k==2) ! 554: sprintf(str,"%sAREAS.BBS",cfg.data_dir); ! 555: else if(k==3) ! 556: sprintf(str,"FIDONET.NA"); ! 557: if(uifc.input(WIN_MID|WIN_SAV,0,0,"Filename" ! 558: ,str,sizeof(str)-1,K_EDIT)<=0) ! 559: break; ! 560: if((stream=fnopen(&file,str,O_RDONLY))==NULL) { ! 561: uifc.msg("Open Failure"); ! 562: break; ! 563: } ! 564: uifc.pop("Importing Areas..."); ! 565: total_subs = cfg.total_subs; /* Save original number of subs */ ! 566: ptridx = 0; ! 567: while(!feof(stream)) { ! 568: if(!fgets(str,sizeof(str),stream)) break; ! 569: truncsp(str); ! 570: if(!str[0]) ! 571: continue; ! 572: if(k) { ! 573: p=str; ! 574: while(*p && *p<=' ') p++; ! 575: if(!*p || *p==';') ! 576: continue; ! 577: memset(&tmpsub,0,sizeof(sub_t)); ! 578: tmpsub.misc|= ! 579: (SUB_FIDO|SUB_NAME|SUB_TOUSER|SUB_QUOTE|SUB_HYPER); ! 580: if(k==1) { /* AREAS.BBS Generic/*.MSG */ ! 581: p=str; ! 582: SKIP_WHITESPACE(p); /* Find path */ ! 583: FIND_WHITESPACE(p); /* Skip path */ ! 584: SKIP_WHITESPACE(p); /* Find tag */ ! 585: truncstr(p," \t"); /* Truncate tag */ ! 586: SAFECOPY(tmp_code,p); /* Copy tag to internal code */ ! 587: SAFECOPY(tmpsub.lname,utos(p)); ! 588: SAFECOPY(tmpsub.sname,tmpsub.lname); ! 589: SAFECOPY(tmpsub.qwkname,tmpsub.qwkname); ! 590: } ! 591: else if(k==2) { /* AREAS.BBS SBBSecho */ ! 592: p=str; ! 593: SKIP_WHITESPACE(p); /* Find internal code */ ! 594: tp=p; ! 595: FIND_WHITESPACE(tp); ! 596: *tp=0; /* Truncate internal code */ ! 597: SAFECOPY(tmp_code,p); /* Copy internal code suffix */ ! 598: p=tp+1; ! 599: SKIP_WHITESPACE(p); /* Find echo tag */ ! 600: truncstr(p," \t"); /* Truncate tag */ ! 601: SAFECOPY(tmpsub.lname,utos(p)); ! 602: SAFECOPY(tmpsub.sname,tmpsub.lname); ! 603: SAFECOPY(tmpsub.qwkname,tmpsub.sname); ! 604: } ! 605: else if(k==3) { /* FIDONET.NA */ ! 606: p=str; ! 607: SKIP_WHITESPACE(p); /* Find echo tag */ ! 608: tp=p; ! 609: FIND_WHITESPACE(tp); /* Find end of tag */ ! 610: *tp=0; /* Truncate echo tag */ ! 611: SAFECOPY(tmp_code,p); /* Copy tag to internal code suffix */ ! 612: SAFECOPY(tmpsub.sname,utos(p)); /* ... to short name, converting underscores to spaces */ ! 613: SAFECOPY(tmpsub.qwkname,tmpsub.sname); /* ... to QWK name .... */ ! 614: p=tp+1; ! 615: SKIP_WHITESPACE(p); /* Find description */ ! 616: SAFECOPY(tmpsub.lname,p); /* Copy description to long name */ ! 617: } ! 618: } ! 619: else { ! 620: memset(&tmpsub,0,sizeof(sub_t)); ! 621: tmpsub.grp=i; ! 622: sprintf(tmpsub.lname,"%.*s",LEN_SLNAME,str); ! 623: if(!fgets(str,128,stream)) break; ! 624: truncsp(str); ! 625: sprintf(tmpsub.sname,"%.*s",LEN_SSNAME,str); ! 626: if(!fgets(str,128,stream)) break; ! 627: truncsp(str); ! 628: sprintf(tmpsub.qwkname,"%.*s",10,str); ! 629: if(!fgets(str,128,stream)) break; ! 630: truncsp(str); ! 631: SAFECOPY(tmp_code,str); ! 632: if(!fgets(str,128,stream)) break; ! 633: truncsp(str); ! 634: sprintf(tmpsub.data_dir,"%.*s",LEN_DIR,str); ! 635: if(!fgets(str,128,stream)) break; ! 636: truncsp(str); ! 637: sprintf(tmpsub.arstr,"%.*s",LEN_ARSTR,str); ! 638: if(!fgets(str,128,stream)) break; ! 639: truncsp(str); ! 640: sprintf(tmpsub.read_arstr,"%.*s",LEN_ARSTR,str); ! 641: if(!fgets(str,128,stream)) break; ! 642: truncsp(str); ! 643: sprintf(tmpsub.post_arstr,"%.*s",LEN_ARSTR,str); ! 644: if(!fgets(str,128,stream)) break; ! 645: truncsp(str); ! 646: sprintf(tmpsub.op_arstr,"%.*s",LEN_ARSTR,str); ! 647: if(!fgets(str,128,stream)) break; ! 648: truncsp(str); ! 649: tmpsub.misc=ahtoul(str); ! 650: if(!fgets(str,128,stream)) break; ! 651: truncsp(str); ! 652: sprintf(tmpsub.tagline,"%.*s",80,str); ! 653: if(!fgets(str,128,stream)) break; ! 654: truncsp(str); ! 655: sprintf(tmpsub.origline,"%.*s",50,str); ! 656: if(!fgets(str,128,stream)) break; ! 657: truncsp(str); ! 658: sprintf(tmpsub.post_sem,"%.*s",LEN_DIR,str); ! 659: if(!fgets(str,128,stream)) break; ! 660: truncsp(str); ! 661: SAFECOPY(tmpsub.newsgroup,str); ! 662: if(!fgets(str,128,stream)) break; ! 663: truncsp(str); ! 664: tmpsub.faddr=atofaddr(str); ! 665: if(!fgets(str,128,stream)) break; ! 666: truncsp(str); ! 667: tmpsub.maxmsgs=atol(str); ! 668: if(!fgets(str,128,stream)) break; ! 669: truncsp(str); ! 670: tmpsub.maxcrcs=atol(str); ! 671: if(!fgets(str,128,stream)) break; ! 672: truncsp(str); ! 673: tmpsub.maxage=atoi(str); ! 674: if(!fgets(str,128,stream)) break; ! 675: truncsp(str); ! 676: tmpsub.ptridx=atoi(str); ! 677: if(!fgets(str,128,stream)) break; ! 678: truncsp(str); ! 679: sprintf(tmpsub.mod_arstr,"%.*s",LEN_ARSTR,str); ! 680: ! 681: while(!feof(stream) ! 682: && strcmp(str,"***END-OF-SUB***")) { ! 683: if(!fgets(str,128,stream)) break; ! 684: truncsp(str); ! 685: } ! 686: } ! 687: ! 688: SAFECOPY(tmpsub.code_suffix, prep_code(tmp_code,cfg.grp[i]->code_prefix)); ! 689: truncsp(tmpsub.sname); ! 690: truncsp(tmpsub.lname); ! 691: truncsp(tmpsub.qwkname); ! 692: ! 693: if(tmpsub.code_suffix[0]==0 ! 694: || tmpsub.sname[0]==0 ! 695: || tmpsub.lname[0]==0 ! 696: || tmpsub.qwkname[0]==0) ! 697: continue; ! 698: ! 699: for(j=0;j<total_subs;j++) { ! 700: if(cfg.sub[j]->grp!=i) ! 701: continue; ! 702: if(!stricmp(cfg.sub[j]->code_suffix,tmpsub.code_suffix)) ! 703: break; ! 704: } ! 705: if(j==total_subs) { ! 706: j=cfg.total_subs; ! 707: if((cfg.sub=(sub_t **)realloc(cfg.sub ! 708: ,sizeof(sub_t *)*(cfg.total_subs+1)))==NULL) { ! 709: errormsg(WHERE,ERR_ALLOC,nulstr,cfg.total_subs+1); ! 710: cfg.total_subs=0; ! 711: bail(1); ! 712: break; ! 713: } ! 714: ! 715: if((cfg.sub[j]=(sub_t *)malloc(sizeof(sub_t))) ! 716: ==NULL) { ! 717: errormsg(WHERE,ERR_ALLOC,nulstr,sizeof(sub_t)); ! 718: break; ! 719: } ! 720: memset(cfg.sub[j],0,sizeof(sub_t)); ! 721: } ! 722: if(!k) { ! 723: n=cfg.sub[j]->ptridx; /* save original ptridx */ ! 724: memcpy(cfg.sub[j],&tmpsub,sizeof(sub_t)); ! 725: cfg.sub[j]->ptridx=n; /* restore original ptridx */ ! 726: } else { ! 727: cfg.sub[j]->grp=i; ! 728: if(cfg.total_faddrs) ! 729: cfg.sub[j]->faddr=cfg.faddr[0]; ! 730: strcpy(cfg.sub[j]->code_suffix,tmpsub.code_suffix); ! 731: strcpy(cfg.sub[j]->sname,tmpsub.sname); ! 732: strcpy(cfg.sub[j]->lname,tmpsub.lname); ! 733: strcpy(cfg.sub[j]->qwkname,tmpsub.qwkname); ! 734: strcpy(cfg.sub[j]->data_dir,tmpsub.data_dir); ! 735: if(j==cfg.total_subs) ! 736: cfg.sub[j]->maxmsgs=1000; ! 737: } ! 738: if(j==cfg.total_subs) { /* adding new sub-board */ ! 739: for(;ptridx<USHRT_MAX;ptridx++) { ! 740: for(n=0;n<total_subs;n++) ! 741: if(cfg.sub[n]->ptridx==ptridx) ! 742: break; ! 743: if(n==total_subs) ! 744: break; ! 745: } ! 746: cfg.sub[j]->ptridx=ptridx; /* use new ptridx */ ! 747: cfg.sub[j]->misc=tmpsub.misc; ! 748: cfg.total_subs++; ! 749: ptridx++; /* don't use the same ptridx for next sub */ ! 750: } ! 751: uifc.changes=1; ! 752: ported++; ! 753: } ! 754: fclose(stream); ! 755: uifc.pop(0); ! 756: sprintf(str,"%lu Message Areas Imported Successfully",ported); ! 757: uifc.msg(str); ! 758: break; ! 759: ! 760: case 7: ! 761: sub_cfg(i); ! 762: break; ! 763: } ! 764: } ! 765: } ! 766: } ! 767: ! 768: void msg_opts() ! 769: { ! 770: char str[128],*p; ! 771: static int msg_dflt; ! 772: int i,j,n; ! 773: ! 774: while(1) { ! 775: i=0; ! 776: sprintf(opt[i++],"%-33.33s%s" ! 777: ,"BBS ID for QWK Packets",cfg.sys_id); ! 778: sprintf(opt[i++],"%-33.33s%s" ! 779: ,"Local Time Zone",smb_zonestr(cfg.sys_timezone,NULL)); ! 780: sprintf(opt[i++],"%-33.33s%u seconds" ! 781: ,"Maximum Retry Time",cfg.smb_retry_time); ! 782: if(cfg.max_qwkmsgs) ! 783: sprintf(str,"%lu",cfg.max_qwkmsgs); ! 784: else ! 785: sprintf(str,"Unlimited"); ! 786: sprintf(opt[i++],"%-33.33s%s" ! 787: ,"Maximum QWK Messages",str); ! 788: if(cfg.max_qwkmsgage) ! 789: sprintf(str,"%u days",cfg.max_qwkmsgage); ! 790: else ! 791: sprintf(str,"Unlimited"); ! 792: sprintf(opt[i++],"%-33.33s%s" ! 793: ,"Maximum QWK Message Age",str); ! 794: sprintf(opt[i++],"%-33.33s%s","Pre-pack QWK Requirements",cfg.preqwk_arstr); ! 795: if(cfg.mail_maxage) ! 796: sprintf(str,"Enabled (%u days old)",cfg.mail_maxage); ! 797: else ! 798: strcpy(str,"Disabled"); ! 799: sprintf(opt[i++],"%-33.33s%s","Purge E-mail by Age",str); ! 800: if(cfg.sys_misc&SM_DELEMAIL) ! 801: strcpy(str,"Immediately"); ! 802: else ! 803: strcpy(str,"Daily"); ! 804: sprintf(opt[i++],"%-33.33s%s","Purge Deleted E-mail",str); ! 805: if(cfg.mail_maxcrcs) ! 806: sprintf(str,"Enabled (%lu mail CRCs)",cfg.mail_maxcrcs); ! 807: else ! 808: strcpy(str,"Disabled"); ! 809: sprintf(opt[i++],"%-33.33s%s","Duplicate E-mail Checking",str); ! 810: sprintf(opt[i++],"%-33.33s%s","Allow Anonymous E-mail" ! 811: ,cfg.sys_misc&SM_ANON_EM ? "Yes" : "No"); ! 812: sprintf(opt[i++],"%-33.33s%s","Allow Quoting in E-mail" ! 813: ,cfg.sys_misc&SM_QUOTE_EM ? "Yes" : "No"); ! 814: sprintf(opt[i++],"%-33.33s%s","Allow Uploads in E-mail" ! 815: ,cfg.sys_misc&SM_FILE_EM ? "Yes" : "No"); ! 816: sprintf(opt[i++],"%-33.33s%s","Allow Forwarding to NetMail" ! 817: ,cfg.sys_misc&SM_FWDTONET ? "Yes" : "No"); ! 818: sprintf(opt[i++],"%-33.33s%s","Kill Read E-mail" ! 819: ,cfg.sys_misc&SM_DELREADM ? "Yes" : "No"); ! 820: sprintf(opt[i++],"%-33.33s%s","Receive E-mail by Real Name" ! 821: ,cfg.msg_misc&MM_REALNAME ? "Yes" : "No"); ! 822: sprintf(opt[i++],"%-33.33s%s","Include Signatures in E-mail" ! 823: ,cfg.msg_misc&MM_EMAILSIG ? "Yes" : "No"); ! 824: sprintf(opt[i++],"%-33.33s%s","Users Can View Deleted Messages" ! 825: ,cfg.sys_misc&SM_USRVDELM ? "Yes" : cfg.sys_misc&SM_SYSVDELM ! 826: ? "Sysops Only":"No"); ! 827: strcpy(opt[i++],"Extra Attribute Codes..."); ! 828: opt[i][0]=0; ! 829: SETHELP(WHERE); ! 830: /* ! 831: `Message Options:` ! 832: ! 833: This is a menu of system-wide message related options. Messages include ! 834: E-mail and public posts (on sub-boards). ! 835: */ ! 836: ! 837: switch(uifc.list(WIN_ORG|WIN_ACT|WIN_MID|WIN_CHE,0,0,72,&msg_dflt,0 ! 838: ,"Message Options",opt)) { ! 839: case -1: ! 840: i=save_changes(WIN_MID); ! 841: if(i==-1) ! 842: continue; ! 843: if(!i) { ! 844: cfg.new_install=new_install; ! 845: write_msgs_cfg(&cfg,backup_level); ! 846: write_main_cfg(&cfg,backup_level); ! 847: refresh_cfg(&cfg); ! 848: } ! 849: return; ! 850: case 0: ! 851: strcpy(str,cfg.sys_id); ! 852: SETHELP(WHERE); ! 853: /* ! 854: `BBS ID for QWK Packets:` ! 855: ! 856: This is a short system ID for your BBS that is used for QWK packets. ! 857: It should be an abbreviation of your BBS name or other related string. ! 858: This ID will be used for your outgoing and incoming QWK packets. If ! 859: you plan on networking via QWK packets with another Synchronet BBS, ! 860: this ID should not begin with a number. The maximum length of the ID ! 861: is eight characters and cannot contain spaces or other invalid DOS ! 862: filename characters. In a QWK packet network, each system must have ! 863: a unique QWK system ID. ! 864: */ ! 865: ! 866: uifc.input(WIN_MID|WIN_SAV,0,0,"BBS ID for QWK Packets" ! 867: ,str,LEN_QWKID,K_EDIT|K_UPPER); ! 868: if(code_ok(str)) ! 869: strcpy(cfg.sys_id,str); ! 870: else ! 871: uifc.msg("Invalid ID"); ! 872: break; ! 873: case 1: ! 874: strcpy(opt[0],"Yes"); ! 875: strcpy(opt[1],"No"); ! 876: opt[2][0]=0; ! 877: i=0; ! 878: SETHELP(WHERE); ! 879: /* ! 880: `United States Time Zone:` ! 881: ! 882: If your local time zone is the United States, select `Yes`. ! 883: */ ! 884: ! 885: i=uifc.list(WIN_MID|WIN_SAV,0,0,0,&i,0 ! 886: ,"United States Time Zone",opt); ! 887: if(i==-1) ! 888: break; ! 889: if(i==0) { ! 890: strcpy(opt[i++],"Atlantic"); ! 891: strcpy(opt[i++],"Eastern"); ! 892: strcpy(opt[i++],"Central"); ! 893: strcpy(opt[i++],"Mountain"); ! 894: strcpy(opt[i++],"Pacific"); ! 895: strcpy(opt[i++],"Yukon"); ! 896: strcpy(opt[i++],"Hawaii/Alaska"); ! 897: strcpy(opt[i++],"Bering"); ! 898: opt[i][0]=0; ! 899: i=0; ! 900: i=uifc.list(WIN_MID|WIN_SAV,0,0,0,&i,0 ! 901: ,"Time Zone",opt); ! 902: if(i==-1) ! 903: break; ! 904: uifc.changes=1; ! 905: switch(i) { ! 906: case 0: ! 907: cfg.sys_timezone=AST; ! 908: break; ! 909: case 1: ! 910: cfg.sys_timezone=EST; ! 911: break; ! 912: case 2: ! 913: cfg.sys_timezone=CST; ! 914: break; ! 915: case 3: ! 916: cfg.sys_timezone=MST; ! 917: break; ! 918: case 4: ! 919: cfg.sys_timezone=PST; ! 920: break; ! 921: case 5: ! 922: cfg.sys_timezone=YST; ! 923: break; ! 924: case 6: ! 925: cfg.sys_timezone=HST; ! 926: break; ! 927: case 7: ! 928: cfg.sys_timezone=BST; ! 929: break; ! 930: } ! 931: strcpy(opt[0],"Yes"); ! 932: strcpy(opt[1],"No"); ! 933: opt[2][0]=0; ! 934: i=1; ! 935: i=uifc.list(WIN_MID|WIN_SAV,0,0,0,&i,0 ! 936: ,"Daylight Savings",opt); ! 937: if(i==-1) ! 938: break; ! 939: if(!i) ! 940: cfg.sys_timezone|=DAYLIGHT; ! 941: break; ! 942: } ! 943: i=0; ! 944: strcpy(opt[i++],"Midway"); ! 945: strcpy(opt[i++],"Vancouver"); ! 946: strcpy(opt[i++],"Edmonton"); ! 947: strcpy(opt[i++],"Winnipeg"); ! 948: strcpy(opt[i++],"Bogota"); ! 949: strcpy(opt[i++],"Caracas"); ! 950: strcpy(opt[i++],"Rio de Janeiro"); ! 951: strcpy(opt[i++],"Fernando de Noronha"); ! 952: strcpy(opt[i++],"Azores"); ! 953: strcpy(opt[i++],"London"); ! 954: strcpy(opt[i++],"Berlin"); ! 955: strcpy(opt[i++],"Athens"); ! 956: strcpy(opt[i++],"Moscow"); ! 957: strcpy(opt[i++],"Dubai"); ! 958: strcpy(opt[i++],"Kabul"); ! 959: strcpy(opt[i++],"Karachi"); ! 960: strcpy(opt[i++],"Bombay"); ! 961: strcpy(opt[i++],"Kathmandu"); ! 962: strcpy(opt[i++],"Dhaka"); ! 963: strcpy(opt[i++],"Bangkok"); ! 964: strcpy(opt[i++],"Hong Kong"); ! 965: strcpy(opt[i++],"Tokyo"); ! 966: strcpy(opt[i++],"Sydney"); ! 967: strcpy(opt[i++],"Noumea"); ! 968: strcpy(opt[i++],"Wellington"); ! 969: strcpy(opt[i++],"Other..."); ! 970: opt[i][0]=0; ! 971: i=0; ! 972: i=uifc.list(WIN_MID|WIN_SAV,0,0,0,&i,0 ! 973: ,"Time Zone",opt); ! 974: if(i==-1) ! 975: break; ! 976: uifc.changes=1; ! 977: switch(i) { ! 978: case 0: ! 979: cfg.sys_timezone=MID; ! 980: break; ! 981: case 1: ! 982: cfg.sys_timezone=VAN; ! 983: break; ! 984: case 2: ! 985: cfg.sys_timezone=EDM; ! 986: break; ! 987: case 3: ! 988: cfg.sys_timezone=WIN; ! 989: break; ! 990: case 4: ! 991: cfg.sys_timezone=BOG; ! 992: break; ! 993: case 5: ! 994: cfg.sys_timezone=CAR; ! 995: break; ! 996: case 6: ! 997: cfg.sys_timezone=RIO; ! 998: break; ! 999: case 7: ! 1000: cfg.sys_timezone=FER; ! 1001: break; ! 1002: case 8: ! 1003: cfg.sys_timezone=AZO; ! 1004: break; ! 1005: case 9: ! 1006: cfg.sys_timezone=LON; ! 1007: break; ! 1008: case 10: ! 1009: cfg.sys_timezone=BER; ! 1010: break; ! 1011: case 11: ! 1012: cfg.sys_timezone=ATH; ! 1013: break; ! 1014: case 12: ! 1015: cfg.sys_timezone=MOS; ! 1016: break; ! 1017: case 13: ! 1018: cfg.sys_timezone=DUB; ! 1019: break; ! 1020: case 14: ! 1021: cfg.sys_timezone=KAB; ! 1022: break; ! 1023: case 15: ! 1024: cfg.sys_timezone=KAR; ! 1025: break; ! 1026: case 16: ! 1027: cfg.sys_timezone=BOM; ! 1028: break; ! 1029: case 17: ! 1030: cfg.sys_timezone=KAT; ! 1031: break; ! 1032: case 18: ! 1033: cfg.sys_timezone=DHA; ! 1034: break; ! 1035: case 19: ! 1036: cfg.sys_timezone=BAN; ! 1037: break; ! 1038: case 20: ! 1039: cfg.sys_timezone=HON; ! 1040: break; ! 1041: case 21: ! 1042: cfg.sys_timezone=TOK; ! 1043: break; ! 1044: case 22: ! 1045: cfg.sys_timezone=SYD; ! 1046: break; ! 1047: case 23: ! 1048: cfg.sys_timezone=NOU; ! 1049: break; ! 1050: case 24: ! 1051: cfg.sys_timezone=WEL; ! 1052: break; ! 1053: default: ! 1054: if(cfg.sys_timezone>720 || cfg.sys_timezone<-720) ! 1055: cfg.sys_timezone=0; ! 1056: sprintf(str,"%02d:%02d" ! 1057: ,cfg.sys_timezone/60,cfg.sys_timezone<0 ! 1058: ? (-cfg.sys_timezone)%60 : cfg.sys_timezone%60); ! 1059: uifc.input(WIN_MID|WIN_SAV,0,0 ! 1060: ,"Time (HH:MM) East (+) or West (-) of Universal " ! 1061: "Time" ! 1062: ,str,6,K_EDIT|K_UPPER); ! 1063: cfg.sys_timezone=atoi(str)*60; ! 1064: p=strchr(str,':'); ! 1065: if(p) { ! 1066: if(cfg.sys_timezone<0) ! 1067: cfg.sys_timezone-=atoi(p+1); ! 1068: else ! 1069: cfg.sys_timezone+=atoi(p+1); ! 1070: } ! 1071: break; ! 1072: } ! 1073: break; ! 1074: case 2: ! 1075: SETHELP(WHERE); ! 1076: /* ! 1077: `Maximum Message Base Retry Time:` ! 1078: ! 1079: This is the maximum number of seconds to allow while attempting to open ! 1080: or lock a message base (a value in the range of 10 to 45 seconds should ! 1081: be fine). ! 1082: */ ! 1083: ultoa(cfg.smb_retry_time,str,10); ! 1084: uifc.input(WIN_MID|WIN_SAV,0,0 ! 1085: ,"Maximum Message Base Retry Time (in seconds)" ! 1086: ,str,2,K_NUMBER|K_EDIT); ! 1087: cfg.smb_retry_time=atoi(str); ! 1088: break; ! 1089: case 3: ! 1090: SETHELP(WHERE); ! 1091: /* ! 1092: `Maximum Messages Per QWK Packet:` ! 1093: ! 1094: This is the maximum number of messages (excluding E-mail), that a user ! 1095: can have in one QWK packet for download. This limit does not effect ! 1096: QWK network nodes (`Q` restriction). If set to `0`, no limit is imposed. ! 1097: */ ! 1098: ! 1099: ultoa(cfg.max_qwkmsgs,str,10); ! 1100: uifc.input(WIN_MID|WIN_SAV,0,0 ! 1101: ,"Maximum Messages Per QWK Packet (0=No Limit)" ! 1102: ,str,6,K_NUMBER|K_EDIT); ! 1103: cfg.max_qwkmsgs=atol(str); ! 1104: break; ! 1105: case 4: ! 1106: SETHELP(WHERE); ! 1107: /* ! 1108: `Maximum Age of Messages Imported From QWK Packets:` ! 1109: ! 1110: This is the maximum age of messages (in days), allowed for messages in ! 1111: QWK packets. Messages with an age older than this value will not be ! 1112: imported. If set to `0`, no age limit is imposed. ! 1113: */ ! 1114: ! 1115: itoa(cfg.max_qwkmsgage,str,10); ! 1116: uifc.input(WIN_MID|WIN_SAV,0,0 ! 1117: ,"Maximum Age (in days) of QWK-imported Messages (0=No Limit)" ! 1118: ,str,4,K_NUMBER|K_EDIT); ! 1119: cfg.max_qwkmsgage=atoi(str); ! 1120: break; ! 1121: case 5: ! 1122: SETHELP(WHERE); ! 1123: /* ! 1124: `Pre-pack QWK Requirements:` ! 1125: ! 1126: ALL user accounts on the BBS meeting this requirmenet will have a QWK ! 1127: packet automatically created for them every day after midnight ! 1128: (during the internal daily event). ! 1129: ! 1130: This is mainly intended for QWK network nodes that wish to save connect ! 1131: time by having their packets pre-packed. If a large number of users meet ! 1132: this requirement, it can take up a large amount of disk space on your ! 1133: system (in the `DATA\FILE` directory). ! 1134: */ ! 1135: getar("Pre-pack QWK (Use with caution!)",cfg.preqwk_arstr); ! 1136: break; ! 1137: case 6: ! 1138: sprintf(str,"%u",cfg.mail_maxage); ! 1139: SETHELP(WHERE); ! 1140: /* ! 1141: `Maximum Age of Mail:` ! 1142: ! 1143: This value is the maximum number of days that mail will be kept. ! 1144: */ ! 1145: uifc.input(WIN_MID|WIN_SAV,0,17,"Maximum Age of Mail " ! 1146: "(in days)",str,5,K_EDIT|K_NUMBER); ! 1147: cfg.mail_maxage=atoi(str); ! 1148: break; ! 1149: case 7: ! 1150: strcpy(opt[0],"Daily"); ! 1151: strcpy(opt[1],"Immediately"); ! 1152: opt[2][0]=0; ! 1153: i=cfg.sys_misc&SM_DELEMAIL ? 0:1; ! 1154: SETHELP(WHERE); ! 1155: /* ! 1156: `Purge Deleted E-mail:` ! 1157: ! 1158: If you wish to have deleted e-mail physically (and permanently) removed ! 1159: from your e-mail database immediately after a users exits the reading ! 1160: e-mail prompt, set this option to `Immediately`. ! 1161: ! 1162: For the best system performance and to avoid delays when deleting e-mail ! 1163: from a large e-mail database, set this option to `Daily` (the default). ! 1164: Your system maintenance will automatically purge deleted e-mail once a ! 1165: day. ! 1166: */ ! 1167: ! 1168: i=uifc.list(WIN_MID|WIN_SAV,0,0,0,&i,0 ! 1169: ,"Purge Deleted E-mail",opt); ! 1170: if(!i && cfg.sys_misc&SM_DELEMAIL) { ! 1171: cfg.sys_misc&=~SM_DELEMAIL; ! 1172: uifc.changes=1; ! 1173: } ! 1174: else if(i==1 && !(cfg.sys_misc&SM_DELEMAIL)) { ! 1175: cfg.sys_misc|=SM_DELEMAIL; ! 1176: uifc.changes=1; ! 1177: } ! 1178: break; ! 1179: case 8: ! 1180: sprintf(str,"%lu",cfg.mail_maxcrcs); ! 1181: SETHELP(WHERE); ! 1182: /* ! 1183: `Maximum Number of Mail CRCs:` ! 1184: ! 1185: This value is the maximum number of CRCs that will be kept for duplicate ! 1186: mail checking. Once this maximum number of CRCs is reached, the oldest ! 1187: CRCs will be automatically purged. ! 1188: */ ! 1189: uifc.input(WIN_MID|WIN_SAV,0,17,"Maximum Number of Mail " ! 1190: "CRCs",str,5,K_EDIT|K_NUMBER); ! 1191: cfg.mail_maxcrcs=atol(str); ! 1192: break; ! 1193: case 9: ! 1194: strcpy(opt[0],"Yes"); ! 1195: strcpy(opt[1],"No"); ! 1196: opt[2][0]=0; ! 1197: i=cfg.sys_misc&SM_ANON_EM ? 0:1; ! 1198: SETHELP(WHERE); ! 1199: /* ! 1200: `Allow Anonymous E-mail:` ! 1201: ! 1202: If you want users with the `A` exemption to be able to send E-mail ! 1203: anonymously, set this option to `Yes`. ! 1204: */ ! 1205: ! 1206: i=uifc.list(WIN_MID|WIN_SAV,0,0,0,&i,0 ! 1207: ,"Allow Anonymous E-mail",opt); ! 1208: if(!i && !(cfg.sys_misc&SM_ANON_EM)) { ! 1209: cfg.sys_misc|=SM_ANON_EM; ! 1210: uifc.changes=1; ! 1211: } ! 1212: else if(i==1 && cfg.sys_misc&SM_ANON_EM) { ! 1213: cfg.sys_misc&=~SM_ANON_EM; ! 1214: uifc.changes=1; ! 1215: } ! 1216: break; ! 1217: case 10: ! 1218: strcpy(opt[0],"Yes"); ! 1219: strcpy(opt[1],"No"); ! 1220: opt[2][0]=0; ! 1221: i=cfg.sys_misc&SM_QUOTE_EM ? 0:1; ! 1222: SETHELP(WHERE); ! 1223: /* ! 1224: `Allow Quoting in E-mail:` ! 1225: ! 1226: If you want your users to be allowed to use message quoting when ! 1227: responding in E-mail, set this option to `Yes`. ! 1228: */ ! 1229: ! 1230: i=uifc.list(WIN_MID|WIN_SAV,0,0,0,&i,0 ! 1231: ,"Allow Quoting in E-mail",opt); ! 1232: if(!i && !(cfg.sys_misc&SM_QUOTE_EM)) { ! 1233: cfg.sys_misc|=SM_QUOTE_EM; ! 1234: uifc.changes=1; ! 1235: } ! 1236: else if(i==1 && cfg.sys_misc&SM_QUOTE_EM) { ! 1237: cfg.sys_misc&=~SM_QUOTE_EM; ! 1238: uifc.changes=1; ! 1239: } ! 1240: break; ! 1241: case 11: ! 1242: strcpy(opt[0],"Yes"); ! 1243: strcpy(opt[1],"No"); ! 1244: opt[2][0]=0; ! 1245: i=cfg.sys_misc&SM_FILE_EM ? 0:1; ! 1246: SETHELP(WHERE); ! 1247: /* ! 1248: `Allow File Attachment Uploads in E-mail:` ! 1249: ! 1250: If you want your users to be allowed to attach an uploaded file to ! 1251: an E-mail message, set this option to `Yes`. ! 1252: */ ! 1253: ! 1254: i=uifc.list(WIN_MID|WIN_SAV,0,0,0,&i,0 ! 1255: ,"Allow File Attachment Uploads in E-mail",opt); ! 1256: if(!i && !(cfg.sys_misc&SM_FILE_EM)) { ! 1257: cfg.sys_misc|=SM_FILE_EM; ! 1258: uifc.changes=1; ! 1259: } ! 1260: else if(i==1 && cfg.sys_misc&SM_FILE_EM) { ! 1261: cfg.sys_misc&=~SM_FILE_EM; ! 1262: uifc.changes=1; ! 1263: } ! 1264: break; ! 1265: case 12: ! 1266: strcpy(opt[0],"Yes"); ! 1267: strcpy(opt[1],"No"); ! 1268: opt[2][0]=0; ! 1269: i=cfg.sys_misc&SM_FWDTONET ? 0:1; ! 1270: SETHELP(WHERE); ! 1271: /* ! 1272: `Allow Users to Have Their E-mail Forwarded to NetMail:` ! 1273: ! 1274: If you want your users to be able to have any e-mail sent to them ! 1275: optionally (at the sender's discretion) forwarded to a NetMail address, ! 1276: set this option to `Yes`. ! 1277: */ ! 1278: ! 1279: i=uifc.list(WIN_MID|WIN_SAV,0,0,0,&i,0 ! 1280: ,"Allow Forwarding of E-mail to NetMail",opt); ! 1281: if(!i && !(cfg.sys_misc&SM_FWDTONET)) { ! 1282: cfg.sys_misc|=SM_FWDTONET; ! 1283: uifc.changes=1; ! 1284: } ! 1285: else if(i==1 && cfg.sys_misc&SM_FWDTONET) { ! 1286: cfg.sys_misc&=~SM_FWDTONET; ! 1287: uifc.changes=1; ! 1288: } ! 1289: break; ! 1290: case 13: ! 1291: strcpy(opt[0],"Yes"); ! 1292: strcpy(opt[1],"No"); ! 1293: opt[2][0]=0; ! 1294: i=cfg.sys_misc&SM_DELREADM ? 0:1; ! 1295: SETHELP(WHERE); ! 1296: /* ! 1297: `Kill Read E-mail Automatically:` ! 1298: ! 1299: If this option is set to `Yes`, e-mail that has been read will be ! 1300: automatically deleted when message base maintenance is run. ! 1301: */ ! 1302: ! 1303: i=uifc.list(WIN_MID|WIN_SAV,0,0,0,&i,0 ! 1304: ,"Kill Read E-mail Automatically",opt); ! 1305: if(!i && !(cfg.sys_misc&SM_DELREADM)) { ! 1306: cfg.sys_misc|=SM_DELREADM; ! 1307: uifc.changes=1; ! 1308: } ! 1309: else if(i==1 && cfg.sys_misc&SM_DELREADM) { ! 1310: cfg.sys_misc&=~SM_DELREADM; ! 1311: uifc.changes=1; ! 1312: } ! 1313: break; ! 1314: case 14: ! 1315: strcpy(opt[0],"Yes"); ! 1316: strcpy(opt[1],"No"); ! 1317: opt[2][0]=0; ! 1318: i=cfg.msg_misc&MM_REALNAME ? 0:1; ! 1319: SETHELP(WHERE); ! 1320: /* ! 1321: `Receive E-mail by Real Name:` ! 1322: ! 1323: If this option is set to ~Yes~, e-mail messages may be received when ! 1324: addressed to a user's real name (rather than their alias). ! 1325: */ ! 1326: ! 1327: i=uifc.list(WIN_MID|WIN_SAV,0,0,0,&i,0 ! 1328: ,"Receive E-mail by Real Name",opt); ! 1329: if(!i && !(cfg.msg_misc&MM_REALNAME)) { ! 1330: cfg.msg_misc|=MM_REALNAME; ! 1331: uifc.changes=1; ! 1332: } ! 1333: else if(i==1 && cfg.msg_misc&MM_REALNAME) { ! 1334: cfg.msg_misc&=~MM_REALNAME; ! 1335: uifc.changes=1; ! 1336: } ! 1337: break; ! 1338: case 15: ! 1339: n=(cfg.sub[i]->misc&MM_EMAILSIG) ? 0:1; ! 1340: strcpy(opt[0],"Yes"); ! 1341: strcpy(opt[1],"No"); ! 1342: opt[2][0]=0; ! 1343: SETHELP(WHERE); ! 1344: /* ! 1345: `Include User Signatures in E-mail:` ! 1346: ! 1347: If you wish to have user signatures automatically appended to e-mail ! 1348: messages, set this option to ~Yes~. ! 1349: */ ! 1350: n=uifc.list(WIN_SAV|WIN_MID,0,0,0,&n,0 ! 1351: ,"Include User Signatures in E-mail",opt); ! 1352: if(n==-1) ! 1353: break; ! 1354: if(!n && !(cfg.msg_misc&MM_EMAILSIG)) { ! 1355: uifc.changes=1; ! 1356: cfg.msg_misc|=MM_EMAILSIG; ! 1357: break; ! 1358: } ! 1359: if(n==1 && cfg.msg_misc&MM_EMAILSIG) { ! 1360: uifc.changes=1; ! 1361: cfg.msg_misc&=~MM_EMAILSIG; ! 1362: } ! 1363: break; ! 1364: case 16: ! 1365: strcpy(opt[0],"Yes"); ! 1366: strcpy(opt[1],"No"); ! 1367: strcpy(opt[2],"Sysops Only"); ! 1368: opt[3][0]=0; ! 1369: i=1; ! 1370: SETHELP(WHERE); ! 1371: /* ! 1372: `Users Can View Deleted Messages:` ! 1373: ! 1374: If this option is set to `Yes`, then users will be able to view messages ! 1375: they've sent and deleted or messages sent to them and they've deleted ! 1376: with the option of un-deleting the message before the message is ! 1377: physically purged from the e-mail database. ! 1378: ! 1379: If this option is set to `No`, then when a message is deleted, it is no ! 1380: longer viewable (with SBBS) by anyone. ! 1381: ! 1382: If this option is set to `Sysops Only`, then only sysops and sub-ops (when ! 1383: appropriate) can view deleted messages. ! 1384: */ ! 1385: ! 1386: i=uifc.list(WIN_MID|WIN_SAV,0,0,0,&i,0 ! 1387: ,"Users Can View Deleted Messages",opt); ! 1388: if(!i && (cfg.sys_misc&(SM_USRVDELM|SM_SYSVDELM)) ! 1389: !=(SM_USRVDELM|SM_SYSVDELM)) { ! 1390: cfg.sys_misc|=(SM_USRVDELM|SM_SYSVDELM); ! 1391: uifc.changes=1; ! 1392: } ! 1393: else if(i==1 && cfg.sys_misc&(SM_USRVDELM|SM_SYSVDELM)) { ! 1394: cfg.sys_misc&=~(SM_USRVDELM|SM_SYSVDELM); ! 1395: uifc.changes=1; ! 1396: } ! 1397: else if(i==2 && (cfg.sys_misc&(SM_USRVDELM|SM_SYSVDELM)) ! 1398: !=SM_SYSVDELM) { ! 1399: cfg.sys_misc|=SM_SYSVDELM; ! 1400: cfg.sys_misc&=~SM_USRVDELM; ! 1401: uifc.changes=1; ! 1402: } ! 1403: break; ! 1404: case 17: ! 1405: SETHELP(WHERE); ! 1406: /* ! 1407: `Extra Attribute Codes...` ! 1408: ! 1409: Synchronet can suppport the native text attribute codes of other BBS ! 1410: programs in messages (menus, posts, e-mail, etc.) To enable the extra ! 1411: attribute codes for another BBS program, set the corresponding option ! 1412: to `Yes`. ! 1413: */ ! 1414: ! 1415: j=0; ! 1416: while(1) { ! 1417: i=0; ! 1418: sprintf(opt[i++],"%-15.15s %-3.3s","WWIV" ! 1419: ,cfg.sys_misc&SM_WWIV ? "Yes":"No"); ! 1420: sprintf(opt[i++],"%-15.15s %-3.3s","PCBoard" ! 1421: ,cfg.sys_misc&SM_PCBOARD ? "Yes":"No"); ! 1422: sprintf(opt[i++],"%-15.15s %-3.3s","Wildcat" ! 1423: ,cfg.sys_misc&SM_WILDCAT ? "Yes":"No"); ! 1424: sprintf(opt[i++],"%-15.15s %-3.3s","Celerity" ! 1425: ,cfg.sys_misc&SM_CELERITY ? "Yes":"No"); ! 1426: sprintf(opt[i++],"%-15.15s %-3.3s","Renegade" ! 1427: ,cfg.sys_misc&SM_RENEGADE ? "Yes":"No"); ! 1428: opt[i][0]=0; ! 1429: j=uifc.list(WIN_BOT|WIN_RHT|WIN_SAV,2,2,0,&j,0 ! 1430: ,"Extra Attribute Codes",opt); ! 1431: if(j==-1) ! 1432: break; ! 1433: ! 1434: uifc.changes=1; ! 1435: switch(j) { ! 1436: case 0: ! 1437: cfg.sys_misc^=SM_WWIV; ! 1438: break; ! 1439: case 1: ! 1440: cfg.sys_misc^=SM_PCBOARD; ! 1441: break; ! 1442: case 2: ! 1443: cfg.sys_misc^=SM_WILDCAT; ! 1444: break; ! 1445: case 3: ! 1446: cfg.sys_misc^=SM_CELERITY; ! 1447: break; ! 1448: case 4: ! 1449: cfg.sys_misc^=SM_RENEGADE; ! 1450: break; ! 1451: } ! 1452: } ! 1453: } ! 1454: } ! 1455: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.