640 likes | 761 Vues
This script outlines a robust user authentication process allowing users to log in with various methods including username and password, or through page and NUP functionalities. It includes validations for error handling, ensuring that users are prompted correctly upon multiple login attempts. The system has a user-friendly interface with clear instructions and offers options for new users or continuing with existing accounts. The script efficiently manages user credentials and session states to enhance security and usability.
E N D
IF (UPPER(NUPPER) = "NO") THEN USENUP = TRUE • ELSE USENUP = FALSE • endif
IF (UPPER(PAGER) = "NO") THEN USEPAGE = TRUE • ELSE USENUP = FALSE • endif
if (tries > MAXTRIES-1) then • Cls • PRINTLN "@X02TOO MANY NAME TRiES" • DTROFF • HANGUP • ENDIF
Ansipos 32,11: PRINT "@X02eSC = lOGOFF" • AnsiPos 3,9 • Print "@X04|-@X02CONTiNUE@X04-@X02AS@X04-@X02NEWUSER@X04-|" • chosen = 1
:d • k = inkey() • IF (k = chr(27)) then • DISPFILE PPEPATH()+"LOGOFF.PCB", GRAPH • DTROFF • HANGUP • ENDIF • if (k = chr(13)) then goto checkwhat: endif • if (k = "RIGHT") then • inc chosen • if (chosen = 2) then • AnsiPos 3, 9 • Print "@X02|-CONTiNUE-AS-NEWUSER-|" • AnsiPos 29,9 • Print "@X04|----@X02RE-ENTER@X04-@X02NAME@X04----|" • chosen = 2 • endif • if (chosen = 3) then • Ansipos 29,9 • Print "@X02|----RE-ENTER-NAME----|" • Ansipos 55,9 • Print "@X04|-----@X02PAGE@X04-@X02SYSOP!@X04-----|" • chosen = 3 • endif • if (chosen = 4) then • Ansipos 55,9 • Print "@X02|-----PAGE-SYSOP!-----|" • Ansipos 3,9 • Print "@X04|-@X02CONTiNUE@X04-@X02AS@X04-@X02NEWUSER@X04-|" • chosen = 1 • endif • endif • if (k = "LEFT") then
dec chosen • if (chosen = 2) then • Ansipos 55,9
Print "@X02|-----PAGE-SYSOP!-----|" • AnsiPos 29,9 • Print "@X04|----@X02RE-ENTER@X04-@X02NAME@X04----|" • chosen = 2 • endif • if (chosen = 0) then • AnsiPos 3, 9 • Print "@X02|-CONTiNUE-AS-NEWUSER-|" • Ansipos 55,9 • Print "@X04|-----@X02PAGE@X04-@X02SYSOP!@X04-----|" • chosen = 3 • endif • if (chosen = 1) then • Ansipos 29,9 • Print "@X02|----RE-ENTER-NAME----|" • Ansipos 3,9 • Print "@X04|-@X02CONTiNUE@X04-@X02AS@X04-@X02NEWUSER@X04-|" • chosen = 1 • endif • endif • goto d
GetALTuser U_RECNUM(NAME) • ANSIPOS 19, 6 • PRINT "@X02"+U_CITY
if (pwdtries > Maxtries) then • DISPFILE PPEPATH()+"WRONGPWD.PCB", GRAPH • DTROFF • HANGUP • ENDIF
if (UPPER(PWD) = UPPER(U_PWD)) THEN • ANSIPOS 19, 6 • PRINT " " • GOTO LOGIN
else • ANSIPOS 19, 6 • PRINT "@X04Wrong Password Entered, Tries Left : ",MAXTRIES-PwdTries • Pwd = "" • AnsiPos 19, 5 • Print " " • goto PwdEnter
if (chosen = 1) then • if (USENUP = FALSE) THEN CALL NUPPER • else • CLS • PRINTLN "@X01|-----------------------------------------------------------------------------|" • PRINTLN " @X02ENTER NUP: " • PRINTLN "@X01|-----------------------------------------------------------------------------|" • ANSIPOS 13,2 • INPUTSTR "_", NUP, 7, 30, MASK_ASCII()+"›‘†’", UPCASE • IF (UPPER(NUP) = UPPER(NUPPIE)) THEN • DISPFILE PPEPATH()+"CORRECT.PCB", GRAPH • ELSE • DISPFILE PPEPATH()+"WRONG.PCB", GRAPH • DTROFF • HANGUP • ENDIF • ENDIF
IF (Chosen = 2) then • inc tries • goto entername • endif
IF (Chosen = 3) then • CLS • PRINTLN "@X02PAGiNG SYSOP ..." • PRINTLN "@X01|-------------------------------------|" • PRINTLN "" • PRINTLN "@X01|-------------------------------------|@X02"