home *** CD-ROM | disk | FTP | other *** search
/ The Devil's Doorknob BBS Capture (1996-2003) / devilsdoorknobbbscapture1996-2003.iso / UTIL / WWIVE / UEDIT.C < prev    next >
Text File  |  1992-05-07  |  19KB  |  800 lines

  1. /*****************************************************************************
  2.  
  3.                 WWIV Version 4
  4.                     Copyright (C) 1988-1991 by Wayne Bell
  5.  
  6. Distribution of the source code for WWIV, in any form, modified or unmodified,
  7. without PRIOR, WRITTEN APPROVAL by the author, is expressly prohibited.
  8. Distribution of compiled versions of WWIV is limited to copies compiled BY
  9. THE AUTHOR.  Distribution of any copies of WWIV not compiled by the author
  10. is expressly prohibited.
  11.  
  12.  
  13. *****************************************************************************/
  14.  
  15.  
  16.  
  17. #include "vars.h"
  18.  
  19. #pragma hdrstop
  20.  
  21.  
  22.  
  23. void deluser(int un)
  24. {
  25.   userrec u;
  26.   int i,i1,f,n;
  27.   mailrec m;
  28.   char fn[81];
  29.   votingrec v;
  30.   voting_response vr;
  31.  
  32.   read_user(un,&u);
  33.   if ((u.inact & inact_deleted)==0) {
  34.     rsm(un,&u);
  35.     dsr(u.name);
  36.     u.inact |= inact_deleted;
  37.     u.waiting=0;
  38.     write_user(un,&u);
  39.     sprintf(fn,"%sEMAIL.DAT",syscfg.datadir);
  40.     f=open(fn,O_RDWR | O_BINARY, S_IREAD | S_IWRITE);
  41.     if (f>0) {
  42.       i1=filelength(f)/sizeof(mailrec);
  43.       for (i=0; i<i1; i++) {
  44.         lseek(f,((long) i) * sizeof(mailrec), SEEK_SET);
  45.         read(f,(void *)(&m),sizeof(mailrec));
  46.         if (((m.tosys==0) && (m.touser==un)) ||
  47.             ((m.fromsys==0) && (m.fromuser==un))) {
  48.           delmail(f,i);
  49.         }
  50.       }
  51.     }
  52.     close(f);
  53.     sprintf(fn,"%sVOTING.DAT",syscfg.datadir);
  54.     f=open(fn,O_RDWR | O_BINARY, S_IREAD | S_IWRITE);
  55.     n=(int) (filelength(f) / sizeof(votingrec)) -1;
  56.     for (i=0; i<20; i++)
  57.       if (u.votes[i]) {
  58.         if (i<=n) {
  59.           lseek(f,((long) i) * sizeof(votingrec), SEEK_SET);
  60.           read(f,(void *)&v,sizeof(votingrec));
  61.           vr=v.responses[u.votes[i]-1];
  62.           vr.numresponses--;
  63.           v.responses[u.votes[i]-1]=vr;
  64.           lseek(f,((long) i) * sizeof(votingrec), SEEK_SET);
  65.           write(f,(void *)&v,sizeof(votingrec));
  66.         }
  67.         u.votes[i]=0;
  68.       }
  69.     write_user(un,&u);
  70.     close(f);
  71.   }
  72. }
  73.  
  74.  
  75. void print_data(int un, userrec *u, int lng)
  76. {
  77.   char s[81],s1[81],s2[81],s3[81],s4[81];
  78.   int i;
  79.  
  80.   outchr(12);
  81.   if ((u->inact) & inact_deleted) {
  82.     pl("7>>> 1DELETED 7<<<");
  83.     nl();
  84.   }
  85.   npr("1Name3: 5%s\r\n",nam(u,un));
  86.   npr("1RN  3: 5%s\r\n",(u->realname));
  87.   if ((u->callsign[0])!=0)
  88.     npr("1Zip 3: 5%s\r\n",(u->callsign));
  89.   npr("1PH  3: 5%s\r\n",(u->phone));
  90.   npr("1Age 3: 5%d %c  7(1%02d/%02d/%02d7)\r\n", u->age, u->sex,
  91.     u->month, u->day, u->year);
  92.   npr("1Comp3: 5%s\r\n",&(ctypes[u->comp_type][0]));
  93.   if (u->forwardusr) {
  94.     if (u->forwardsys)
  95.       npr("1Forw3: 5#%d @%d\r\n",u->forwardusr, u->forwardsys);
  96.     else
  97.       npr("1Forw3: 5#%d\r\n",u->forwardusr);
  98.   }
  99.   if (lng) {
  100.     sprintf(s,"PW  : %s\r\n",u->pw);
  101.     if (lecho)
  102.       outs(s);
  103.     if ((incom) && (thisuser.sl==255))
  104.       pr1(s);
  105.     npr("1Last3: 5%s   %s\r\n",(u->laston),(u->firston));
  106.     if (u->emailnet)
  107.       npr("1Msgs3: 5P1=3%d 5E1=3%d 5F1=3%d 5W1=3%d 5O1=3%d\r\n",u->msgpost, u->emailsent,
  108.       u->feedbacksent, u->waiting, u->emailnet);
  109.     else
  110.       npr("1Msgs3: 5P1=3%d 5E1=3%d 5F1=3%d 5W1=3%d\r\n",u->msgpost, u->emailsent,
  111.       u->feedbacksent, u->waiting);
  112.     npr("1Log 3: 5%d  %d  I=%d\r\n",u->logons,
  113.     (strcmp(u->laston,date()))?0:u->ontoday,
  114.     u->illegal);
  115.     npr("1UpDn3: 5U1=3%d-%ldk   5D1=3%d-%ldk\r\n",u->uploaded,u->uk,
  116.     u->downloaded, u->dk);
  117.     npr("1Baud3: 5%u\r\n", u->lastrate);
  118.   }
  119.   if (u->note[0])
  120.     npr("1Note3: 5%s\r\n",(u->note));
  121.   if (u->ass_pts)
  122.     npr("1Ass 3: 5%d\r\n",(u->ass_pts));
  123.   nl();
  124.   npr("1SL  3: 5%d  1DSL3=5%d\r\n", u->sl, u->dsl);
  125.   if ((u->sysopsub)!=255)
  126.     npr("1SySu3: 5%d\r\n",u->sysopsub);
  127.   if (u->exempt)
  128.     npr("1Exem3: 5%d\r\n",u->exempt);
  129.   strcpy(s3,restrict_string);
  130.   for (i=0; i<=15; i++) {
  131.     if (u->ar & (1 << i))
  132.       s[i]='A'+i;
  133.     else
  134.       s[i]=32;
  135.     if (u->dar & (1 << i))
  136.       s1[i]='A'+i;
  137.     else
  138.       s1[i]=32;
  139.     if (u->restrict & (1 << i))
  140.       s2[i]=s3[i];
  141.     else
  142.       s2[i]=32;
  143.   }
  144.   s[16]=0;
  145.   s1[16]=0;
  146.   s2[16]=0;
  147.   if ((u->ar)!=0)
  148.     npr("1AR  3: 5%s\r\n",s);
  149.   if ((u->dar)!=0)
  150.     npr("1DAR 3: 5%s\r\n",s1);
  151.   if ((u->restrict)!=0)
  152.     npr("1Rest3: 5%s\r\n",s2);
  153.   if (u->wwiv_regnum)
  154.     npr("1WWIV3: 5%ld\r\n", u->wwiv_regnum);
  155. }
  156.  
  157.  
  158. #ifdef OLD_SEARCH
  159.  
  160. int matchuser(int un)
  161. {
  162.   userrec u;
  163.   int ok;
  164.   long l;
  165.   unsigned int d;
  166.  
  167.   read_user(un,&u);
  168.   ok=1;
  169.  
  170.   if ((u.age>agemax) || (u.age<agemin))
  171.     ok=0;
  172.   if ((u.sl>slmax) || (u.sl<slmin))
  173.     ok=0;
  174.   if ((u.dsl>dslmax) || (u.dsl<dslmin))
  175.     ok=0;
  176.   if (ressex)
  177.     if (u.sex!=ressex)
  178.       ok=0;
  179.   if (arres)
  180.     if ((u.ar & arres)==0)
  181.       ok=0;
  182.   if (darres)
  183.     if ((u.dar & darres)==0)
  184.       ok=0;
  185.   time(&l);
  186.   d=(unsigned int)( (l-u.daten)/24.0/3600.0 );
  187.   if ((d>daysmax) || (d<daysmin))
  188.     ok=0;
  189.  
  190.   return(ok);
  191. }
  192.  
  193.  
  194. void changeopt()
  195. {
  196.   int done,i,i1;
  197.   char s[81],s1[81],s2[81],s3[81],ch;
  198.  
  199.   done=0;
  200.   do {
  201.     outchr(12);
  202.     npr("1. SL     : %d to %d\r\n",slmin, slmax);
  203.     npr("2. DSL    : %d to %d\r\n",dslmin, dslmax);
  204.     npr("3. AGE    : %d to %d\r\n",agemin, agemax);
  205.     npr("4. Last On: %d to %d days ago\r\n",daysmin, daysmax);
  206.     if (ressex) {
  207.       npr("5. Sex    : %c\r\n",ressex);
  208.     } else
  209.       pl("5. Sex    : Inactive");
  210.     s[0]=0;
  211.     s[1]=0;
  212.     s1[0]=0;
  213.     s1[1]=0;
  214.     for (i=0; i<16; i++) {
  215.       if ((1 << i) & arres)
  216.         s[0]='A'+i;
  217.       if ((1 << i) & darres)
  218.         s1[0]='A'+i;
  219.     }
  220.     if (s[0])
  221.       npr("6. AR     : %s\r\n",s);
  222.     else
  223.       pl("6. AR     : Inactive");
  224.     if (s1[0])
  225.       npr("7. DAR    : %s\r\n",s1);
  226.     else
  227.       pl("7. DAR    : Inactive");
  228.     nl();
  229.     prt(2,"Search Options (1-7,Q) : ");
  230.     ch=onek("Q1234567");
  231.     nl();
  232.     switch(ch) {
  233.       case 'Q':
  234.         done=1;
  235.         break;
  236.       case '1':
  237.         prt(2,"Min SL? ");
  238.         input(s,3);
  239.         if (s[0])
  240.           slmin=atoi(s);
  241.         prt(2,"Max SL? ");
  242.         input(s,3);
  243.         if (s[0])
  244.           slmax=atoi(s);
  245.         break;
  246.       case '2':
  247.         prt(2,"Min DSL? ");
  248.         input(s,3);
  249.         if (s[0])
  250.           dslmin=atoi(s);
  251.         prt(2,"Max DSL? ");
  252.         input(s,3);
  253.         if (s[0])
  254.           dslmax=atoi(s);
  255.         break;
  256.       case '3':
  257.         prt(2,"Min age? ");
  258.         input(s,3);
  259.         if (s[0])
  260.           agemin=atoi(s);
  261.         prt(2,"Max age? ");
  262.         input(s,3);
  263.         if (s[0])
  264.           agemax=atoi(s);
  265.         break;
  266.       case '4':
  267.         prt(2,"Min days since logon? ");
  268.         input(s,4);
  269.         if (s[0])
  270.           daysmin=atoi(s);
  271.         prt(2,"Max days since logon? ");
  272.         input(s,4);
  273.         if (s[0])
  274.           daysmax=atoi(s);
  275.         break;
  276.       case '5':
  277.         prt(2,"Sex restrict (spc=none) ? ");
  278.         ressex=onek(" MF");
  279.         if (ressex==32)
  280.           ressex=0;
  281.         break;
  282.       case '6':
  283.         prt(2,"AR restrict (spc=none) ? ");
  284.         s[0]=onek("ABCDEFGHIJKLMNOP ");
  285.         if (s[0])
  286.           arres=1 << (s[0]-'A');
  287.         else
  288.           arres=0;
  289.         break;
  290.       case '7':
  291.         prt(2,"DAR restrict (spc=none) ? ");
  292.         s[0]=onek("ABCDEFGHIJKLMNOP ");
  293.         if (s[0])
  294.           darres=1 << (s[0]-'A');
  295.         else
  296.           darres=0;
  297.         break;
  298.     }
  299.   } while ((!done) && (!hangup));
  300. }
  301.  
  302.  
  303. #else
  304. /****************************************************************************/
  305.  
  306.  
  307.  
  308. int matchuser(int un)
  309. {
  310.   userrec u;
  311.  
  312.   read_user(un,&u);
  313.   sp=search_pattern;
  314.   return(match_user(&u));
  315. }
  316.  
  317.  
  318. int match_user(userrec *u)
  319. {
  320.   int ok=1,not=0,done=0,less=0,cpf=0,cpp=0,and=1,gotfcn=0,evalit=0,tmp,tmp1,tmp2;
  321.   char fcn[12],parm[12];
  322.   long l;
  323.  
  324.   do {
  325.     if (*sp==0)
  326.       done=1;
  327.     else {
  328.       if (strchr("()|&!<>",*sp)) {
  329.         switch(*sp++) {
  330.           case '(':
  331.             evalit=2;
  332.             break;
  333.           case ')':
  334.             done=1;
  335.             break;
  336.           case '|':
  337.             and=0;
  338.             break;
  339.           case '&':
  340.             and=1;
  341.             break;
  342.           case '!':
  343.             not=1;
  344.             break;
  345.           case '<':
  346.             less=1;
  347.             break;
  348.           case '>':
  349.             less=0;
  350.             break;
  351.         }
  352.       } else if (*sp=='[') {
  353.         gotfcn=1;
  354.         sp++;
  355.       } else if (*sp==']') {
  356.         evalit=1;
  357.         ++sp;
  358.       } else if (*sp!=' ') {
  359.         if (gotfcn) {
  360.           if (cpp<10)
  361.             parm[cpp++]=*sp++;
  362.         } else {
  363.           if (cpf<10)
  364.             fcn[cpf++]=*sp++;
  365.         }
  366.       } else
  367.         ++sp;
  368.       if (evalit) {
  369.         if (evalit==1) {
  370.           fcn[cpf]=0;
  371.           parm[cpp]=0;
  372.           tmp=1;
  373.           tmp1=atoi(parm);
  374.  
  375.           if (!strcmp(fcn,"SL")) {
  376.             if (less)
  377.               tmp=(tmp1>u->sl);
  378.             else
  379.               tmp=(tmp1<u->sl);
  380.           } else if (!strcmp(fcn,"DSL")) {
  381.             if (less)
  382.               tmp=(tmp1>u->dsl);
  383.             else
  384.               tmp=(tmp1<u->dsl);
  385.           } else if (!strcmp(fcn,"AR")) {
  386.             if ((parm[0]>='A') && (parm[0]<='P')) {
  387.               tmp1=1 << (parm[0]-'A');
  388.               if (u->ar & tmp1)
  389.                 tmp=1;
  390.               else
  391.                 tmp=0;
  392.             } else
  393.               tmp=0;
  394.           } else if (!strcmp(fcn,"DAR")) {
  395.             if ((parm[0]>='A') && (parm[0]<='P')) {
  396.               tmp1=1 << (parm[0]-'A');
  397.               if (u->dar & tmp1)
  398.                 tmp=1;
  399.               else
  400.                 tmp=0;
  401.             } else
  402.               tmp=0;
  403.           } else if (!strcmp(fcn,"SEX")) {
  404.             tmp=parm[0]==u->sex;
  405.           } else if (!strcmp(fcn,"AGE")) {
  406.             if (less)
  407.               tmp=(tmp1>u->age);
  408.             else
  409.               tmp=(tmp1<u->age);
  410.           } else if (!strcmp(fcn,"LASTON")) {
  411.             time(&l);
  412.             tmp2=(unsigned int)( (l-u->daten)/24.0/3600.0 );
  413.             if (less)
  414.               tmp=tmp2<tmp1;
  415.             else
  416.               tmp=tmp2>tmp1;
  417.           } else if (!strcmp(fcn,"AREACODE")) {
  418.             tmp=(!strncmp(parm,u->phone,3));
  419.           } else if (!strcmp(fcn,"RESTRICT")) {
  420.             ;
  421.           } else if (!strcmp(fcn,"LOGONS")) {
  422.             if (less)
  423.               tmp=thisuser.logons<tmp1;
  424.             else
  425.               tmp=thisuser.logons>tmp1;
  426.           }
  427.  
  428.         } else
  429.           tmp=match_user(u);
  430.  
  431.         if (not)
  432.           tmp=!tmp;
  433.         if (and)
  434.           ok = ok && tmp;
  435.         else
  436.           ok = ok || tmp;
  437.  
  438.         not=less=cpf=cpp=gotfcn=evalit=0;
  439.         and=1;
  440.       }
  441.     }
  442.   } while (!done);
  443.   return(ok);
  444. }
  445.  
  446. /****************************************************************************/
  447.  
  448. void changeopt()
  449. {
  450.   helpl=42;
  451.   outchr(12);
  452.   pl("1Current search string5:");
  453.   if (search_pattern[0])
  454.     pl(search_pattern);
  455.   else
  456.     pl("7-1NONE7-");
  457.   nl();
  458.   nl();
  459.   prt(5,"Change it3? ");
  460.   if (yn()) {
  461.     pl("1Enter new search pattern5:");
  462.     prt(1,":3");
  463.     input(search_pattern,75);
  464.   }
  465.   helpl=0;
  466. }
  467.  
  468.  
  469. /****************************************************************************/
  470.  
  471. #endif
  472.  
  473. #pragma warn -par
  474.  
  475. void uedit(int usern, int other)
  476. {
  477.   char s[81],s1[81],s2[81],ch,ch1;
  478.   int i,i1,i2,i3,un,done,nu,done1,full,temp_full,tempu,posts;
  479.   userrec u;
  480.  
  481.   if (incom)
  482.     full=0;
  483.   else
  484.     full=1;
  485.   un=usern;
  486.   done=0;
  487.   read_user(un,&u);
  488.   nu=number_userrecs();
  489.   do {
  490.     read_user(un,&u);
  491.     done1=0;
  492.     temp_full=0;
  493.     do {
  494.       print_data(un,&u, ((full) || (temp_full)));
  495.       nl();
  496.       prt(1,"Uedit 5: ");
  497.       if ((thisuser.sl==255) || (wfc))
  498.     ch=onek("Q[]{}/,.?UDRNLCPOGMSTEYZABI~:");
  499.       else
  500.     ch=onek("Q[]{}/,.?UDRNLCPOGMSTEYZABI");
  501.       switch(ch) {
  502.         case 'Q':
  503.           done=1;
  504.           done1=1;
  505.           break;
  506.         case ']':
  507.           ++un;
  508.           if (un>nu)
  509.             un=1;
  510.           done1=1;
  511.           break;
  512.         case '[':
  513.           --un;
  514.           if (un==0)
  515.             un=nu;
  516.           done1=1;
  517.           break;
  518.         case '/':
  519.           changeopt();
  520.           break;
  521.         case '}':
  522.           tempu=un;
  523.           ++un;
  524.           if (un>nu)
  525.             un=1;
  526.           while ((un!=tempu) && (!matchuser(un))) {
  527.             ++un;
  528.             if (un>nu)
  529.               un=1;
  530.           }
  531.           done1=1;
  532.           break;
  533.         case '{':
  534.           tempu=un;
  535.           --un;
  536.           if (un<1)
  537.             un=nu;
  538.           while ((un!=tempu) && (!matchuser(un))) {
  539.             --un;
  540.             if (un<1)
  541.               un=nu;
  542.           }
  543.           done1=1;
  544.           break;
  545.         case '.':
  546.           full=(!full);
  547.           temp_full=full;
  548.           break;
  549.         case ',':
  550.           temp_full=(!temp_full);
  551.           break;
  552.         case '?':
  553.           printmenu(6);
  554.           getkey();
  555.           break;
  556.         case 'D':
  557.           if (((u.inact & inact_deleted)==0) && (actsl>u.sl)) {
  558.             prt(5,"Delete? ");
  559.             if (yn()) {
  560.               deluser(un);
  561.               read_user(un,&u);
  562.             }
  563.           }
  564.           break;
  565.         case 'R':
  566.           if (u.inact & inact_deleted) {
  567.             u.inact ^= inact_deleted;
  568.             isr(un,u.name);
  569.             write_user(un,&u);
  570.           }
  571.           break;
  572.         case 'U':
  573.           nl();
  574.       prt(1,"User name/number5: ");
  575.       input(s,30);
  576.       i=finduser1(s);
  577.       if (i>0) {
  578.         un=i;
  579.         done1=1;
  580.       }
  581.       break;
  582.     case 'N':
  583.       nl();
  584.       prt(1,"New name3? ");
  585.       input(s,30);
  586.       if (s[0]) {
  587.         if (finduser(s)<1) {
  588.           dsr(u.name);
  589.           strcpy(u.name,s);
  590.               isr(un,u.name);
  591.               write_user(un,&u);
  592.             }
  593.           }
  594.           break;
  595.         case 'L':
  596.           nl();
  597.       prt(1,"New real name3? ");
  598.       inputl(s,20);
  599.       if (s[0]) {
  600.         strcpy(u.realname,s);
  601.         write_user(un,&u);
  602.       }
  603.       break;
  604.     case 'C':
  605.       nl();
  606.       prt(1,"New callsign3? ");
  607.       input(s,6);
  608.       if (s[0]) {
  609.             strcpy(u.callsign,s);
  610.             write_user(un,&u);
  611.           } else {
  612.         prt(1,"Delete callsign3? ");
  613.         if (yn()) {
  614.           u.callsign[0]=0;
  615.           write_user(un,&u);
  616.         }
  617.       }
  618.       break;
  619.     case 'P':
  620.       nl();
  621.       prt(1,"New phone number3? ");
  622.       input(s,12);
  623.           if (s[0]) {
  624.             strcpy(u.phone,s);
  625.             write_user(un,&u);
  626.           }
  627.           break;
  628.         case 'O':
  629.           nl();
  630.       prt(1,"New note3? ");
  631.       inputl(s,39);
  632.       strcpy(u.note,s);
  633.       write_user(un,&u);
  634.       break;
  635.     case 'G':
  636.       nl();
  637.       outstr("Gender (M,F) :");
  638.       u.sex=onek("MF");
  639.       sprintf(s,"1Current birthdate3: 5%02d1/5%02d1/5%02d",(int) u.month,
  640.          (int) u.day,
  641.                  (int) u.year);
  642.           pl(s);
  643.           input_age(&u);
  644.           write_user(un,&u);
  645.           break;
  646.         case 'M':
  647.           nl();
  648.       pl("1Known computer types3:");
  649.       nl();
  650.       for (i=0; ctypes[i]; i++)
  651.         npr("7[1%d7]3.5 %s\r\n",i+1,ctypes[i]);
  652.       nl();
  653.       prt(1,"Enter new computer type3: ");
  654.       input(s,2);
  655.       i1=atoi(s);
  656.       if ((i1>0) && (i1<=i)) {
  657.         u.comp_type=i1-1;
  658.             if (checkcomp("Ami"))
  659.               u.colors[0]=4;
  660.             else
  661.               u.colors[0]=7;
  662.             write_user(un,&u);
  663.           }
  664.           break;
  665.         case 'S':
  666.           if (u.sl==255)
  667.             break;
  668.           if (u.sl>=actsl)
  669.             break;
  670.           nl();
  671.       prt(1,"New SL3? ");
  672.       input(s,3);
  673.       i=atoi(s);
  674.       if ((!wfc) && (i>=actsl))
  675.         i=-1;
  676.       if ((i>=0) && (i<255) && (s[0])) {
  677.         u.sl=i;
  678.         write_user(un,&u);
  679.         if (un==usernum)
  680.           actsl=i;
  681.       }
  682.       break;
  683.     case 'T':
  684.       if (u.dsl==255)
  685.         break;
  686.       if (u.dsl>=thisuser.dsl)
  687.         break;
  688.       nl();
  689.       prt(1,"New DSL3? ");
  690.       input(s,3);
  691.           i=atoi(s);
  692.           if ((!wfc) && (i>=thisuser.dsl))
  693.             i=-1;
  694.           if ((i>=0) && (i<255) && (s[0])) {
  695.             u.dsl=i;
  696.             write_user(un,&u);
  697.           }
  698.           break;
  699.         case 'E':
  700.           nl();
  701.       prt(1,"New Exemption3? ");
  702.       input(s,3);
  703.       i=atoi(s);
  704.       if ((i>=0) && (i<=255) && (s[0])) {
  705.         u.exempt=i;
  706.         write_user(un,&u);
  707.       }
  708.       break;
  709.     case 'Y':
  710.       nl();
  711.       prt(1,"New sysop sub3? ");
  712.       input(s,3);
  713.           i=atoi(s);
  714.           if ((i>=0) && (i<=255) && (s[0])) {
  715.             u.sysopsub=i;
  716.             write_user(un,&u);
  717.           }
  718.           break;
  719.         case 'Z':
  720.           nl();
  721.           npr("        %s\r\n",restrict_string);
  722.       do {
  723.         prt(1,"Toggle3? ");
  724.         s[0]=13;
  725.         s[1]='?';
  726.             strcpy(&(s[2]),restrict_string);
  727.             ch1=onek(s);
  728.             if (ch1==32)
  729.               ch1=13;
  730.         if (ch1=='?')
  731.           printmenu(10);
  732.             if ((ch1!=13) && (ch1!='?')) {
  733.               i=-1;
  734.               for (i1=0; i1<16; i1++)
  735.                 if (ch1==s[i1+2])
  736.                   i=i1;
  737.               if (i>-1) {
  738.                 u.restrict ^= (1 << i);
  739.                 write_user(un,&u);
  740.               }
  741.             }
  742.       } while ((!hangup) && (ch1=='?'));
  743.           break;
  744.         case 'A':
  745.           nl();
  746.       prt(1,"Toggle which AR3? ");
  747.       ch1=onek("\rABCDEFGHIJKLMNOP");
  748.       if (ch1!=13) {
  749.         ch1-='A';
  750.         if ((wfc) || (thisuser.ar & (1 << ch1))) {
  751.           u.ar ^= (1 << ch1);
  752.           write_user(un,&u);
  753.         }
  754.       }
  755.       break;
  756.     case 'I':
  757.       nl();
  758.       prt(1,"Toggle which DAR3? ");
  759.       ch1=onek("\rABCDEFGHIJKLMNOP");
  760.           if (ch1!=13) {
  761.             ch1-='A';
  762.             if ((wfc) || (thisuser.dar & (1 << ch1))) {
  763.               u.dar ^= (1 << ch1);
  764.               write_user(un,&u);
  765.             }
  766.           }
  767.           break;
  768.     case '~':
  769.       nl();
  770.       prt(1,"Enter new ass points :");
  771.       input(s,3);
  772.       i=atoi(s);
  773.         u.ass_pts=i;
  774.         write_user(un,&u);
  775.       break;
  776.     case 'B':
  777.       nl();
  778.       prt(1,"Enter Messages Posted :");
  779.       input(s,3);
  780.       i=atoi(s);
  781.         u.msgpost=i;
  782.         write_user(un,&u);
  783.       break;
  784.     case ':':
  785.       u.year=0;
  786.       write_user(un,&u);
  787.       break;
  788.       }
  789.     } while ((!done1) && (!hangup));
  790.   } while ((!done) && (!hangup));
  791.   close_user();
  792.   if (!wfc)
  793.     topscreen();
  794. }
  795.  
  796. #pragma warn +par
  797.  
  798.  
  799.  
  800.