home *** CD-ROM | disk | FTP | other *** search
/ ftp.wwiv.com / ftp.wwiv.com.zip / ftp.wwiv.com / pub / BBS / CEL141.ZIP / CEL141C.ZIP / RESET141.ZIP / RESET.PAS < prev    next >
Pascal/Delphi Source File  |  1992-07-23  |  4KB  |  161 lines

  1. program GlobalEdit;
  2.  
  3.  
  4. uses dos,crt,gentypes,gensubs;
  5.  
  6. type
  7.      configtype102=(lowercase,eightycols,linefeeds,postprompts,moreprompts,
  8.                  asciigraphics,ansigraphics,udsysop,bulletinsysop,votingsysop,
  9.                  emailsysop,doorssysop,mainsysop,databasesysop,jsysop,
  10.                  gfsysop,wanted,showtime,vt52,fseditor);
  11.      filelist111=(fffname,fffsize,fffpoints,fffuploaded,fffuploader,fffdown,
  12.         fffdescript);       {Configurable file listings}
  13.  
  14.      filelist120=(ffname,ffext,ffsize,ffpoints,ffuploaded,ffuploader,ffdown,
  15.         ffdescript,fffulnam,ffofwhat);       {Configurable file listings}
  16.  
  17.  
  18. var    urec:userrec;
  19.         ufile:file of userrec;
  20.         cnt,n,numusers:integer;
  21.         choice,temp:char;
  22.     TempS:string;
  23.     TempL:longint;
  24.  
  25.  
  26.  
  27. function ratio:word;
  28. var ud,temp:longint;
  29. begin
  30.   temp:=urec.upbytes_all;
  31.   if temp<1 then
  32.      ud:=0
  33.   else
  34.      ud:=(temp) div (urec.dnbytes_all div 100);
  35.   if ud>60000 then ud:=60000;
  36.   if ud<0 then ud:=60000;
  37.   ud:=ud+(urec.upbytes_all div 1000000);
  38.   ratio:=ud;
  39.   end;
  40.  
  41.   procedure SetLevels(NewLvl:byte);
  42.   begin
  43.     urec.level:=newlvl;
  44.     urec.udlevel:=newlvl;
  45.     end;
  46.  
  47. procedure evaluate;
  48. var  oldacc:byte;
  49. begin
  50.   oldacc:=(urec.level + urec.udlevel) div 2;
  51.   if (urec.dnbytes_all>1000000) then begin
  52.      case ratio of
  53.        0:SetLevels(20);
  54.        1..5:SetLevels(30);
  55.        6..20:SetLevels(40);
  56.        21..40:SetLevels(50);
  57.        41..80:SetLevels(60);
  58.        81..100:SetLevels(70);
  59.        101..200:SetLevels(80);
  60.        201..60000:SetLevels(90);
  61.        else setlevels(90);
  62.        end;
  63.      if urec.upbytes_all<100000 then
  64.        SetLevels(10);
  65.      writeln(' Ratio: ',ratio,'%, for level ',urec.level,' access - from ',oldacc);
  66.      end
  67.   else
  68.      writeln(' is ineligible for evaluation');
  69.   end;
  70.  
  71.  
  72. procedure convert;
  73.  var m,o:integer;
  74.  begin
  75.     case choice of
  76.         'C':with urec do begin
  77.              regularcolor:=0;
  78.              promptcolor:=0;
  79.              statcolor:=0;
  80.              inputcolor:=0;
  81.              fifthcolor:=0;
  82.              sixthcolor:=0;
  83.              seventhcolor:=0;
  84.              eighthcolor:=0;
  85.  
  86.           end;
  87.     'E':urec.expiration:=Templ;
  88.         'U':urec.userudr:=0;
  89.         'T':with urec do begin
  90.                 Uploads_Month:=0;
  91.                 Uploads_All:=0;
  92.                 Dnloads_Month:=0;
  93.                 Dnloads_all:=0;
  94.                 UpBytes_Month:=0;
  95.                 UpBytes_All:=0;
  96.                 DnBytes_Month:=0;
  97.                 DnBytes_All:=0;
  98.                 end;
  99.     'A':Evaluate;
  100.         end;
  101.  end;
  102.  
  103.  
  104.   begin
  105.     clrscr;
  106.     writeln;
  107.     writeln('This utility will do various global editing tasks for Celerity/Alacrity.');
  108.     writeln;
  109.      writeln('Warning: Make sure you only use this on version 1.39/1.40/1.41');
  110.    writeln('Use ACCESS EVALUATION only on CAE/TAC');
  111.      writeln;
  112.      writeln;
  113.     writeln;
  114.      writeln('You may reset:      [A]ccess Evaluation   [Q]uit');
  115.      writeln('  [U]/D Ratios      [T]ransfer Stats      [C]olors');
  116.    writeln('  [E]xpiration date');
  117.    writeln('  [1..5] Set Conference Access');
  118.     readln(Choice);
  119.      choice:=upcase(choice);
  120.      if choice='Q' then exit;
  121.  
  122.      case choice of
  123.         'C':writeln('Setting everyone''s colors to the default.');
  124.         'U':writeln('Setting everyone''s upload/download ratio to 0 (config default)');
  125.         'T':writeln('Clearing everyone''s transfer statistics.');
  126.     'A':writeln('Evaluating access');
  127.     '1'..'5':writeln('Setting conference');
  128.     'E':begin
  129.       writeln('Use the format:  07/15/92');
  130.       write('Set expiration date to:');
  131.       readln(temps);
  132.       TempL:=dateval(temps)+timeval('12:00 AM');
  133.       writeln('Setting to : ',datestr(templ));
  134.       end;
  135.         end;
  136.  
  137.  
  138.      assign (ufile,'USERS');
  139.      reset (ufile);
  140.      numusers:=filesize(ufile);
  141.      writeln;
  142.      seek(ufile,1);
  143.    window(1,12,80,22);
  144.      for cnt:=1 to (numusers-1) do begin
  145.         seek(ufile,cnt);
  146.         read(ufile,urec);
  147.         gotoxy(1,10);
  148.         write('User #',cnt+1);
  149.         write('    ',urec.handle);
  150.  
  151.         clreol;
  152.         convert;
  153.     writeln;
  154.         seek(ufile,cnt);
  155.         write (ufile,urec);
  156.      end;
  157.      writeln;
  158.      writeln('Done Converting');
  159.      close(ufile);
  160.   end.
  161.