This topic is locked

Access passowrd protected page directly

10/14/2010 12:41:37 PM
PHPRunner General questions
C
cis2131 author

In the manual i have found this:
If user is trying to access one of password-protected pages directly e.g. pagename_edit.php?editid1=3 this page address is saved in $_SESSION["MyURL"] variable and user is redirected to the login page.
After successful login user will be redirected to that page.
I have tried to put it on the after "After sucessfull login page" like this:
header("Location: ".$_SESSION["MyURL"]."");
But that just redirect me back to the login page after login..
Kan anyboddy see what i am doing wrong, or have i totally misonderstood the idea...

Sergey Kornilov admin 10/14/2010

What's described in the manual is implemented already in PHPRunner code and you don't need to add any code.
Probably you need to explain what you trying to achieve.

C
cis2131 author 10/15/2010

I have a task manager, that sends out emails, where i have made an url directly to the task in the email.
When i click on the link, it takes me to the login page (offcause). but then it takes me to the page i redirect to after login, (to avoid the Menu Page).
What i would like to do is have one page to load on normal login, and still being able to use the direct access feature.
Claus

Sergey Kornilov admin 10/15/2010

Try something like this in 'After Successful Login' event:

if ($_SESSION["MyURL"])

header("Location: ".$_SESSION["MyURL"]."");

else

header("Location: http://someotherurl";);
C
cis2131 author 10/16/2010



Try something like this in 'After Successful Login' event:

if ($_SESSION["MyURL"])

header("Location: ".$_SESSION["MyURL"]."");

else

header("Location: http://someotherurl";);



Thanks alot.. However, it dosen't work as expected..

It redirects me fine after login, so that part works great, but if i don't try to access an url, then it takes me to the menu page... So the else statement don't seem to be executed.

I have tried with many different url's but ends on the menu page everytime.
Claus

Sergey Kornilov admin 10/17/2010

Claus,
post your application to Demo Account and open a ticket at http://support.xlinesoft.com sending your Demo Account URL. 'Demo Account' button can be found on the last screen in the program.