/
sysop11.pas
199 lines (177 loc) · 5.88 KB
/
sysop11.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
(*****************************************************************************)
(*> <*)
(*> SYSOP10 .PAS - Written by Eric Oman <*)
(*> <*)
(*> SysOp functions: Voting question editor, voting results output. <*)
(*> <*)
(*****************************************************************************)
{$A+,B+,D-,E+,F+,I+,L+,N-,O+,R-,S+,V-}
unit sysop11;
interface
uses
crt, dos,
{rcg11172000 no overlay under Linux.}
{overlay,}
misc1, miscx,
menus2,
common;
procedure chuser;
procedure zlog;
procedure showlogs;
procedure showmenucmds;
implementation
procedure chuser;
var macrf:file of macrorec;
s:astr;
i:integer;
begin
prt('Which user? ');
finduser(s,i);
if (i>=1) then begin
thisuser.sl:=realsl; thisuser.dsl:=realdsl;
reset(uf);
seek(uf,usernum); write(uf,thisuser);
seek(uf,i); read(uf,thisuser);
close(uf);
realsl:=thisuser.sl; realdsl:=thisuser.dsl;
usernum:=i;
choptime:=0.0; extratime:=0.0; freetime:=0.0;
readinmacros; readinzscan;
if (spd<>'KB') then sysoplog(#3#8+'#*#*#*# '+#3#7+'Changed to '+#3#5+nam);
topscr;
newcomptables;
end;
end;
procedure zlog;
var zf:file of zlogrec;
d1:zlogrec;
s,dd:astr;
i:integer;
abort,next:boolean;
function mrnn(i,l:integer):astr;
begin
mrnn:=mrn(cstr(i),l);
end;
begin
nl;
assign(zf,systat.gfilepath+'zlog.dat');
{$I-} reset(zf); {$I+}
if (ioresult<>0) then print('ZLOG.DAT not found.')
else begin
abort:=FALSE;
read(zf,d1);
printacr(#3#3+' '+sepr2+'Mins '+sepr2+' '+sepr2+' '+
sepr2+'#New'+sepr2+'Tim/'+sepr2+'Pub '+sepr2+'Priv'+
sepr2+'Feed'+sepr2+' '+sepr2+' '+sepr2+' '+
sepr2+' '+sepr2+'',abort,next);
printacr(#3#3+' Date '+sepr2+'Activ'+sepr2+'Call'+sepr2+'%Activ'+
sepr2+'User'+sepr2+'User'+sepr2+'Post'+sepr2+'Post'+
sepr2+'Back'+sepr2+'Errs'+sepr2+'#ULs'+sepr2+'UL-k '+
sepr2+'#DLs'+sepr2+'DL-k',abort,next);
printacr(#3#4+'========:=====:====:======:====:====:====:====:====:====:====:=====:====:=====',abort,next);
i:=-1;
seek(zf,0);
while ((i<=filesize(zf)-1) and (not abort) and (d1.date<>'')) do begin
if (i>=0) then begin
read(zf,d1);
dd:=d1.date;
end else begin
d1:=systat.todayzlog;
dd:=#3#5+'Today''s ';
end;
if (d1.calls>0) then s:=mrnn(d1.active div d1.calls,4) else s:=' ';
printacr(dd+' '+mrnn(d1.active,5)+' '+mrnn(d1.calls,4)+' '+
ctp(d1.active,1440)+' '+mrnn(d1.newusers,4)+' '+
s+' '+mrnn(d1.pubpost,4)+' '+mrnn(d1.privpost,4)+' '+
mrnn(d1.fback,4)+' '+mrnn(d1.criterr,4)+' '+
mrnn(d1.uploads,4)+' '+mrnn(d1.uk,5)+' '+
mrnn(d1.downloads,4)+' '+mrnn(d1.dk,5),abort,next);
inc(i);
end;
close(zf);
end;
end;
procedure showlogs;
var s:astr;
day:integer;
begin
nl;
print('SysOp Logs available for up to '+cstr(systat.backsysoplogs)+' days ago.');
prt('Date (MM/DD/YY) or # days ago (0-'+cstr(systat.backsysoplogs)+') [0] : ');
input(s,8);
if (length(s)=8) and (daynum(s)>0) then day:=daynum(date)-daynum(s)
else day:=value(s);
if (day=0) then close(sysopf);
if (day=0) then printf(systat.trappath+'sysop.log')
else printf(systat.trappath+'sysop'+cstr(day)+'.log');
if (nofile) then begin nl; print('SysOp Log not found.'); end;
if (day=0) then append(sysopf);
if (useron) then begin
s:='*> Viewed SysOp Log - ';
if (day=0) then s:=s+'Today''s' else s:=s+cstr(day)+' days ago';
sysoplog(s);
end;
end;
procedure showmenucmds;
var i:integer;
abort,next:boolean;
function sfl(b:boolean; c:char):char;
begin
if (b) then sfl:=c else sfl:='-';
end;
begin
nl;
sprint('Current menu :'+#3#3+curmenu);
sprint('# of commands :'+#3#3+cstr(noc));
sprompt('Prev. menus :'+#3#3);
if (menustackptr=0) then prompt('None.')
else
for i:=1 to menustackptr do begin
prompt(menustack[i]);
if (i<menustackptr) then prompt(',');
end;
nl; nl;
with menur do begin
i:=1;
abort:=FALSE; next:=FALSE;
while ((i<=10) and (not abort) and (not hangup)) do begin
case i of
1:begin
sprint('1. Menu titles :'+menuname[1]);
if (menuname[2]<>'') then
sprint(' Menu title #2 :'+menuname[2]);
if (menuname[3]<>'') then
sprint(' Menu title #3 :'+menuname[3]);
end;
2:print('2. Help files :'+
aonoff((directive=''),'*Generic*',directive)+' / '+
aonoff((tutorial=''),'*Generic*',tutorial));
3:print('3. Prompt :'+menuprompt);
4:sprint(#3#3+'('+#3#1+menuprompt+#3#3+')');
5:print('4. ACS required :"'+acs+'"');
6:print('5. Password :'+
aonoff((password=''),'*None*',password));
7:print('6. Fallback menu :'+
aonoff((fallback=''),'*None*',fallback));
8:print('7. Forced ?-level:'+
aonoff((forcehelplevel=0),'None',cstr(forcehelplevel)));
9:print('8. Generic info :'+cstr(gencols)+' cols - '+
cstr(gcol[1])+'/'+cstr(gcol[2])+'/'+cstr(gcol[3]));
10:print('9. Flags :'+
sfl((clrscrbefore in menuflags),'C')+
sfl((dontcenter in menuflags),'D')+
sfl((nomenuprompt in menuflags),'N')+
sfl((forcepause in menuflags),'P')+
sfl((autotime in menuflags),'T'));
end;
if (not empty) then wkey(abort,next);
inc(i);
end;
end;
if (not abort) then begin
nl;
showcmds(0);
end;
lastcommandgood:=TRUE;
end;
end.