/
newusers.pas
272 lines (243 loc) · 7.51 KB
/
newusers.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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
(*****************************************************************************)
(*> <*)
(*> NEWUSERS.PAS - Written by Eric Oman <*)
(*> <*)
(*> Logon functions -- New users. <*)
(*> <*)
(*> <*)
(*****************************************************************************)
{$A+,B+,D-,E+,F+,I+,L+,N-,O+,R-,S+,V-}
unit newusers;
interface
uses
crt, dos,
{rcg11172000 no overlay under Linux.}
{overlay,}
mail0, mail1, mail2, mail3,
misc2, misc3, misc4, miscx,
cuser,
doors,
archive1,
menus,
common;
procedure newuser;
procedure newuserinit(nam:astr);
implementation
var
newusername:astr;
procedure p1;
var c:char;
tries,i,ii,t:integer;
s,s1,s2:astr;
atype,pw:astr;
done,abort,next,choseansi,chosecolor:boolean;
procedure showstuff;
begin
nl; nl; printf('system');
nl; nl; printf('newuser');
if (systat.newuserpw<>'') then begin
tries:=0; pw:='';
while ((pw<>systat.newuserpw) and
(tries<systat.maxlogontries) and (not hangup)) do begin
prt('Newuser password : '); echo:=FALSE; input(pw,20); echo:=TRUE;
if ((systat.newuserpw<>pw) and (pw<>'')) then begin
sl1(#3#8+'>>'+#3#1+' Illegal newuser password: "'+pw+'"');
inc(tries);
end;
end;
if (tries>=systat.maxlogontries) then begin
printf('nonewusr');
hangup:=TRUE;
end;
end;
end;
procedure doitall;
type neworderrec=array[1..17] of integer;
const neworder:neworderrec=(7,10,23,1,4,14,8,12,2,5,6,13,3,11,24,9,-1);
var i:integer;
c:char;
begin
showstuff;
if (newusername<>'') then begin
thisuser.name:=newusername;
newusername:='';
i:=2;
end else
i:=1;
repeat
cstuff(neworder[i],1,thisuser);
inc(i);
until ((neworder[i]=-1) or (hangup));
end;
procedure dc(var abort:boolean; c:char; n,v:astr);
begin
printacr(#3#1+'['+#3#3+c+#3#1+'] '+
#3#4+mln(n,11)+#3#2+' - '+#3#5+v,abort,next);
end;
begin
t:=0;
doitall;
if (not hangup) then
repeat
done:=FALSE;
cls;
abort:=FALSE; next:=FALSE;
printacr(#3#5+'User Information Change',abort,next);
nl;
if (ansi in thisuser.ac) then begin
atype:='Enabled';
if (color in thisuser.ac) then atype:=atype+' w/ color'
else atype:=atype+' w/o color';
end else
atype:='Disabled';
with thisuser do begin
dc(abort,'A','System name',name);
dc(abort,'B','Real name', realname);
dc(abort,'C','Phone #', ph);
dc(abort,'D','Computer', computer);
dc(abort,'E','Sex', sex);
dc(abort,'F','Birthdate', bday+' ('+cstr(ageuser(bday))+' years old)');
dc(abort,'G','City, State',citystate);
dc(abort,'H','Address', street);
dc(abort,'I','Zip code', zipcode);
dc(abort,'J','Occupation', occupation);
dc(abort,'K','Heard from', wherebbs);
dc(abort,'L','ANSI', atype);
dc(abort,'M','Screen size',cstr(linelen)+'x'+cstr(pagelen));
dc(abort,'N','Password', pw);
end;
nl;
prt('Selection (A-N) to change, Y when finished :');
onek(c,'YABCDEFGHIJKLMN');
if (c<>'Y') then cstuff(pos(c,'HFLGDJACNBMEKI'),1,thisuser) else done:=TRUE;
until ((done) or (hangup));
end;
procedure p2;
var user:userrec;
pw:string;
tries,i,j:integer;
c:char;
begin
if (not hangup) then begin
nl; prompt('Please wait while I save your record ... ');
reset(uf);
j:=0;
for i:=1 to filesize(uf)-1 do begin
seek(uf,i); read(uf,user);
if ((user.deleted) and (j=0)) then j:=i;
end;
if (j<>0) then usernum:=j else usernum:=filesize(uf);
with thisuser do begin
deleted:=FALSE; waiting:=0; firston:=date; laston:=date;
loggedon:=0; msgpost:=0; emailsent:=0; feedback:=0; ontoday:=0;
illegal:=0; forusr:=0;
downloads:=0; uploads:=0; dk:=0; uk:=0;
linelen:=80; pagelen:=25; ttimeon:=0; note:='';
for i:=1 to 5 do boardsysop[i]:=255;
lastmsg:=1; lastfil:=1; credit:=0; timebank:=0;
for i:=1 to 70 do res[i]:=0;
for i:=1 to 20 do vote[i]:=0;
readinzscan; { load old / create new zscan.dat record }
with zscanr do begin
for i:=1 to maxboards do
for j:=1 to 6 do mhiread[i][j]:=0;
mzscan:=[]; fzscan:=[];
for i:=1 to maxboards do mzscan:=mzscan+[i];
for i:=0 to maxuboards do fzscan:=fzscan+[i];
end;
savezscanr;
trapactivity:=FALSE; trapseperate:=FALSE;
timebankadd:=0;
mpointer:=-1;
chatauto:=FALSE; chatseperate:=FALSE;
slogseperate:=FALSE;
flistopt:=1;
avadjust:=0;
reset(uf); seek(uf,0); read(uf,user); close(uf);
cols:=user.cols;
sl:=systat.newsl; dsl:=systat.newdsl; realsl:=sl; realdsl:=dsl;
filepoints:=systat.newfp;
ar:=systat.newar;
tltoday:=systat.timeallow[sl];
end;
reset(uf);
seek(uf,usernum); write(uf,thisuser);
close(uf);
isr(thisuser.name,usernum);
sprint(#3#3+'Saved.');
repeat
nl; nl;
sprint('Your user name is "'+#3#3+allcaps(thisuser.name)+#3#1+
'", and your user number is '+#3#3+cstr(usernum)+#3#1+'.');
sprint('Your password is "'+#3#3+thisuser.pw+#3#1+'".');
nl;
print('Please remember these. You will need your password to log on');
print('again in the future, and your user number helps to log on faster.');
nl;
print('Re-enter your password now for verification.');
prompt('Password: '); echo:=FALSE; input(pw,20); echo:=TRUE;
if (pw<>thisuser.pw) then print(^G'WRONG!!'^G);
until ((pw=thisuser.pw) or (hangup));
nl; nl; nl;
useron:=TRUE;
window(1,1,80,25);
clrscr;
schangewindow(not cwindowon,systat.curwindow);
cls;
if ((exist(systat.afilepath+'newuser.inf')) or
(exist(systat.gfilepath+'newuser.inf'))) then
readq('newuser',0);
topscr;
if (systat.newapp<>-1) then begin
printf('newapp');
irt:='New User Application';
end;
nl;
end;
end;
procedure newuser;
var i:integer;
begin
sl1(#3#8+' ***'+#3#3+' NewUser'+#3#8+' ***');
if (systat.numusers>=9999) then begin
sl1(#3#7+' [*] Maximum user count has been reached.');
printf('maximum');
hangup:=TRUE;
end else begin
p1; p2;
if (systat.newapp<>-1) then begin
reset(uf); i:=forwardm(systat.newapp); close(uf);
if (i=0) then i:=systat.newapp;
email1(i,'\NewUser Application');
end;
inc(systat.todayzlog.newusers);
wasnewuser:=TRUE;
end;
useron:=TRUE;
end;
procedure newuserinit(nam:astr);
var s:astr;
begin
newusername:=nam;
clrscr;
window(1,1,80,25); gotoxy(1,1);
tc(14); textbackground(1); clreol;
if (spd<>'KB') then s:=' New user on at '+spd+' baud '
else s:=' New user on locally ';
gotoxy(40-length(s) div 2,1); textbackground(4); write(s);
tc(3); textbackground(0);
window(1,2,80,25); gotoxy(1,1);
if (systat.closedsystem) then begin
printf('system');
printf('nonewusr');
hangup:=TRUE;
end else begin
with thisuser do begin
name:='NEW USER';
trapactivity:=FALSE;
trapseperate:=FALSE;
end;
inittrapfile;
end;
end;
end.