10 extend 11 ! CONFIG.BAS - 1.00-01 20-Aug-85 tmk - Set up user accounts & ! 1.01-01 01-Oct-85 tmk - Change DM references to SY & ! 1.02-01 05-Oct-85 tmk - Verify legal characters in & ! password, name fields, center name, change & ! all references of 'User name' to 'Account & ! name', fix echo being left off in some cases & ! when re-prompting for password change & ! 1.03-01 19-Oct-85 tmk - Fix bombing of program if an & ! account name blockette is not defined for the & ! account we are setting up. 20 on error goto 32400 ! Set error trap 25 legalp$=string$(9%,0%)+chr$(9%)+string$(22%,0%) & \ legalp$=legalp$+chr$(i%) for i%=32% to 62% & \ legalp$=legalp$+chr$(0%) & \ legalp$=legalp$+chr$(i%) for i%=64% to 126% & \ legalp$=legalp$+string$(34%,0%) & \ legalp$=legalp$+chr$(i%) for i%=161% to 254% 26 legaln$=string$(9%,0%)+chr$(9%)+string$(22%,0%) & \ legaln$=legaln$+chr$(i%) for i%=32% to 126% & \ legaln$=legaln$+string$(34%,0%) & \ legaln$=legaln$+chr$(i%) for i%=161% to 254% 30 a$=sys(chr$(6%)+chr$(26%)+chr$(0%)+chr$(0%)) ! Return PPN 40 ppn$=mid(a$,21%,2%) ! Extract PPN 45 if mid(ppn$,2%,1%)<>chr$(2%) then goto 50 ! If not guest 47 print " " & \ print "Sorry, guests do not have the use of this program..." & \ goto 32767 50 print " " ! Give directions & \ print "This program will help you customize your account." & \ print " " & \ print "It will let you change your password or your account name." 55 print " " & \ print "Do you want to change your password? (Yes or No)"; 60 input "";pass.chg$ ! Get reply 70 pass.chg$=cvt$$(pass.chg$,2%+4%+32%) ! Edit to U/C & \ if left(pass.chg$,1)<>"Y" then goto 1000 ! If not changing P/W 80 a$=sys(chr$(3%)+chr$(0%)) ! Disable echo 90 input "Enter your old password";old.pass$ ! Get old P/W 95 print " " & \ old.pass$=cvt$$(old.pass$,32%) & \ if old.pass$="/SKIP" then goto 120 ! Don't lookup if /skip 100 a$=sys(chr$(2%)+chr$(0%)) ! Enable echo & \ a$=chr$(6%)+chr$(4%)+chr$(0%)+chr$(1%+2%) ! Build check P/W & \ a$=a$+ppn$+old.pass$ & \ a$=a$+string$(16%-len(old.pass$),0%)+"SY" & \ a$=a$+chr$(0%)+chr$(255%) 110 b$=sys(a$) ! Error if bad P/W 120 a$=sys(chr$(3%)+chr$(0%)) ! Disable echo 130 input "Enter your new password";new.pass$ ! Get 1st new P/W 140 new.pass$=cvt$$(new.pass$,32%) ! Edit to U/C & \ print " " & \ if len(new.pass$)<6 then goto 150 ! Length ok & else if len(new.pass$)>14 then goto 150 & else if xlate(new.pass$,legalp$)<>new.pass$ then goto 30010 & else goto 160 150 print "Sorry, your new password must be at least six letters," & \ print "but no more than fourteen letters long..." & \ goto 130 ! Error & retry 160 if new.pass$<>old.pass$ then goto 165 ! Different P/W 162 print "Yor new password must not be the same as the old one..." & \ goto 130 165 input "New password, once more";new.pas1$ ! Get 2nd new P/W 170 new.pas1$=cvt$$(new.pas1$,32%) ! Edit to U/C & \ print " " & \ if new.pass$=new.pas1$ then goto 190 ! If match 180 print "You must enter the same password twice, try again..." & \ goto 130 190 a$=sys(chr$(2%)+chr$(0%)) ! Enable echo 200 a$=chr$(6%)+chr$(8%)+chr$(0%)+chr$(0%)+ppn$ ! build set P/W 210 a$=a$+new.pass$+string$(16%-len(new.pass$),0%) 220 a$=a$+"SY"+chr$(0%)+chr$(255%)+chr$(255%) 230 b$=sys(a$) ! Change P/W 240 print "Your password has now been changed..." 1000 print " " & \ print "Your account name is currently: "; 1010 b$=chr$(6%)+chr$(-25%)+chr$(-1%)+chr$(5%)+ppn$ ! Build return name 1020 for i%=7% to 22% \ b$=b$+chr$(0%) \ next i% ! SYS string 1030 b$=b$+"SY"+chr$(0%)+chr$(255%) 1040 a$=sys(b$) ! Return name 1050 actnam$=mid(a$,8%,13%) ! Get student name 1060 print actnam$ ! Print it & \ print "Do you want to change it? (Yes or No)"; 1070 input "";name.chg$ ! Get reply 1080 name.chg$=cvt$$(name.chg$,1%+2%+4%+32%) ! Edit to U/C & \ if left(name.chg$,1)<>"Y" then goto 32767 ! If not changing name 1090 input "Enter your new account name: (For example, J. Smith)";new.name$ 1100 new.name$=cvt$$(new.name$,8%+16%+128%) ! Edit 1110 if len(new.name$)>13 then goto 1120 ! If length is bad & else if xlate(new.name$,legaln$)<>new.name$ then goto 30015 & else goto 1130 1120 print "Sorry, your account name must be thirteen letters or less..." & \ goto 1090 1130 b$=chr$(6%)+chr$(-25%)+chr$(-2%)+chr$(5%)+ppn$ ! Build set name 1140 b$=b$+chr$(5%)+new.name$+string$(13%-len(new.name$),0%) 1150 b$=b$+chr$(0%)+chr$(0%)+"SY"+chr$(0%)+chr$(255%) 1160 a$=sys(b$) ! Do it 1170 print "Your account name has now been changed..." & \ goto 32767 30000 print chr$(7);"That is not your password!" ! Say bad P/W & \ goto 55 30010 print "You have used an illegal character in your password." & \ print "Please use only letters and numbers..." & \ a$=sys(chr$(2%)+chr$(0%)) ! Enable echo & \ goto 55 30015 print "You have used an illegal character in your name." & \ print "Please use only letters, numbers, and punctuation..." & \ goto 1000 30020 actnam$="(no name)" & \ goto 1060 32400 resume 30000 if erl=110% ! Bad P/W & \ resume 30020 if (err=11% and erl=1040%) ! No name blockette & \ resume 32767 if err=11% ! ^Z on KB: & \ resume 30010 if erl=230% ! Bad new P/W 32410 print "Received error ";num1$(err);" at line ";num1$(erl);"." 32767 a$=sys(chr$(2%)+chr$(0%)) ! Ensure echo on & \ end