[SOLVED] sc_redir redirects to wrong path

I have an issue with sc_redir.

when a new user clicks on the “activation” link in their new user email. The page displays:

The requested URL /scriptcase/app/Timesheets/sec_form_add_users/sec_Login/ was not found on this server.

For some reason it is looking for the login app in one folder too far down - it should be:

/scriptcase/app/Timesheets/sec_Login/

not:

/scriptcase/app/Timesheets/sec_form_add_users/sec_Login/

The code is in the OnApplicationInit of xxx_form_add_users:

if(isset($_GET['a']) && substr($_GET['a'],0,4) == 'new_')
{
	sc_exec_sql("UPDATE sec_users SET active = 'Y', activation_code ='' WHERE activation_code = ". sc_sql_injection($_GET['a']) );
	
	sc_redir('sec_Login');
}

… which looks okay. Elsewhere sc_redir seems to work as expected.

UPDATE: - Workaround

The following works as a workaround:

if(isset($_GET['a']) && substr($_GET['a'],0,4) == 'new_')
{
	sc_exec_sql("UPDATE sec_users SET active = 'Y', activation_code ='' WHERE activation_code = ". sc_sql_injection($_GET['a']) );
	
	sc_redir('../sec_Login');        // Add "../" to direct to parent directory
}

another workaround :smiley:

thanks dude

Hello,

Issue reported to our bugs team.

regards,
Bernhard Bernsmann

Hello,

you can send your project so I can perform some tests?

Thank you!

Sure - how should I “package” it?

… and then Email the package to your email address as per your “signature”?

Yes, please. Thank you!

Hi Thomas,

Please post the solution summary after you are done, I’m having similar issue, although, not 100% similar, but looks like it.

Thanks.

Hello,

I have simulated your same problem with a new project, creating a new security module, but work fine for me. I receive a email with complete url to log in into my system created by Scriptcase. Without any problem.

Can you try create a new project and create a security module with activation via e-mail? I wait your feedback about your problem.

Thank you!

Thomas

Other redirs in all the other security module apps to the login app work fine - it’s just in that one app I had to add the “…/”.

I’ll try what you suggest, but it will be a few days…

But… assuming a fresh module “fixes” it, implying some corruption somewhere, then the workaround in this case is a better solution than having to recreate the whole security module - given the effort :slight_smile:

Hello,

Thanks for understanding. Should this become common in their work environment, please notify me so I can contact with our development team so we can make the right decisions to solve this problem. I’m marking the thread as “solved”, but can report something if you are in trouble for the same.

Thank you so much.