home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / BBS / MISC / XSRC_117.ZIP / LOGON2.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-10-23  |  21.7 KB  |  726 lines

  1. /*--------------------------------------------------------------------------*/
  2. /*                                                                          */
  3. /*   XBBS SOURCE CODE copyright (c) 1990 by M. Kimes                        */
  4. /*   All Rights Reserved                                                    */
  5. /*                                                                          */
  6. /*    For complete details of the licensing restrictions, please refer      */
  7. /*    to the License agreement, which is published in its entirety in       */
  8. /*    the in the file LICENSE.XBS.                                          */
  9. /*                                                                          */
  10. /*    USE OF THIS FILE IS SUBJECT TO THE RESTRICTIONS CONTAINED IN THE      */
  11. /*    XBBS LICENSING  AGREEMENT.  IF YOU DO NOT FIND THE TEXT OF            */
  12. /*    THIS AGREEMENT IN ANY OF THE AFOREMENTIONED FILES, OR IF YOU DO       */
  13. /*    NOT HAVE THESE FILES, YOU SHOULD IMMEDIATELY CONTACT M. KIMES         */
  14. /*    AT THE ADDRESS LISTED BELOW.  IN NO EVENT SHOULD YOU PROCEED TO USE   */
  15. /*    THIS FILE WITHOUT HAVING ACCEPTED THE TERMS OF THE XBBS LICENSING     */
  16. /*    AGREEMENT, OR SUCH OTHER AGREEMENT AS YOU ARE ABLE TO REACH WITH      */
  17. /*    M. KIMES                                                              */
  18. /*                                                                          */
  19. /*                                                                          */
  20. /* You can contact M. Kimes at the following address:                       */
  21. /*                                                                          */
  22. /* M. Kimes                         1:380/16.0@FidoNet                      */
  23. /* 542 Merrick                      (318)222-3455 data                      */
  24. /* Shreveport, LA  71104                                                    */
  25. /*                                                                          */
  26. /*                                                                          */
  27. /* Please feel free to contact me at any time to share your comments about  */
  28. /* my software and/or licensing policies.                                   */
  29. /*                                                                          */
  30. /*--------------------------------------------------------------------------*/
  31. /*======================================================================*/
  32. /*  XBBS Bulletin Board System.....NEW USER module                      */
  33. /*  Copyright (c) 1989/90 by M. Kimes -- All Rights Reserved            */
  34. /*======================================================================*/
  35.  
  36. #include "msg.h"
  37. #include "xext.h"
  38.  
  39. /* Function prototypes */
  40.  
  41. void   pascal login (void);
  42. void   pascal phonecan (char *);
  43. void   pascal xmain (void);
  44.  
  45. /* Global variables */
  46.  
  47. extern word           timetoevent;
  48.  
  49.  
  50.  
  51. void pascal login (void) {
  52.  
  53.  struct _logconfig logconf;
  54.  struct _user check;
  55.  int handlef;
  56.  char exist;
  57.  char *p=NULL;
  58.  struct ffblk f;
  59.  word x=0;              /* Once upon a time there was a bug... */
  60.  char text[133]="";
  61.  char name[39];
  62.  char y=0;
  63.  struct date tempdate;
  64.  int register xx;
  65.  char command=0;
  66.  
  67. /* Read in default new user settings */
  68.  
  69.   gettime(&timeon);
  70.   gettime(&starter);
  71.   readconfig();
  72.   strcpy(messpath,conf.messpath);
  73.   if(conf.nolmrs>4096) conf.nolmrs=4096;    /* Ijit-prevention */
  74.   lastread=(word far *)farmalloc(conf.nolmrs * sizeof(word));
  75.   if(lastread==NULL) {
  76.     gprintf(LOGONLY | LOCALONLY,"\nOut of memory for LMRs!\n");
  77.     exit(254);
  78.   }
  79.   for(x=0;x<conf.nolmrs;x++) lastread[x]=0;
  80.   fossil(INIT,0);
  81.   for (x=0;x<10;x++) event[x].secsleft=0;
  82.   memcpy(&mboard,&conf.mboard,sizeof(struct _mboard));
  83.   memcpy(&fboard,&conf.fboard,sizeof(struct _fboard));
  84.   timer_off=0;
  85.   disablesub=1;
  86.   disablejump=1;
  87.  
  88.   timelimit=timetoevent;
  89.  
  90. /* BEGIN */
  91.  
  92.   cls();
  93.   pauser=0;
  94.  
  95.        if ((handlef=oopen(searchpath("newuser.bbs"),O_RDONLY | O_BINARY | O_DENYNONE))==-1) {
  96.            printm("\nCan't read newuser config file.\n");
  97.            exit(253);
  98.        }
  99.            _read(handlef,&user,sizeof(struct _user));
  100.            _read(handlef,&logconf,sizeof(struct _logconfig));
  101.        cclose(handlef);
  102.  
  103.   gprintf(0,"\nXBBS v%s\b \b\b \b\b \b\b \b\b \b\b \b\b \b\b \b\b \b\b \b\n",XVERSION);
  104.  
  105. /* Check system event parameter */
  106.  
  107.   if (timetoevent <= logconf.loglimit) {
  108.     timelimit=240;
  109.     gprintf(0,"\n\nSorry, a system event is scheduled in %u minutes.",timetoevent);
  110.     say_prompt(232);
  111.     fossil(FLUSHOUT,0);
  112.     fossil(DTR,DOWN);
  113.     exit(254);
  114.   }
  115.  
  116.   timelimit=logconf.loglimit;
  117.   if ((baud<logconf.minbaud) and (baud!=0)) {
  118.     readfile("tooslow.xbs",1,0,0);
  119.     fossil (DTR,DOWN);
  120.     say_prompt(231);
  121.     exit(254);
  122.    }
  123.  
  124.   for (xx=0;xx<77;text[xx]='*',text[xx+1]=0,xx++);
  125.   addtolog(text);
  126.  
  127. readfile ("logo.xbs", 1,1,1);
  128.  
  129. log1:
  130.  
  131.   if (++y>logconf.nameattempts) {
  132.     say_prompt(233);
  133.     say_prompt(209);
  134.     fossil(FLUSHOUT,0);
  135.     fossil (DTR,DOWN);
  136.     userno=0;
  137.     exit(254);
  138.   }
  139.  
  140.   if (!logconf.name) {
  141.     if (!findfirst("USERINFO.XBS",&f,0)) {
  142.       if ((handlef=oopen("USERINFO.XBS",O_RDONLY | O_TEXT | O_DENYNONE))==-1) {
  143.         fgetsx(name,36,handlef);
  144.         cclose(handlef);
  145.         if (name[strlen(name)-1]=='\n') name[strlen(name)-1]=0;
  146.         goto SkipName;
  147.       }
  148.     }
  149.   }
  150.   say_prompt(234);
  151.   helpnum=501;
  152.   strcpy(name,genin (35,0,0,0,NAME));
  153.   rstrip(name);
  154.   if (stricmp(name,"New User")==0) {
  155.     fossil(DTR,DOWN);
  156.     exit (254);
  157.   }
  158.   if (*name) trashcan(name);
  159.   if (!strchr(name,' ')) {
  160.     say_prompt(210);
  161.     goto log1;
  162.   }
  163.  
  164. SkipName:
  165.  
  166.   gprintf(LOGONLY,"Online: %s @ %u baud",name,baud);
  167.  
  168. exist=findfirst(searchpath("users.bbs"),&f,0);
  169.  
  170. if ((handlef=oopen(searchpath("users.bbs"),O_RDWR | O_APPEND | O_BINARY | O_DENYNONE))==-1) {
  171.    cclose(ccreat("users.bbs",S_IWRITE));
  172.    if ((handlef=oopen(searchpath("users.bbs"),O_RDWR | O_APPEND | O_BINARY | O_DENYNONE))==-1) {
  173.         say_prompt(211);
  174.         fossil (DTR,DOWN);
  175.         exit(253);
  176.    }
  177. }
  178.  
  179. say_prompt(236);
  180. xx=0;
  181.  
  182. if ((exist==0) and (f.ff_fsize>0)) {
  183.    while (!eof(handlef)) {
  184.      xx++;
  185.      if (!(xx%50)) printm(".");
  186.      if (_read(handlef,&user,sizeof(struct _user))<1) break;
  187.      if ((strcmp(user.name,name)==0) and (!user.deleted)) break;
  188.      if ((strcmp(user.handle,name)==0) and (!user.deleted)) break;
  189.    }
  190.      if (((strcmp(user.name,name)!=0) and (strcmp(user.handle,name)!=0)) or (user.deleted)) {
  191.         cclose(handlef);
  192.         goto NotFound;
  193.      }
  194.      userno=(word)(tell(handlef)/sizeof(struct _user));
  195.      gprintf(LOCALONLY,"\n%cUser # %d",4,userno);
  196.      cclose(handlef);
  197. }
  198. else {
  199.     cclose(handlef);
  200.     goto NotFound;
  201. }
  202.  
  203. x=0;
  204.  
  205. enterpass:
  206.  
  207.    if (!logconf.pass) goto SkipPass;
  208.    if (++x>logconf.passattempts) {
  209.      say_prompt(237);
  210.      say_prompt(212);
  211.      fossil(FLUSHOUT,0);
  212.      fossil(DTR,DOWN);
  213.      userno=0;
  214.      exit (254);
  215.    }
  216.    p=NULL;
  217.      say_prompt(237);
  218.      helpnum=502;
  219.      p=genin(11,1,0,0,ALPHANUM);
  220.      rstrip(p);
  221.    if (strcmp(p,user.password)) {
  222.      say_prompt(213);
  223.      gprintf(LOGONLY,"%s%s",say_prompt(255),p);
  224.      goto enterpass;
  225.    }
  226. SkipPass:
  227.    printm("\n");
  228.    if (strcmp(name,user.name)!=0) {
  229.         gprintf(LOGONLY,"(%s)",user.name);
  230.    }
  231.  
  232.    if (baud) if(baud<conf.ansibaud) user.graphics=0;
  233.  
  234.    if ((user.stat[0])==0) {
  235.                            say_prompt(214);
  236.                            readfile("Locked.XBS",1,1,1);
  237.                            fossil(FLUSHOUT,0);
  238.                            fossil(DTR,DOWN);
  239.                            say_prompt(215);
  240.                            exit (254);
  241.    }
  242.     getdate(&tempdate);
  243.     if ((tempdate.da_mon!=user.lastdate.da_mon) or (tempdate.da_day!=user.lastdate.da_day)) {
  244.         user.callstoday=0;
  245.         user.timetoday=0;
  246.         user.uktoday=0;
  247.         user.dktoday=0;
  248.     }
  249.     if (user.callsperday) {
  250.       if (user.callstoday>=user.callsperday) {
  251.         say_prompt(216);
  252.         fossil(FLUSHOUT,0);
  253.         fossil(DTR,DOWN);
  254.         say_prompt(217);
  255.         exit(254);
  256.       }
  257.     }
  258.     else {
  259.        if (user.timetoday >= user.totaltime) {
  260.          say_prompt(218);
  261.          fossil(FLUSHOUT,0);
  262.          fossil(DTR,DOWN);
  263.          say_prompt(219);
  264.          exit(254);
  265.        }
  266.    }
  267.    if (user.callsperday) {
  268.        timelimit=user.timepercall;
  269.        if ((user.totaltime-user.timetoday)<user.timepercall) {
  270.             timelimit=(user.totaltime-user.timetoday);
  271.             say_prompt(412);
  272.             gprintf(0,"%u minutes, which is all you have left for today.\n",timelimit);
  273.        }
  274.    }
  275.    else timelimit=(user.totaltime-user.timetoday);
  276.  
  277.    getdate(&user.logondate);
  278.    gettime(&user.logontime);
  279.  
  280.    if (timetoevent<timelimit) {
  281.      gprintf(0,say_prompt(413),timetoevent-1);
  282.      timelimit=((timetoevent-1));
  283.    }
  284.  
  285.    load_lastread();
  286.  
  287.    /* This bit of code checks for a filename in homepath/force directory
  288.       consisting of user.id (8 hex digits) + nodenumber logged onto initially
  289.       and reads the file if it finds a match, then deletes the file.
  290.       Can be used for custom welcome screens, etc. */
  291.  
  292.    sprintf(text,"%s\\FORCE\\%08lu.%03hu",conf.homepath,user.id,user.node);
  293.    if(!findfirst(text,&filestat,0)) {
  294.         readfile(text,1,1,1);
  295.         unlink(text);
  296.    }
  297.  
  298.    return;
  299.  
  300.  
  301. NotFound:
  302.  
  303. cclose(handlef);
  304. userno=0;
  305. if ((handlef=oopen(searchpath("newuser.bbs"),O_RDONLY | O_BINARY | O_DENYNONE))==-1) {
  306.    printm("\nCan't open Newuser config file.\n");
  307.    exit(253);
  308. }
  309.    _read(handlef,&user,sizeof(struct _user));
  310.    _read(handlef,&logconf,sizeof(logconf));
  311.    cclose(handlef);
  312.  
  313.    printm("\n");
  314.    readfile("notfound.xbs",1,1,1);
  315.    say_prompt(238);
  316.    printm(name);
  317.    say_prompt(220);
  318.    helpnum=503;
  319.    if (*genin(1,0,1,1,YESNO)=='N') {
  320.      say_prompt(221);
  321.      goto log1;
  322.    }
  323.  
  324. /* NEWUSER LOGIN */
  325.  
  326.    if(!strcmp(name,conf.sysop)) exit(254);  /* Sysop should already have account */
  327.  
  328.     {
  329.  
  330.     /* This stuff allows the sysop to bypass the standard logon proc easily
  331.        and substitute his own */
  332.  
  333.         struct ffblk fff;
  334.         char s[133];
  335.         int x;
  336.  
  337.         strcpy(user.name,name);
  338.         userno=0;
  339.         x=findfirst("MYLOGON.XBS",&fff,0);
  340.         sprintf(s,"%sMYLOGON.XBS",conf.menupath);
  341.         if(!findfirst(s,&fff,0) || !x) {
  342.             readfile("MYLOGON.XBS",1,1,1);
  343.             carrchk();
  344.             goto SaveNewUser;
  345.         }
  346.     }
  347.  
  348.    readfile ("newuser.xbs",1,0,1);
  349.    say_prompt(239);
  350.  
  351.  
  352. NewUser:
  353.  
  354.  strcpy(user.name,name);
  355.  
  356.  userno=0;
  357.  command=0;
  358.  
  359. AdjustParms:
  360.  
  361.  switch ((int)command) {
  362.     case 0:     /* Do all of the below */
  363.     case 9:      if ((logconf.graphics) && (conf.ansiavail) && (!baud  || baud >= conf.ansibaud)) {
  364.                      readfile("graphics.xbs",1,1,1);
  365.                      say_prompt(248);
  366.                      helpnum=505;
  367.                      if(*genin(1,0,1,1,YESNO)=='Y') {
  368.                         user.graphics=0;
  369.                         user.hiok=1;
  370.                      }
  371.                      else {
  372.                         user.graphics=1;
  373.                         user.hiok=0;
  374.                      }
  375.                      printm("\n");
  376.                      usertoggle(GRAPHICS);
  377.                      printg("\x1b[0;1;32m");
  378.  
  379.                      if (logconf.ansiedit) {
  380.                          if (user.graphics && *conf.edansi) {
  381.                            readfile("fullscrn.xbs",1,1,1);
  382.                            say_prompt(249);
  383.                            helpnum=506;
  384.                            if(*genin(1,0,1,1,YESNO)=='Y') user.fullscreen=0;
  385.                            else user.fullscreen=1;
  386.                            printm("\n");
  387.                            usertoggle(FULLSCREEN);
  388.                          }
  389.                      }
  390.                    }
  391.                    else user.graphics=0;
  392.                    if (!user.graphics && logconf.graphics) {
  393.                         user.hiok=1;
  394.                         readfile("hiascii.xbs",1,1,1);
  395.                         say_prompt(470);
  396.                         helpnum=577;
  397.                         if(*genin(1,0,1,1,YESNO)=='Y') user.hiok=0;
  398.                         else user.hiok=1;
  399.                         printm("\n");
  400.                         usertoggle2(0,17);
  401.                    }
  402.                    if(command)break;
  403.  
  404. /*
  405.               if(user.graphics && (baud>1200 || !baud)) {
  406.                     alogon();
  407.                     goto SaveNewUser;
  408.                 }
  409. */
  410.  
  411.     case 1:     if (logconf.city) {
  412.                   readfile("city.xbs",1,1,1);
  413.                   say_prompt(240);
  414.                   city();
  415.                 }
  416.                 if(command) break;
  417.     case 2:     if (logconf.state) {
  418.                      readfile("state.xbs",1,1,1);
  419.                       say_prompt(241);
  420.                       state();
  421.                  }
  422.                  if(command) break;
  423.     case 3:      if (!conf.genstatezip) {
  424.                      if (logconf.zipcode) {
  425.                          readfile("zip.xbs",1,1,1);
  426.                           say_prompt(242);
  427.                           zip();
  428.                      }
  429.                  }
  430.     case 4:      if (!logconf.birth) goto SkipBirth;
  431.                  goto birthdate2;
  432. birthdate:
  433.                  say_prompt(222);
  434. birthdate2:
  435.                  readfile("birthday.xbs",1,1,1);
  436.                  p=NULL;
  437.                  say_prompt(243);
  438.                  helpnum=504;
  439.                  p=genin(8,0,0,0,DATE);
  440.                  if (strlen(p)<8) goto birthdate;
  441.                  left(text,p,2);
  442.                  if ((atoi(text)>12) or (atoi(text)<1)) goto birthdate;
  443.                  user.birthdate.da_mon=atoi(text);
  444.                  mid(text,p,3,2);
  445.                  if ((atoi(text)<1) or (atoi(text)>31)) goto birthdate;
  446.                  user.birthdate.da_day=atoi(text);
  447.                  right(text,p,4);
  448.                  getdate(&tempdate);
  449.                  if(atoi(text)<(tempdate.da_year-90) || atoi(text)>(tempdate.da_year-7)) goto birthdate;
  450.                  user.birthdate.da_year=atoi(text);
  451. SkipBirth:
  452.                  if(command)break;
  453.     case 5:      if (logconf.phone1) {
  454.                      readfile("phone1.xbs",1,1,1);
  455.                       say_prompt(244);
  456.                       phone1();
  457.                       phonecan(user.phone1);
  458.                       gprintf(LOGONLY,"%s %s",say_prompt(223),user.phone1);
  459.                  }
  460.     case 6:      if (logconf.phone2) {
  461.                       readfile("phone2.xbs",1,1,1);
  462.                       say_prompt(245);
  463.                       phone2();
  464.                       phonecan(user.phone2);
  465.                  }
  466.                  if(command) break;
  467.     case 7:      if (logconf.length) {
  468.                      readfile("length.xbs",1,1,1);
  469.                       say_prompt(246);
  470.                       length();
  471.                  }
  472.                  if(command)break;
  473.     case 8:      if (logconf.width) {
  474.                      readfile("width.xbs",1,1,1);
  475.                       say_prompt(247);
  476.                       width();
  477.                  }
  478.                  if(command)break;
  479.     case 10:       if (logconf.scrnclr) {
  480.                         readfile("clearing.xbs",1,1,1);
  481.                          say_prompt(250);
  482.                          helpnum=507;
  483.                          if(*genin(1,0,1,1,YESNO)=='Y') user.scrnclr=0;
  484.                          else user.scrnclr=1;
  485.                          printm("\n");
  486.                          usertoggle(SCRNCLR);
  487.                    }
  488.                    if(command)break;
  489.     case 11:       if (logconf.pagepause) {
  490.                        readfile("pausing.xbs",1,1,1);
  491.                          say_prompt(252);
  492.                          helpnum=508;
  493.                          if(*genin(1,0,1,1,YESNO)=='Y') user.more=0;
  494.                          else user.more=1;
  495.                          printm("\n");
  496.                          usertoggle(MORE);
  497.                    }
  498.                    if(command)break;
  499.     case 12:       if (logconf.commflag) {
  500.                        readfile("specflag.xbs",1,1,1);
  501.                          say_prompt(253);
  502.                          helpnum=509;
  503.                          if(*genin(1,0,1,1,YESNO)=='Y') user.commodore=0;
  504.                          else user.commodore=1;
  505.                          printm("\n");
  506.                          usertoggle(COMMODORE);
  507.                    }
  508.                    if(command)break;
  509.     case 13:       if (conf.numcomps) comptype();
  510.                    if(command)break;
  511.     case 14:       strcpy(user.handle,user.name);
  512.                    if (logconf.handle) {
  513.                        readfile("handle.xbs",1,1,1);
  514.                          say_prompt(254);
  515.                          strcpy(user.handle,user.name);
  516.                          helpnum=510;
  517.                          if (*genin(1,0,1,1,YESNO)=='Y') handler();
  518.                    }
  519.                    if(command) break;
  520.     case 15:       if (logconf.pass) {
  521.                        readfile("password.xbs",1,1,1);
  522.                        password();
  523.                    }
  524.                    break;
  525.     default:       printm("\nDuh....\n");
  526.                    break;
  527.  }
  528.  
  529.    say_prompt(475);
  530.    command=0;
  531.    if(logconf.city) {
  532.         gprintf(0,"1.  %s\n",user.city);
  533.    }
  534.    if(logconf.state) {
  535.         gprintf(0,"2.  %s\n",user.state);
  536.    }
  537.    if(!conf.genstatezip && logconf.zipcode) {
  538.         gprintf(0,"3.  %s\n",user.zip);
  539.    }
  540.    if(logconf.birth) {
  541.         gprintf(0,"4.  %02u/%02u/%04u\n",user.birthdate.da_mon,user.birthdate.da_day,user.birthdate.da_year);
  542.    }
  543.    if(logconf.phone1) {
  544.         gprintf(0,"5.  (%3.3s)%3.3s-%4.4s\n",user.phone1,&user.phone1[3],&user.phone1[6]);
  545.    }
  546.    if(logconf.phone2) {
  547.         gprintf(0,"6.  (%3.3s)%3.3s-%4.4s\n",user.phone2,&user.phone2[3],&user.phone2[6]);
  548.    }
  549.    if(logconf.length) {
  550.         gprintf(0,"7.  %hu\n",user.length);
  551.    }
  552.    if(logconf.width) {
  553.         gprintf(0,"8.  %hu\n",user.width);
  554.    }
  555.    if(logconf.graphics && conf.ansiavail && (!baud || baud>=conf.ansibaud)) {
  556.         printm("9.  ");
  557.         user.graphics ? say_prompt(101) : say_prompt(102);
  558.         if(user.graphics && logconf.ansiedit) {
  559.             printm("    ");
  560.             user.fullscreen ? say_prompt(104) : say_prompt(105);
  561.         }
  562.         if(!user.graphics) {
  563.             printm("    ");
  564.             user.hiok ? say_prompt(476) : say_prompt(491);
  565.         }
  566.    }
  567.    if(logconf.scrnclr) {
  568.         printm("10. ");
  569.         user.scrnclr ? say_prompt(107) : say_prompt(108);
  570.    }
  571.    if(logconf.pagepause) {
  572.         printm("11. ");
  573.         user.more ? say_prompt(125) : say_prompt(126);
  574.    }
  575.    if(logconf.commflag) {
  576.         printm("12. ");
  577.         user.commodore ? say_prompt(112) : say_prompt(113);
  578.    }
  579.    if(conf.numcomps) {
  580.       printm("13. ");
  581.       say_prompt(251);
  582.       gprintf(0,"%hu\n",user.comptype);
  583.    }
  584.    if(logconf.handle) {
  585.        gprintf(0,"14. %s\n",user.handle);
  586.    }
  587.    if(logconf.pass) {
  588.  
  589.         int register x;
  590.  
  591.         printm("15. ");
  592.         say_prompt(263);
  593.         for(x=0;x<strlen(user.password);x++) printm("-");
  594.         printm("\n");
  595.    }
  596.    say_prompt(224);
  597.    helpnum=511;
  598.    p=genin(3,0,0,0,NUM);
  599.    if(*p) {
  600.         command=(char)atoi(p);
  601.         goto AdjustParms;
  602.    }
  603.  
  604. SaveNewUser:
  605.    if ((handlef=oopen(searchpath("users.bbs"),O_RDONLY | O_BINARY | O_DENYNONE))==-1) {
  606.         printm("\nSorry, can't open my userfile.\n");
  607.         exit(253);
  608.    }
  609.    if (!logconf.phone1) goto Nodupe;
  610.  
  611.        say_prompt(225);
  612.        xx=0;
  613.        if ((!exist) && (f.ff_fsize>0)) {
  614.  
  615.          char dupe=0;
  616.  
  617.          while (!eof(handlef)) {
  618.            xx++;
  619.            if ((xx%50)==0) printm(".");
  620.            if (_read(handlef,&check,sizeof(struct _user))<1) goto Nodupe;
  621.            dupe=1;
  622.            if (!strcmp(user.phone1,check.phone1) and (!check.deleted)) break;
  623.            if (logconf.phone2) {
  624.                 if (!strcmp(user.phone1,check.phone2) and (!check.deleted)) break;
  625.                 if (!strcmp(user.phone2,check.phone1) and (!check.deleted)) break;
  626.                 if (!strcmp(user.phone2,check.phone2) and (!check.deleted)) break;
  627.            }
  628.            dupe=0;
  629.          }
  630.          if (dupe) {
  631.            say_prompt(226);
  632.            gprintf(LOGONLY,"%s same as %s",say_prompt(227),check.name);
  633.            readfile ("dupephon.xbs",1,1,1);
  634.          }
  635.        }
  636. Nodupe:
  637.        printm("\n");
  638.        lseek(handlef,0L,SEEK_END);
  639.        if ((!exist) && (f.ff_fsize>0)) userno=(word)(f.ff_fsize/sizeof(user))+1;
  640.        else userno=1;
  641.        say_prompt(228);
  642.        user.id=conf.nextid++;
  643.        user.node=nodenumber;
  644.        _write(handlef,&user,sizeof(struct _user));
  645.        cclose(handlef);
  646.        saveconfig();
  647.        save_lastread();
  648.  
  649.     if(searchpath("MSGDIRS.XBS")!=NULL) {
  650.  
  651.         int list;
  652.         char line[134];
  653.         char temp[99];
  654.  
  655.         strcpy(temp,messpath);
  656.         if((list=oopen(searchpath("MSGDIRS.XBS"),O_RDONLY | O_BINARY | O_DENYNONE))!=-1) {
  657.           while (!eof(list)) {
  658.             if(!fgetsx(line,134,list))break;
  659.             if(*line==';' || *line=='\n' || *line==' ') continue;
  660.             stripcr(line);
  661.             strcpy(messpath,line);
  662.             save_lastread();
  663.           }
  664.         }
  665.         cclose(list);
  666.         strcpy(messpath,temp);
  667.     }
  668.  
  669.        if (user.callsperday>0) timelimit=user.timepercall;
  670.        else timelimit=user.totaltime;
  671.  
  672.        helpnum=0;
  673.        readfile ("newquest.xbs",1,1,1);
  674.        if ((baud>0) && (baud<conf.ansibaud)) user.graphics=0;
  675. }
  676.  
  677.  
  678.  
  679. void pascal phonecan (char *name) {
  680.  
  681.  char check[81];
  682.  char test[11];
  683.  int register x;
  684.  int handle;
  685.  
  686.  strset(check,0);
  687.  strcpy(test,name);
  688.  
  689.  check[0]=test[0];   /* Check for all digits the same */
  690.  for(x=1;x<10;x++) {
  691.     if (toupper(test[x])!=toupper(check[0])) break;
  692.  }
  693.  if (x==10) {
  694.     say_prompt(229);
  695.     say_prompt(230);
  696.     fossil(FLUSHOUT,0);
  697.     fossil(DTR,DOWN);
  698.     carrchk();
  699.     exit(254);
  700.  }
  701.  
  702.  if ((handle=oopen(searchpath("phonecan.ctl"),O_RDONLY | O_TEXT | O_DENYNONE))==-1) return;
  703.  
  704.  while (!eof(handle)) {
  705.    if(!fgetsx(check,(81),handle)) break;
  706.    check[80]=0;
  707.    if (strlen(check)<11)goto skipcheck;
  708.    stripcr(check);
  709.    if (!stricmp(name,check)) {
  710. badname:
  711.  
  712.      cclose(handle);
  713.      readfile("phonecan.xbs",1,1,1);
  714.      say_prompt(230);
  715.      fossil(FLUSHOUT,0);
  716.      fossil(DTR,DOWN);
  717.      exit(254);
  718.    }
  719. skipcheck:
  720. ;
  721.  
  722.  }
  723.  cclose(handle);
  724. }
  725.  
  726.