Custom Redirection after login.

Custom Redirection after login.

Override the default Interakt login and redirect behaviour.
divider

Override the default Interakt login and redirect behaviour.

I have certain parts of a page only visible to logged-in users with a button or a link inviting the user to log in to view more information.

Problem is the user doesn't get redirected back to the referring page but to the pre-configured page instead.

This is a solution when you have a situation where certain parts of a page are only displayed when a user is logged in.

If page access is restricted and a user tries to access the page, the SB's will remember the referral page and redirect back there after the user is logged in.

Using the normal access restriction for not showing certain parts of a page and the user clicks a button to log in he gets redirected to the pre-defined redirections and not back to the referral page.

According to a lot of posts on the old Interakt site, it is impossible to achieve this.

Here is the solution.

add the following lines to your "semi" restricted page.

require_once('whatever_folder/includes/tng/tNG.inc.php');
$_SESSION['KT_denied_pageuri'] = KT_getFullUri();
$_SESSION['KT_denied_pagelevels'] = array();
Written by:  - 25 Oct, 2011