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
}