override the encryption key for activation links

Tips submitted by ASPMaker users

override the encryption key for activation links

Postby squeek » Wed Dec 03, 2014 7:50 am

If you allow registration and require activation, here is something that you should know:

The encryption is based on the random key (EW_RANDOM_KEY) in aspfn*.asp

This variable changes each time you generate the code. If a user registers, then you generate new code, the activation link for that person will not work, because it was based on the previous key.

Here is a way to set your own constant key that will override the one in aspfn*.asp. In the server events/global/all pages/page_head put this:

%>
<script language="JScript" runat="server">
// Server-side JScript functions for ASPMaker 11+ (Requires script engine 5.5.+)
// encrytion key
EW_RANDOM_KEY = '4aeAfh3AGIoT4gNb';
</script>
<%

You must begin with the %> because this section of code is expected to be ASP. For the same reason, you must end with <% to put it back into ASP mode.

I just tried it on two projects, and it worked for me. If you have any problems, please let me know.
squeek
 
Posts: 31
Joined: Fri Nov 22, 2013 2:31 am

Re: override the encryption key for activation links

Postby Webmaster » Wed Dec 03, 2014 9:20 am

Simply put:

EW_RANDOM_KEY = 'YourRandomKey';

in Server Events -> Global -> All pages -> Global Code.
Webmaster
 
Posts: 10727
Joined: Fri Aug 06, 2004 5:59 pm

Re: override the encryption key for activation links

Postby squeek » Fri Oct 30, 2015 12:53 am

That used to work, but with version 12.0.5, EW_RANDOM_KEY is now a CONSTANT. Now I'm forced to modify the template, which I really wanted to stay away from, now that I've learned how to use the code section.

Do you have any other ideas?
squeek
 
Posts: 31
Joined: Fri Nov 22, 2013 2:31 am

Re: override the encryption key for activation links

Postby squeek » Sat Jul 02, 2016 6:54 am

ASPMaker 2016 does the same thing - EW_RANDOM_KEY is a constant, so here's my suggestion; simple fix:

In Advanced Settings, give us a place to put in our own random key. This way, if it's blank, keep doing it your way, go ahead and change the key upon each code generation:

ewcfg.asp line 74: Const EW_RANDOM_KEY = "<!--##=sRandomKey##-->"

but if we enter a value, use that in place of sRandomKey in the ewcfg.asp template.

Simple fix, folks. I hate modifying templates if I don't have to, and I bet a lot of you feel the same way.

Come on and "LIKE" this suggestion.
squeek
 
Posts: 31
Joined: Fri Nov 22, 2013 2:31 am


Return to User Submitted Tips (ASPMaker)