MX Kommerce Forum :: login redirect

This thread was displayed: 0 times


Starting with 17th May 2007, Adobe Systems will stop offering support for any version of the discontinued InterAKT products. As a result, we will not answer to new support incidents starting with May 17th, 2007. Pending support incidents will still be followed in order to be closed. The product forums will remain open and be transformed in user-to-user forums. The general forums will be made read-only and not allow new posts or comments.

For more information about the affected products visit: www.interaktonline.com/Support/

View Threaded Show descending
Danny Lewin
06-27-2007 02:32:14 GMT +2

Hi,

I have a site that like Yahoo!, has one user account for all sections and services. But i want to redirect the user to the section that they are trying to enter. Not the default success page.

I had a look through tNG_config.ini and found there three settings that are entered in the control pannel:

  $tNG_login_config["redirect_failed"] = "members/members_only.php";
  $tNG_login_config["redirect_success"] = "members/account.php";
  $tNG_login_config["login_page"] = "members/login.php";

I tried something like this inside the config file:

$where = explode("/", $HTTP_REFERER);
if(ereg("rincepals", $where[3]))
{
  $tNG_login_config["redirect_success"] = "rincepals/index.php";
}else{
  $tNG_login_config["redirect_success"] = "members/account.php";
}

I also removed them from the config file and put the code above on the login page, but that redirected to the sites root.

I noticed when looking through the TNG folders that there is a redirect cookie set before you are taken to the login page from restricted pages. Is there a way to set the cookie in the different sections to redirect there after login. I cant see what the variable name is to even try this way.

Has anyone any ideas how i can do this?

Thanks in advance,
Danny

Back | Reply | Quote | Top
Danny Lewin
06-27-2007 04:41:59 GMT +2

I have done what i was wanting to do. It might be a little messy, but this is what i done:

For my default login page i have this code:

$where = explode("/", $HTTP_REFERER);
if(ereg("rincepals", $where[3]))
{
setcookie("TestCookie","1",time()+100,"/",www.mysite.com);
$logo = "LOGO IMG";
$text = "TEXT";
}else{
$logo ="LOGO IMG";
$text ="TEXT";
}

I have 2 different headers which are selected depending on the reffering page to show different logos and page text.

Then on my default success page i have this code which destroys the cookie and redirects:

if(isset($_COOKIE["TestCookie"])){
setcookie("TestCookie","",time()-100,"/","www.mysite.com");
header("Location: http://www.mysite.com/folder/adifferentpage.php"); /* Redirect browser */
/* Make sure that code below does not get executed when we redirect. */
exit;
}

Might be a messy way of doing it, but it works! Any improvements on this, please ket me know!

Thanks,
Danny

Reply | Quote | Top
benjamin wende
12-27-2007 01:16:56 GMT +2

Thx.

Bennos

MY Sites:

schmuck - Jobbörse  - Strom

Reply | Quote | Top
© Adobe Systems Romania. All rights reserved.