This topic is locked
[SOLVED]

 Registration page

6/25/2010 5:46:08 PM
ASPRunnerPro General questions
P
Philip author

Hi,
I'm using ASPR 6.2. I want to set up a registration page. Unfortunately a user (= person) may have several logins (= usernames).

The registration page checks unique usernames (which is obv. ok) but checks as well for unique e-mail adresses. This causes of course problems.

Is there a way to skip this check of e-mail adresses?
Regards,

Philip

A
ann 6/28/2010

Philip,
you need to edit generated source\register.asp file.

Find and remove the following code in the file:

if not bValue(asp_strlen(strEmail)) then

xt.assign_p2 "email_msg",##message VALID_EMAIL##

allow_registration = false

else

strSQL = "select count(*) from ##@BUILDER.strLoginTable ts## where ##@BUILDER.strUserEmailField ws##=" & CSmartStr(add_db_quotes("##@BUILDER.strUserEmailField s##",strEmail,""))

doAssignmentByRef rs,db_query(strSQL,conn)

doAssignmentByRef data,db_fetch_numarray(rs)

if IsLess(0,ArrayElement(data,0)) then

xt.assign_p2 "email_msg",(((CSmartStr(##message EMAIL_ALREADY1##) & " <i>") & CSmartStr(strEmail)) & "</i> ") & CSmartStr(##message EMAIL_ALREADY2##)

allow_registration = false

end if

end if
P
Philip author 6/28/2010

Ann,

thanks for that; I already found this possibility and this works fine.
BUT: every time I rebuild a project I have to change code. If I forget ...

Therefore I thougt that we can find another solution based on the registration events.

My idea is basically as follows:

before register.sp checks the e-mail adress, I change the necessary field value within an event; after the (passed) check the new registration record is saved with the e-mail typed in by user.

Do you see a possibility for that?
Regards,

Philip

A
ann 6/29/2010

Philip,
all files in the \source directory are used to apply permanent changes, i.e. it wouldn't be affected after you've rebuild the project.

Unfortunately, there is no way to do it in Events.

P
Philip author 6/29/2010



Philip,
all files in the \source directory are used to apply permanent changes, i.e. it wouldn't be affected after you've rebuild the project.

Unfortunately, there is no way to do it in Events.


Ann,

thanks; I will change the file in source directory.
Philip

P
Philip author 7/14/2010



Philip,
you need to edit generated source\register.asp file.

Find and remove the following code in the file:

if not bValue(asp_strlen(strEmail)) then

xt.assign_p2 "email_msg",##message VALID_EMAIL##

allow_registration = false

else

strSQL = "select count(*) from ##@BUILDER.strLoginTable ts## where ##@BUILDER.strUserEmailField ws##=" & CSmartStr(add_db_quotes("##@BUILDER.strUserEmailField s##",strEmail,""))

doAssignmentByRef rs,db_query(strSQL,conn)

doAssignmentByRef data,db_fetch_numarray(rs)

if IsLess(0,ArrayElement(data,0)) then

xt.assign_p2 "email_msg",(((CSmartStr(##message EMAIL_ALREADY1##) & " <i>") & CSmartStr(strEmail)) & "</i> ") & CSmartStr(##message EMAIL_ALREADY2##)

allow_registration = false

end if

end if



Ann,

you missed something:

you need to edit generated source\registersuggest.asp file.

Find and remove the following code in the file:

if bValue(asp_strlen(email)) then

strSQL = "select count(*) from ##@BUILDER.strLoginTable ts## where ##@BUILDER.strUserEmailField ws##=" & CSmartStr(add_db_quotes("##@BUILDER.strUserEmailField s##",email,""))

doAssignmentByRef rs,db_query(strSQL,conn)

doAssignmentByRef data,db_fetch_numarray(rs)

if IsLess(0,ArrayElement(data,0)) then

ResponseWrite (((CSmartStr(##message EMAIL_ALREADY1##) & " <i>") & CSmartStr(email)) & "</i> ") & CSmartStr(##message EMAIL_ALREADY2##)

end if

end if


Otherwise this will not work properly.

Why? As soon as you add more fields to the register.asp page and you make an entry for the email then go to the next field the test is done and you are not able to use the same email twice.
Philip