home *** CD-ROM | disk | FTP | other *** search
/ The Devil's Doorknob BBS Capture (1996-2003) / devilsdoorknobbbscapture1996-2003.iso / WWIV2.ZIP / UEDIT.C < prev    next >
Text File  |  1995-12-10  |  21KB  |  931 lines

  1. #include "vars.h"
  2.  
  3. #pragma hdrstop
  4.  
  5. static unsigned long *u_qsc;
  6.  
  7. void dellist(int un, userrec *u)
  8. {
  9.   int i,i1,i2,f,done,ok;
  10.   char s[150],s1[150],s2[150],ch,ch1,*ss;
  11.   char reason[50];
  12.   long l;
  13. /*  userrec u;*/
  14.  
  15.   done=0;
  16.   do {
  17.     nl();
  18.     prt(2,"R:ead, A:dd, Q:uit : ");
  19.     ch=onek("QRA");
  20.     switch(ch) {
  21.       case 'Q':
  22.         done=1;
  23.         break;
  24.       case 'R':
  25.     pl("╔══════════════════════════════════════════════════════════════════════════╗");
  26.     pl("║   Name                      Reason For Deletion                          ║");
  27.     pl("╚══════════════════════════════════════════════════════════════════════════╝");
  28.     printfile("DELETED.MSG");
  29.     break;
  30.       case 'A':
  31.     nl();
  32.     sprintf(s1,"%sDELETED.MSG",syscfg.gfilesdir);
  33.     f=open(s1,O_RDWR | O_CREAT | O_BINARY, S_IREAD | S_IWRITE);
  34.     if (f>0) {
  35.       lseek(f,0L,SEEK_SET);
  36.       l=filelength(f);
  37.       if ((ss=malloca(l+500L))==NULL) {
  38.         close(f);
  39.         return;
  40.        }
  41.        read(f,ss,(int)l);
  42.        farfree(ss);
  43.        close(f);
  44.     }
  45.     nl();
  46.     pl("Enter reason for deletion :");
  47.     outstr(":");
  48.     mpl(47);
  49.     inputl(reason,47);
  50.     nl();
  51.     sprintf(s,"* %-20s    %-47s *\r\n",nam(u,un), reason);
  52.     nl();
  53.     nl();
  54.     pl(s);
  55.     nl();
  56.     prt(5,"Is this correct? ");
  57.     if (yn()) {
  58.       sprintf(s1,"%sDELETED.MSG",syscfg.gfilesdir);
  59.       f=open(s1,O_RDWR | O_CREAT | O_BINARY, S_IREAD | S_IWRITE);
  60.       if (filelength(f)) {
  61.         lseek(f,-1L,SEEK_END);
  62.         read(f,((void *)&ch1),1);
  63.         if (ch1==26)
  64.           lseek(f,-1L,SEEK_END);
  65.       }
  66.       write(f,(void *)s,strlen(s));
  67.       close(f);
  68.       nl();
  69.       pl("Added to deletion list.");
  70.     }
  71.       break;
  72.     }
  73.   } while ((!done) && (!hangup));
  74. }
  75.  
  76.  
  77. void deluser(int un)
  78. {
  79.   userrec u;
  80.   int i,i1,f,n;
  81.   mailrec m;
  82.   char fn[81];
  83.   votingrec v;
  84.   voting_response vr;
  85.  
  86.   read_user(un,&u);
  87.   if ((u.inact & inact_deleted)==0) {
  88.     rsm(un,&u);
  89.     dsr(u.name);
  90.     u.inact |= inact_deleted;
  91.     u.waiting=0;
  92.     write_user(un,&u);
  93.     sprintf(fn,"%sEMAIL.DAT",syscfg.datadir);
  94.     f=open(fn,O_RDWR | O_BINARY, S_IREAD | S_IWRITE);
  95.     if (f>0) {
  96.       i1=filelength(f)/sizeof(mailrec);
  97.       for (i=0; i<i1; i++) {
  98.         lseek(f,((long) i) * sizeof(mailrec), SEEK_SET);
  99.         read(f,(void *)(&m),sizeof(mailrec));
  100.         if (((m.tosys==0) && (m.touser==un)) ||
  101.             ((m.fromsys==0) && (m.fromuser==un))) {
  102.           delmail(f,i);
  103.         }
  104.       }
  105.     }
  106.     close(f);
  107.     sprintf(fn,"%sVOTING.DAT",syscfg.datadir);
  108.     f=open(fn,O_RDWR | O_BINARY, S_IREAD | S_IWRITE);
  109.     n=(int) (filelength(f) / sizeof(votingrec)) -1;
  110.     for (i=0; i<20; i++)
  111.       if (u.votes[i]) {
  112.         if (i<=n) {
  113.           lseek(f,((long) i) * sizeof(votingrec), SEEK_SET);
  114.           read(f,(void *)&v,sizeof(votingrec));
  115.           vr=v.responses[u.votes[i]-1];
  116.           vr.numresponses--;
  117.           v.responses[u.votes[i]-1]=vr;
  118.           lseek(f,((long) i) * sizeof(votingrec), SEEK_SET);
  119.           write(f,(void *)&v,sizeof(votingrec));
  120.         }
  121.         u.votes[i]=0;
  122.       }
  123.     write_user(un,&u);
  124.     close(f);
  125.   }
  126. }
  127.  
  128. void print_data(int un, userrec *u, int lng, int cls)
  129. {
  130.   char s[81],s1[81],s2[81],s3[81],s4[81];
  131.   int i;
  132.  
  133.  
  134.   if (cls)
  135.     outchr(12);
  136.  
  137.   if ((u->inact) & inact_deleted) {
  138.     pl(">>> DELETED <<<");
  139.     nl(); }
  140.   npr("[A] Name: %-30s ",nam(u,un));
  141.   npr("[B] RN  : %s\r\n",(u->realname));
  142.   npr("[C] Add : %-30s ",u->street);
  143.   npr("[D] City: %s,%s\r\n",u->city,u->state);
  144.   npr("[E] Zip : %-30s ",u->zipcode);
  145.   npr("[F] PH  : %s\r\n",(u->phone));
  146.   npr("[G] Age : %d %c (%02d/%02d/%02d)", u->age, u->sex,u->month, u->day, u->year);
  147.   npr("                [H] Comp: %s\r\n",&(ctypes[u->comp_type][0]));
  148.   if (u->forwardsys)
  149.     npr("[-] Forw: #%d @%-25d",u->forwardusr, u->forwardsys);
  150.   else
  151.     npr("[-] Forw: #%-30d",u->forwardusr);
  152.   if (thisuser.sl==255)
  153.   npr("[I] PW  : %s\r\n",u->pw);
  154.   else
  155.   npr("[I] PW  : ■■■■■■■■■\r\n");
  156.   npr("[J] Last: %s   %s",(u->laston),(u->firston));
  157.   npr("            [ ] Work #: %s\r\n",(u->dataphone));
  158.   if (u->emailnet)
  159.     npr("[K] Msgs: Posts=%d Mail=%d Feedback=%d Waiting=%d Net Mail=%d\r\n",u->msgpost, u->emailsent,u->feedbacksent, u->waiting, u->emailnet);
  160.   else
  161.     npr("[K] Msgs: Posts=%d Mail=%d Feedback=%d Waiting=%d\r\n",u->msgpost, u->emailsent,u->feedbacksent, u->waiting);
  162.   npr("[L] Log : Logons:%d  Today:%d  Illegal:%d\r\n",u->logons,(strcmp(u->laston,date()))?0:u->ontoday,u->illegal);
  163.   npr("[M] UpDn: Up=%d-%ldk   Down=%d-%ldk\r\n",u->uploaded,u->uk,u->downloaded, u->dk);
  164.   npr("[N] Baud: %-30u ", u->lastrate);
  165.   npr("[O] Ass : %d\r\n",u->ass_pts);
  166.   npr("[R] SL  : %-30d ",u->sl);
  167.   npr("[P] Gold: %d\r\n",(int) u->gold);
  168.   npr("[S] DSL : %-30d ",u->dsl);
  169.   npr("[-] Rank: %s\r\n",u->rank);
  170.   npr("[T] Sub : %-30d [U] Exemption :",*u_qsc);
  171.   pln(u->exempt);
  172.   if (lng) {
  173.   npr("[V] User's Tag: %s\r\n",(u->ptag));
  174.   npr("[5] Note1: %s\r\n",u->note);
  175.   npr("[6] Note2: %s\r\n",u->note2);
  176.   npr("[7] Note3: %s\r\n",u->note3);
  177.   npr("[8] Ass Msg: %s\r\n",u->assmsg);
  178.   strcpy(s3,restrict_string);
  179.   for (i=0; i<=15; i++) {
  180.     if (u->ar & (1 << i))
  181.       s[i]='A'+i;
  182.     else
  183.       s[i]=32;
  184.     if (u->dar & (1 << i))
  185.       s1[i]='A'+i;
  186.     else
  187.       s1[i]=32;
  188.     if (u->restrict & (1 << i))
  189.       s2[i]=s3[i];
  190.     else
  191.       s2[i]=32; }
  192.   s[16]=0;
  193.   s1[16]=0;
  194.   s2[16]=0;
  195.   npr("[W] AR  : %-30s",s);
  196.   npr(" [X] DAR : %s\r\n",s1);
  197.   npr("[Y] Rest: %-30s ",s2);
  198.   npr("[Z] Voiced: %s\r\n",u->voiced);
  199.   npr("[-] SP: %-13s",u->sex_type);
  200.   npr("[-] IQ: %-12s",u->iq);
  201.   npr("[9] LM: %s\r\n",u->logyeah);
  202.   }
  203. }
  204.  
  205. /****************************************************************************/
  206.  
  207.  
  208.  
  209. int matchuser(int un)
  210. {
  211.   userrec u;
  212.  
  213.   read_user(un,&u);
  214.   sp=search_pattern;
  215.   return(match_user(&u));
  216. }
  217.  
  218.  
  219. int match_user(userrec *u)
  220. {
  221.   int ok=1,not=0,done=0,less=0,cpf=0,cpp=0,and=1,gotfcn=0,evalit=0,tmp,tmp1,tmp2;
  222.   char fcn[12],parm[12],ts[40];
  223.   long l;
  224.  
  225.   do {
  226.     if (*sp==0)
  227.       done=1;
  228.     else {
  229.       if (strchr("()|&!<>",*sp)) {
  230.         switch(*sp++) {
  231.           case '(':
  232.             evalit=2;
  233.             break;
  234.           case ')':
  235.             done=1;
  236.             break;
  237.           case '|':
  238.             and=0;
  239.             break;
  240.           case '&':
  241.             and=1;
  242.             break;
  243.           case '!':
  244.             not=1;
  245.             break;
  246.           case '<':
  247.             less=1;
  248.             break;
  249.           case '>':
  250.             less=0;
  251.             break;
  252.         }
  253.       } else if (*sp=='[') {
  254.         gotfcn=1;
  255.         sp++;
  256.       } else if (*sp==']') {
  257.         evalit=1;
  258.         ++sp;
  259.       } else if (*sp!=' ') {
  260.         if (gotfcn) {
  261.           if (cpp<10)
  262.             parm[cpp++]=*sp++;
  263.         } else {
  264.           if (cpf<10)
  265.             fcn[cpf++]=*sp++;
  266.         }
  267.       } else
  268.         ++sp;
  269.       if (evalit) {
  270.         if (evalit==1) {
  271.           fcn[cpf]=0;
  272.           parm[cpp]=0;
  273.           tmp=1;
  274.           tmp1=atoi(parm);
  275.  
  276.           if (!strcmp(fcn,"SL")) {
  277.             if (less)
  278.               tmp=(tmp1>u->sl);
  279.             else
  280.               tmp=(tmp1<u->sl);
  281.           } else if (!strcmp(fcn,"DSL")) {
  282.             if (less)
  283.               tmp=(tmp1>u->dsl);
  284.             else
  285.               tmp=(tmp1<u->dsl);
  286.           } else if (!strcmp(fcn,"AR")) {
  287.             if ((parm[0]>='A') && (parm[0]<='P')) {
  288.               tmp1=1 << (parm[0]-'A');
  289.               if (u->ar & tmp1)
  290.                 tmp=1;
  291.               else
  292.                 tmp=0;
  293.             } else
  294.               tmp=0;
  295.           } else if (!strcmp(fcn,"DAR")) {
  296.             if ((parm[0]>='A') && (parm[0]<='P')) {
  297.               tmp1=1 << (parm[0]-'A');
  298.               if (u->dar & tmp1)
  299.                 tmp=1;
  300.               else
  301.                 tmp=0;
  302.             } else
  303.               tmp=0;
  304.           } else if (!strcmp(fcn,"SEX")) {
  305.             tmp=parm[0]==u->sex;
  306.           } else if (!strcmp(fcn,"AGE")) {
  307.             if (less)
  308.               tmp=(tmp1>u->age);
  309.             else
  310.               tmp=(tmp1<u->age);
  311.           } else if (!strcmp(fcn,"LASTON")) {
  312.         time(&l);
  313.         tmp2=(unsigned int)( (l-u->daten)/24.0/3600.0 );
  314.         if (less)
  315.           tmp=tmp2<tmp1;
  316.         else
  317.           tmp=tmp2>tmp1;
  318.           } else if (!strcmp(fcn,"AREACODE")) {
  319.             tmp=(!strncmp(parm,u->phone,3));
  320.           } else if (!strcmp(fcn,"RESTRICT")) {
  321.             ;
  322.           } else if (!strcmp(fcn,"LOGONS")) {
  323.             if (less)
  324.               tmp=u->logons<tmp1;
  325.             else
  326.               tmp=u->logons>tmp1;
  327.           } else if (!strcmp(fcn,"REALNAME")) {
  328.             strcpy(ts,u->realname);
  329.             strupr(ts);
  330.             tmp=(strstr(ts,parm)!=NULL);
  331.           } else if (!strcmp(fcn,"BAUD")) {
  332.             if (less)
  333.               tmp=u->lastrate<(unsigned short)tmp1;
  334.             else
  335.               tmp=u->lastrate>(unsigned short)tmp1;
  336.           }
  337.  
  338.         } else
  339.           tmp=match_user(u);
  340.  
  341.         if (not)
  342.           tmp=!tmp;
  343.         if (and)
  344.           ok = ok && tmp;
  345.         else
  346.           ok = ok || tmp;
  347.  
  348.         not=less=cpf=cpp=gotfcn=evalit=0;
  349.         and=1;
  350.       }
  351.     }
  352.   } while (!done);
  353.   return(ok);
  354. }
  355.  
  356. /****************************************************************************/
  357.  
  358. void changeopt(void)
  359. {
  360.   helpl=42;
  361.   outchr(12);
  362.   pl(get_string(262));
  363.   if (search_pattern[0])
  364.     pl(search_pattern);
  365.   else
  366.     pl(get_string(263));
  367.   nl();
  368.   nl();
  369.   prt(5,get_string(264));
  370.   if (yn()) {
  371.     pl(get_string(265));
  372.     prt(2,":");
  373.     input(search_pattern,75);
  374.   }
  375.   helpl=0;
  376. }
  377.  
  378.  
  379. /****************************************************************************/
  380.  
  381. void uedit(int usern, int other)
  382. {
  383.   char s[81],s1[81],s2[81],ch,ch1;
  384.   int i,i1,i2,i3,un,done,nu,done1,full,temp_full,tempu,cls=1,done2;
  385.   userrec u;
  386.   long l;
  387.  
  388.   u_qsc=(unsigned long *)farmalloc(syscfg.qscn_len);
  389.  
  390.   if (incom)
  391.     full=0;
  392.   else
  393.     full=1;
  394.   if (other&1)
  395.     full=0;
  396.   if (other&2)
  397.     cls=0;
  398.   un=usern;
  399.   done=0;
  400.   read_user(un,&u);
  401.   nu=number_userrecs();
  402.   do {
  403.     read_user(un,&u);
  404.     read_qscn(un,u_qsc,0);
  405.     done1=0;
  406.     temp_full=0;
  407.     do {
  408.       print_data(un,&u, ((full) || (temp_full)), cls);
  409.       nl();
  410.       prt(2,get_string(266));
  411.       if ((thisuser.sl==255) || (wfc))
  412.     ch=onek("[]{}/,.:123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ%?");
  413.       else
  414.     ch=onek("[]{}/,.:123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ%?");
  415.       switch(ch) {
  416.     case ']':
  417.           ++un;
  418.           if (un>nu)
  419.             un=1;
  420.           done1=1;
  421.           break;
  422.         case '[':
  423.           --un;
  424.           if (un==0)
  425.             un=nu;
  426.           done1=1;
  427.           break;
  428.     case '}':
  429.           tempu=un;
  430.           ++un;
  431.           if (un>nu)
  432.             un=1;
  433.           while ((un!=tempu) && (!matchuser(un))) {
  434.             ++un;
  435.             if (un>nu)
  436.               un=1;
  437.           }
  438.           done1=1;
  439.           break;
  440.         case '{':
  441.           tempu=un;
  442.           --un;
  443.           if (un<1)
  444.             un=nu;
  445.           while ((un!=tempu) && (!matchuser(un))) {
  446.             --un;
  447.             if (un<1)
  448.               un=nu;
  449.           }
  450.           done1=1;
  451.           break;
  452.         case '/':
  453.           changeopt();
  454.           break;
  455.     case ',':
  456.           temp_full=(!temp_full);
  457.       break;
  458.     case '.':
  459.       full=(!full);
  460.       temp_full=full;
  461.       break;
  462.     case ':':
  463.           do {
  464.             done2=0;
  465.             nl();
  466.             pl(get_string(288));
  467.             pl(get_string(289));
  468.             pl(get_string(290));
  469.             pl(get_string(291));
  470.             pl(get_string(292));
  471.             pl(get_string(293));
  472.             pl(get_string(294));
  473.             pl(get_string(295));
  474.             pl(get_string(296));
  475.             pl(get_string(12));
  476.             outstr(get_string(297));
  477.             ch1=onek("Q12345678");
  478.             switch(ch1) {
  479.               case '1': u.realname[0]=0; break;
  480.               case '2': u.year=0; break;
  481.               case '3': u.street[0]=0; break;
  482.               case '4': u.city[0]=0; break;
  483.               case '5': u.state[0]=0; break;
  484.               case '6': u.country[0]=0; break;
  485.               case '7': u.zipcode[0]=0; break;
  486.               case '8': u.dataphone[0]=0; break;
  487.               case 'Q': done2=1; break;
  488.             }
  489.           } while (!done2);
  490.           write_user(un,&u);
  491.       break;
  492.     case '1':
  493.       if (((u.inact & inact_deleted)==0) && (actsl>u.sl)) {
  494.         prt(5,get_string(267));
  495.         if (yn()) {
  496.           deluser(un);
  497.           read_user(un,&u);
  498.         }
  499.       }
  500.       break;
  501.     case '2':
  502.       if (u.inact & inact_deleted) {
  503.         u.inact ^= inact_deleted;
  504.         isr(un,u.name);
  505.         write_user(un,&u);
  506.       }
  507.       break;
  508.     case '3':
  509.       nl();
  510.       prt(2,get_string(268));
  511.       input(s,sizeof(u.name)-1);
  512.       i=finduser1(s);
  513.       if (i>0) {
  514.         un=i;
  515.         done1=1;
  516.       }
  517.       break;
  518.     case 'A':
  519.       nl();
  520.       prt(2,get_string(69));
  521.       input(s,sizeof(u.name)-1);
  522.       if (s[0]) {
  523.         if (finduser(s)<1) {
  524.           dsr(u.name);
  525.           strcpy(u.name,s);
  526.           isr(un,u.name);
  527.           write_user(un,&u);
  528.         }
  529.       }
  530.       break;
  531.     case 'B':
  532.       nl();
  533.       prt(2,get_string(269));
  534.       inputl(s,sizeof(u.realname)-1);
  535.       if (s[0]) {
  536.         strcpy(u.realname,s);
  537.         write_user(un,&u);
  538.       }
  539.       break;
  540.     case 'C':
  541.       nl();
  542.       prt(2,get_string(282));
  543.       inputl(s1,sizeof(u.street)-1);
  544.       if (s1[0]) {
  545.         strcpy(u.street,s1);
  546.         write_user(un,&u);
  547.       }
  548.       break;
  549.     case 'D':
  550.       nl();
  551.       prt(2,get_string(283));
  552.       inputl(s1,sizeof(u.city)-1);
  553.       if (s1[0]) {
  554.         strcpy(u.city,s1);
  555.         write_user(un,&u);
  556.       }
  557.       break;
  558.     case 'E':
  559.       nl();
  560.       prt(2,get_string(286));
  561.       input(s1,sizeof(u.zipcode)-1);
  562.       if (s1[0]) {
  563.         strcpy(u.zipcode,s1);
  564.         write_user(un,&u);
  565.       }
  566.       break;
  567.     case 'F':
  568.       nl();
  569.       prt(2,get_string(272));
  570.       input(s,sizeof(u.phone)-1);
  571.       if (s[0]) {
  572.         strcpy(u.phone,s);
  573.         write_user(un,&u);
  574.       }
  575.       break;
  576.         case 'G':
  577.           nl();
  578.           outstr(get_string(274));
  579.           npr("%02d/%02d/%02d\r\n",(int) u.month, (int) u.day, (int) u.year);
  580.           input_age(&u);
  581.       write_user(un,&u);
  582.       prt(5,"Change Sex?");
  583.       if(yn()){
  584.        nl();
  585.        prt(3,"M or F (>");
  586.        u.sex=onek("MF");
  587.        write_user(un,&u);
  588.       }
  589.       break;
  590.     case 'H':
  591.       nl();
  592.       pl(get_string(275));
  593.       nl();
  594.       for (i=0; ctypes[i]; i++)
  595.         npr("%d. %s\r\n",i+1,ctypes[i]);
  596.       nl();
  597.       prt(2,get_string(276));
  598.       input(s,2);
  599.       i1=atoi(s);
  600.       if ((i1>0) && (i1<=i)) {
  601.         u.comp_type=i1-1;
  602.         if (checkcomp("Ami"))
  603.           u.colors[0]=4;
  604.         else
  605.           u.colors[0]=7;
  606.         write_user(un,&u);
  607.       }
  608.       break;
  609.     case 'I':
  610.       nl();
  611.       prt(5,"Change password? ");
  612.       if (yn()) {
  613.         nl();
  614.         prt(1,"Enter new password :");
  615.         input(s,8);
  616.         strcpy(u.pw,s);
  617.         write_user(un,&u);
  618.         }
  619.       break;
  620.     case 'J':
  621.       nl();
  622.       prt(5,"Reset laston date? ");
  623.       if (yn()) {
  624.        nl();
  625.        strcpy(xdate,date());
  626.        strcpy(u.laston,xdate);
  627.        i=1;
  628.        u.ontoday=i;
  629.        time(&l);
  630.        u.daten=l;
  631.        pl("3Date reset.");
  632.        write_user(un,&u);
  633.        }
  634.       break;
  635.     case 'K':
  636.       nl();
  637.       prt(1,"Enter Messages Posted :");
  638.       input(s,4);
  639.       i=atoi(s);
  640.         u.msgpost=i;
  641.         write_user(un,&u);
  642.       break;
  643.     case 'L':
  644.       nl();
  645.       prt(1,"Enter new total logons :");
  646.       input(s,4);
  647.       i=atoi(s);
  648.         u.logons=i;
  649.         write_user(un,&u);
  650.       break;
  651.     case 'M':
  652.       nl();
  653.       prt(1,"Change Uploads? ");
  654.         if (yn()) {
  655.           prt(1,"Change Number of Files? ");
  656.         if (yn()) {
  657.           prt(1, "Enter new number of files : ");
  658.           input(s,4);
  659.           i=atoi(s);
  660.           u.uploaded=i;
  661.           write_user(un,&u);
  662.         }
  663.           npr("Change Amount of k? ");
  664.         if(yn()) {
  665.           prt(1, "Enter new k : ");
  666.           input(s,6);
  667.           i=atoi(s);
  668.           u.uk=i;
  669.           write_user(un,&u);
  670.         }
  671.         }
  672.       npr("Change Downloads? ");
  673.         if(yn()) {
  674.           npr("Change Number of Files? ");
  675.         if(yn()) {
  676.           prt(1, "Enter new number of files : ");
  677.           input(s,4);
  678.           i=atoi(s);
  679.           u.downloaded=i;
  680.           write_user(un,&u);
  681.         }
  682.           npr("Change Amount of k? ");
  683.         if(yn()) {
  684.           prt(1, "Enter new k : ");
  685.           input(s,6);
  686.           i=atoi(s);
  687.           u.dk=i;
  688.           write_user(un,&u);
  689.         }
  690.         }
  691.       break;
  692.     case 'N':
  693.       nl();
  694.       prt(1,"Enter New Baud Rate :");
  695.       input(s,4);
  696.       i=atoi(s);
  697.       u.lastrate=i;
  698.       write_user(un,&u);
  699.       break;
  700.     case 'O':
  701.       nl();
  702.       prt(1,"Enter new ass points :");
  703.       input(s,3);
  704.       i=atoi(s);
  705.         u.ass_pts=i;
  706.         write_user(un,&u);
  707.       break;
  708.     case 'P':
  709.       nl();
  710.       npr("1Amount of gold in account2?\r\n5[7Current1=2%d5]\r\n", (int) u.gold);
  711.       mpl(5);
  712.       input(s,5);
  713.       i=atoi(s);
  714.       if (s[0]) {
  715.         u.gold=i;
  716.         write_user(un,&u);
  717.       }
  718.       break;
  719.     case 'Q':
  720.       done=1;
  721.       done1=1;
  722.       break;
  723.     case 'R':
  724.       if (u.sl==255)
  725.         break;
  726.       if (u.sl>=actsl)
  727.         break;
  728.       nl();
  729.       prt(2,get_string(76));
  730.       input(s,3);
  731.       i=atoi(s);
  732.       if ((!wfc) && (i>=actsl))
  733.         i=-1;
  734.       if ((i>=0) && (i<255) && (s[0])) {
  735.         u.sl=i;
  736.         write_user(un,&u);
  737.         if (un==usernum)
  738.           actsl=i;
  739.       }
  740.       break;
  741.     case 'S':
  742.       if (u.dsl==255)
  743.         break;
  744.       if (u.dsl>=thisuser.dsl)
  745.         break;
  746.       nl();
  747.       prt(2,get_string(153));
  748.       input(s,3);
  749.       i=atoi(s);
  750.       if ((!wfc) && (i>=thisuser.dsl))
  751.         i=-1;
  752.       if ((i>=0) && (i<255) && (s[0])) {
  753.         u.dsl=i;
  754.         write_user(un,&u);
  755.       }
  756.       break;
  757.     case 'T':
  758.       if (u_qsc) {
  759.         nl();
  760.         prt(2,get_string(278));
  761.         input(s,3);
  762.         i=atoi(s);
  763.         if ((i>=0) && (i<=999) && (s[0])) {
  764.           *u_qsc=i;
  765.           write_qscn(un,u_qsc,0);
  766.         }
  767.       }
  768.       break;
  769.     case 'U':
  770.       nl();
  771.       prt(2,get_string(277));
  772.       input(s,3);
  773.       i=atoi(s);
  774.       if ((i>=0) && (i<=255) && (s[0])) {
  775.         u.exempt=i;
  776.         write_user(un,&u);
  777.       }
  778.       break;
  779.     case '5':
  780.       nl();
  781.       prt(2,get_string(273));
  782.       inputl(s,sizeof(u.note)-1);
  783.       strcpy(u.note,s);
  784.       write_user(un,&u);
  785.       break;
  786.     case 'V':
  787.       nl();
  788.       prt(2,get_string(273));
  789.       inputl(s,sizeof(u.ptag)-1);
  790.       strcpy(u.ptag,s);
  791.       write_user(un,&u);
  792.       break;
  793.     case '6':
  794.       nl();
  795.       prt(2,get_string(273));
  796.       inputl(s,sizeof(u.note2)-1);
  797.       strcpy(u.note2,s);
  798.       write_user(un,&u);
  799.       break;
  800.     case '7':
  801.       nl();
  802.       prt(2,get_string(273));
  803.       inputl(s,sizeof(u.note3)-1);
  804.       strcpy(u.note3,s);
  805.       write_user(un,&u);
  806.       break;
  807.     case '8':
  808.       nl();
  809.       prt(2,get_string(273));
  810.       inputl(s,sizeof(u.assmsg)-1);
  811.       strcpy(u.assmsg,s);
  812.       write_user(un,&u);
  813.       break;
  814.     case '9':
  815.       nl();
  816.       prt(1,"New log yeah:");
  817.       input(s,1);
  818.       strcpy(u.logyeah,s);
  819.       write_user(un,&u);
  820.       break;
  821.     case 'W':
  822.       nl();
  823.       prt(2,get_string(280));
  824.       ch1=onek("\rABCDEFGHIJKLMNOP");
  825.       if (ch1!=13) {
  826.         ch1-='A';
  827.         if ((wfc) || (thisuser.ar & (1 << ch1))) {
  828.           u.ar ^= (1 << ch1);
  829.           write_user(un,&u);
  830.         }
  831.       }
  832.       break;
  833.     case 'X':
  834.       nl();
  835.       prt(2,get_string(281));
  836.       ch1=onek("\rABCDEFGHIJKLMNOP");
  837.       if (ch1!=13) {
  838.         ch1-='A';
  839.         if ((wfc) || (thisuser.dar & (1 << ch1))) {
  840.           u.dar ^= (1 << ch1);
  841.           write_user(un,&u);
  842.         }
  843.       }
  844.       break;
  845.     case 'Y':
  846.       nl();
  847.       npr("        %s\r\n",restrict_string);
  848.       do {
  849.             prt(2,get_string(279));
  850.             s[0]=13;
  851.         s[1]='?';
  852.             strcpy(&(s[2]),restrict_string);
  853.             ch1=onek(s);
  854.             if (ch1==32)
  855.               ch1=13;
  856.         if (ch1=='?')
  857.           printmenu(10);
  858.             if ((ch1!=13) && (ch1!='?')) {
  859.               i=-1;
  860.               for (i1=0; i1<16; i1++)
  861.                 if (ch1==s[i1+2])
  862.                   i=i1;
  863.               if (i>-1) {
  864.                 u.restrict ^= (1 << i);
  865.                 write_user(un,&u);
  866.               }
  867.             }
  868.       } while ((!hangup) && (ch1=='?'));
  869.           break;
  870.     case 'Z':
  871.       nl();
  872.       prt(2,"Has the user been voiced? ");
  873.       input(s,6);
  874.       if (s[0]) {
  875.         strcpy(u.voiced,s);
  876.         write_user(un,&u);
  877.       }
  878.       break;
  879.     case '?':
  880.       printmenu(6);
  881.       getkey();
  882.       break;
  883.     case '4':
  884.       nl();
  885.       prt(2,get_string(270));
  886.       input(s,sizeof(u.callsign)-1);
  887.       if (s[0]) {
  888.         strcpy(u.callsign,s);
  889.         write_user(un,&u);
  890.       } else {
  891.         prt(5,get_string(271));
  892.         if (yn()) {
  893.           u.callsign[0]=0;
  894.           write_user(un,&u);
  895.         }
  896.       }
  897.       break;
  898.     case '%':
  899.       prt(2,get_string(284));
  900.           input(s1,sizeof(u.state)-1);
  901.           if (s1[0]) {
  902.             strcpy(u.state,s1);
  903.             write_user(un,&u);
  904.           }
  905.           prt(2,get_string(285));
  906.           input(s1,sizeof(u.country)-1);
  907.           if (s1[0]) {
  908.             strcpy(u.country,s1);
  909.             write_user(un,&u);
  910.       }
  911.       prt(2,get_string(287));
  912.           input(s1,sizeof(u.dataphone)-1);
  913.           if (s1[0]){
  914.             strcpy(u.dataphone,s1);
  915.             write_user(un,&u);
  916.           }
  917.           break;                   
  918.       }
  919.     } while ((!done1) && (!hangup));
  920.   } while ((!done) && (!hangup));
  921.   close_user();
  922.   if (u_qsc)
  923.     farfree(u_qsc);
  924.   u_qsc=NULL;
  925.   if (!wfc)
  926.     topscreen();
  927. }
  928.  
  929.  
  930.  
  931.