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