Google
 

Trailing-Edge - PDP-10 Archives - decuslib10-11 - 43,50527/add.bli
There are no other files named add.bli in the archive.
Module Add(Stack,Version=1(1)-2,Reserve(1,2,3,4))=
Begin
	Require MACHOP.BLI;
	Require MACROS.BLI;
	Require EXTERN.BLI;
	External
		Checkmail,
		Display,
		Whois,
		Getdate,
		Sendmail,
		Readmail,
		Change,
		Help,
		Finuname;

Routine Newuser(uname1,uname2)=
Begin

	own	acctfil[4],
		tmp[2],
		tmpbuf[4],
		filopblk[6],
		mailfilblk[4],
		strptr,
		a,
		b,
		jbstr[4],
		opb[4];

tmp[0]_tmp[1]_0;
filopblk[0]_xwd(out,6);
filopblk[1]_12;
filopblk[2]_mlrdev;
filopblk[3]_xwd(obufhdr,0);
filopblk[4]_xwd(-1,0);
filopblk[5]_address(acctfil);

filblock(acctfil,'.acct.',mlrext,#777^27,mlrppn);
acct[accnm1] _ .uname1;
acct[accnm2] _ .uname2;

reset;
ac1 _ xwd(6,address(filopblk));
ifskip filop(address(ac1)) then 0
else
begin
	filopblk[0]_xwd(out,2);
	ac1 _ xwd(6,address(filopblk));
	ifskip filop(address(ac1)) then 0
	else
	begin
		print('?M?J??MAIAFE Accounting file error: ');
		error(.ac1);
		stop();
	end;
end;

If NOT Lockchn(out,1) then 
Begin
	Print('?M?JPlease try later?M?J');
	Stop();
End;

incr a from 0 to accmax-1 do
	acct[.a]_0;

	acct[accnm1] _ .uname1;
	acct[accnm2] _ .uname2;
	Print('Password: ');
	acct[accpas] _ sixin(0,6);
	acct[accppn] _ 0;
	While (.acct[accppn] EQL 0) do
	Begin
		Print('PPN: ');
		acct[accppn] _ inppn(0,false);
	End;
	Print('Primary group: ');
	acct[accgp1] _ sixin(0,6);
	Print('Full name: ');
	acct[accfnm] _ acct[accfnm+1] _ 0;
	Rdtty(byteptr(acct[accfnm]),30);
	a _ accfnm;
	until (.acct[.a] EQL 0) do a _ .a + 1;
	acct[.a+1] _ -1;
	a _ 0;
	bitset(a,pvcnam) _ 1;
	bitset(a,pvcpas) _ 1;
	bitset(a,pvcfnm) _ 1;
	acct[accprv] _ .a;
	acct[accus1] _ acct[accus2] _ 0;
	Print('Disk: ');
	acct[accmfd] _ sixin(0,6);
	acct[accmlf] _ .uname1^2;
	acct[accmfe] _ mflext;
	incr a from 0 to accfnm-1 do
		outfile(.acct[.a]);
	a _ accfnm;
	while .acct[.a] NEQ 0 do
	Begin
		outfile(.acct[.a]);
		a _ .a + 1;
	End;
	outfile(-1);
	close(out);
	releas(out);
End;
Global ROUTINE FINDUSER(UNAME1,UNAME2)=
BEGIN

OWN ARGBLK[4],wrd,A;

RESET;

INCR a FROM 0 TO accmx1 DO acct[.a]_0;

FILBLOCK(ARGBLK,'.ACCT.',mlrext,#777^27,mlrppn);

WHILE .UNAME1 EQL 0 DO (PRINT('?M?JUname: '); uname1_sixin(0,12); if .ac1 EQL 0 then uname2_.ac2 ELSE uname2 _ 0);

IFSKIP OPEN(IN,PLIT(12,mlrdev,ADDRESS(IBUFHDR),0)) THEN
	IFSKIP LOOKUP(IN,ADDRESS(ARGBLK)) THEN
		UNTIL Auser(.uname1,.uname2) OR .acct[0] EQL "EOF" DO
			BEGIN
			A _ 0;
			WRD _ 0;
			UNTIL .wrd EQL -1 OR .A EQL accmax DO
			BEGIN
				wrd _ INFILE("IN");
				acct[.a] _ .wrd;
				a _ .a + 1;
			END;
			END
		ELSE acct[0] _ "EOF"
ELSE
BEGIN
	PRINT('?M?J??MAIDNA Mailer disk is unavailable?M?J');
	STOP;
END;

CLOSE(IN);
RELEAS(IN);

If .ACCT[0] NEQ "EOF" THEN (Print('?M?J?G??Uname is used - Try again!?M?J');Return 0);
IF .ACCT[0] EQL "EOF" THEN newuser(.uname1,.uname2);

END;
Ifskip Getppn(ac1) then 0;
If (.ac1 NEQ #1000002) then
Begin
	Print('?M?J???GThis program MUST be run from [1,2]?M?J?G');
	Stop();
End;
Print('ADD - Add users to the MAILER system.   Version 1(1)-2?M?J');

Crlf;
While true do Finduser(0,0);
End;