custom page leave function password validation
Hi people, I've been trying to validate a users login on a remote server page, I have the blank password code working fine, although I can't see why the abort doesnt work after reading the value from the text file, I want it to go back to the page like the abort call does on empty password, anyway I've included the page leave function if anyone can read it hehe
:)
Function exitGetCFPassPage
!insertmacro MUI_INSTALLOPTIONS_READ $CFPASS "getCFPass.ini" "Field 2" "State"
MessageBox MB_OK "$$CFPASS == $CFPASS"
# check its not empty at least
${If} $CFPASS == ""
# empty password, prompt for a valid password again
MessageBox MB_OK "Please enter a valid ColdFusion admin password."
abort
${endIf}
# we forget all the items are extracted here already due to this page coming after the instfiles page
# we can just perform a simple wget on the testlogin script, and read the contents of c:\adminapi.log
# to see if it produced true or false for a valid login, then we can validate in here until we get a
# valid password!
NSExec::exec "$TEMP\${gossTemp}\wget\wget.exe http://localhost/icm/adminAPI/testlogin.cfm?password=$CFPASS"
# this returns a file c:\adminapi.log with true or false in, which we can use
# read the file, decide what to do etc, what about exceptions if its not there?
FileOpen $4 "c:\adminapi.log" r
# we read until the end of line (including carriage return and new line) and save it to $1
FileRead $4 $1
# close the file
FileClose $4
MessageBox MB_OK "login result is : $1"
${If} $1 == "false"
# invalid login
MessageBox MB_OK "Please enter a valid ColdFusion admin password."
abort
${endIf}
FunctionEnd