Search code examples
formslotus-notescaptchalotus-dominolotus-formula

Reason Type field in domcfg


To ensure more security to my XPages web application, I put a captcha in the custom login form in domcfg.nsf. I followed the link to build my captcha : http://www.notesmail.com/home.nsf/tip20100506

The problem is when log in, if the captcha is misunderstood , I can not update the value of the field to reasontype it makes me appear the message "Wrong captcha code." I added this action to check if the text entered is equal to captcha :

@If ( @UpperCase ( MyCaptchaField ) = TheRealValueOfMyCaptcha ; FIELD reasontype: = "6" ; "")

and I added a condition that shows me an error in the calculated field error messages if the value of reasontype is equal to "6" . This does not work and I can access my XPage even if the captcha is not written. I feel that the reasontype field depends only 5 predefined conditions.

Is there a solution to add other conditions in log on form?


Solution

  • You've got a space between the colon and equal characters. That means the characters are treated as two operators - a list concatenation operator and an equality operator.

    Instead of this

    @If ( @UpperCase ( MyCaptchaField ) = TheRealValueOfMyCaptcha ;  FIELD reasontype: = "6" ; "")
    

    You need this:

    @If ( @UpperCase ( MyCaptchaField ) = TheRealValueOfMyCaptcha ;  FIELD reasontype := "6" ; "")
    

    However, the classic style for this would be:

    FIELD reasontype := @If ( @UpperCase ( MyCaptchaField ) = TheRealValueOfMyCaptcha ;  "6" ; "");