Processing table: prc.login




 
If:
 

 
 
Then:
2=@td;3=@tm;write

 
If:
 

 
 
Then:
declare global UName,SessID,SIDString,Remember,Cookie,CLogin,CLPass,CLUName

 
If:
 

 
 
Then:
declare global PEncode(40,*),OutFile(256,*),ErrMsg,ErrReturn(8,*),Pass(20,*)

 
If:
 

 
 
Then:
declare global CString,CSan(1,YESNO),CNoAmp(1,YESNO),CNoQuest(1,YESNO),CNoSlash(1,YESNO),CNoSpUn(1,YESNO)

 
If:
 

 
 
Then:
declare global CNoPlus(1,YESNO)

 
If:
 

 
 
Then:
declare global CookiePresent(1,YESNO)

 
If:
 

 
 
Then:
OutFile=getenv("ONEGATE_OUTFILE")

 
If:
 

 
 
Then:
ErrReturn="NOT DONE"

 
If:
 

 
 
Then:
declare global OGParseResult(4,*,g)

 
If:
 

 
 
Then:
call "onegate/ogcgixml"

 
If:
OGParseResult eq "FAIL"

 
 
Then:
ErrMsg="OGCGIXML parse failed";call "generr"

 
If:
ErrReturn eq "DONE"

 
 
Then:
goto myexit

 
If:
 

 
 
Then:
SIDString=@PW;call "make_sessionid";SessID=SIDString

 
If:
 

 
 
Then:
ff="0"

 
If:
 

 
 
Then:
lookup cgi = onegate k=@PW i=A -npx

If:
not cgi

 
 
Then:
close cgi;goto postcgi

 
If:
@pw ne cgi(1)

 
 
Then:
close cgi;goto postcgi

 
If:
cgi(2) eq "username" and cgi(8) eq "N"

 
 
Then:
UName=cgi(3);ff="1"

 
If:
cgi(2) eq "password" and cgi(8) eq "N"

 
 
Then:
Pass=cgi(3);ff="1"

 
If:
cgi(2) eq "remember" and cgi(8) eq "N"

 
 
Then:
Remember=cgi(3);ff="1"

 
If:
cgi(2) eq "flfsslog" and cgi(8) eq "Y"

 
 
Then:
CLogin=cgi(3);ff="1"

 
If:
 

 
 
Then:
delete cgi;getnext cgi;goto cgiloop

If:
ff eq "0"

 
 
Then:
ErrMsg="";call "loginform"

 
If:
ErrReturn eq "DONE"

 
 
Then:
goto myexit

 
If:
CLogin ne ""

 
 
Then:
bk=instr(CLogin,"|")

 
If:
bk eq "0" or CLogin eq ""

 
 
Then:
CLUName="";CLPass="";goto skipbk

 
If:
 

 
 
Then:
CookiePresent="Y";CLUName=mid(CLogin,"1",bk-"1");CLPass=mid(CLogin,bk+"1",len(CLogin)-bk)

If:
UName eq "" and CLUName eq ""

 
 
Then:
ErrMsg="No Username specified.";call "loginform"

 
If:
ErrReturn eq "DONE"

 
 
Then:
goto myexit

 
If:
 

 
 
Then:
CNoSpUn="Y";CSan="Y";CNoAmp="N";CNoQuest="N";CNoSlash="N";CNoPlus="N";CString=UName;call "clean_strings";Uname=CString

 
If:
 

 
 
Then:
CNoSpUn="N";CSan="Y";CNoAmp="N";CNoQuest="N";CNoSlash="N";CNoPlus="N";CString=Pass;call "clean_strings";Pass=CString

 
If:
Pass eq "" and CLPass eq ""

 
 
Then:
ErrMsg="Password not specified.";call "loginform"

 
If:
ErrReturn eq "DONE"

 
 
Then:
goto myexit

 
If:
UName eq "" and CLUName ne ""

 
 
Then:
UName=CLUName

 
If:
Pass eq "" and CLPass ne ""

 
 
Then:
PEncode=CLPass

 
If:
Pass ne ""

 
 
Then:
call "scramble_pass"

 
If:
 

 
 
Then:
Cookie=""

 
If:
Remember eq "Y"

 
 
Then:
CookiePresent="Y";call "make_cookie"

 
If:
 

 
 
Then:
lookup account = flfss_accounts k=(UName) i=A -nx

 
If:
not account

 
 
Then:
close account;ErrMsg="Username nonexistant.";call "loginform"

 
If:
ErrReturn eq "DONE"

 
 
Then:
goto myexit

 
If:
account(9) ne PEncode

 
 
Then:
close account;ErrMsg="Password incorrect.";call "loginform"

 
If:
ErrReturn eq "DONE"

 
 
Then:
goto myexit

 
If:
account(8) eq "Y"

 
 
Then:
close account;ErrMsg="You have been BANNED.";call "loginform"

 
If:
ErrReturn eq "DONE"

 
 
Then:
goto myexit

 
If:
 

 
 
Then:
UName=account(1)

 
If:
 

 
 
Then:
close account

If:
 

 
 
Then:
call "insert_session"

 
If:
 

 
 
Then:
ErrMsg="\""&UName&"\" - Login successful!";call "logindone"

 
If:
 

 
 
Then:
exit

If:
 

 
 
Then:
exit