Kunena 7.0.5 & Kunena 6.4.11 – Security Updates Released

The Kunena team has announce the arrival of Kunena 7.0.5 [K 7.0.5] in stable which is now available for download as a native Joomla extension for J! 5.4.x/6.0.x. This version addresses most of the issues that were discovered in K 6.2 / K 6.3 / K 6.4 and issues discovered during the last development stages of K 7.0.

The Kunena team is also pleased to announce the eleventh version of Kunena 6.4, a native Joomla extension for Joomla! 5.0, 5.1, 5.2, 5.3, 5.4 and 6.0.

Question Where to add,change redirect url after login?

More
16 years 3 months ago #38503 by sozzled
I think I understand. What you want is to make the redirection specific, depending on which page the module is located? Is that right?

If this is the case (and I haven't experimented with it to see whether this idea works) you could use the Joomla "copy module" to create a new instance of the mod_login, assign the copy to a particular page, and define specific redirection parameters to the copy of the mod_login. Would you like to give it a go? :)

Please Log in or Create an account to join the conversation.

More
16 years 3 months ago #38508 by LittleJohn
"depending on which page the module is located?"

Thats not entirely true either, because the link to the login could be posted outside the system too (or within the html of some article), leaving it outside the scope of joomla's handling itself.

I think Ill try go on a discovery trip on the joomla forums for an answer.
Be back later - (hopefully) with some reply. :D

Please Log in or Create an account to join the conversation.

More
16 years 3 months ago #38509 by LittleJohn
It seems to be somewhat built into the joomla com_user component already.
Its not exactly what I was looking for, but might help somebody.

This page explains how to do an internal redirect after login/logout: docs.joomla.org/How_do_you_redirect_user..._successful_login%3F

A base64_encode of index.php?option=com_pizzapie' yeilds: 'aW5kZXgucGhwP29wdGlvbj1jb21fcGl6emFwaWU='


You just put the string in the end of the login url as 'redirect' parameter. It should look like this:
index.php?option=com_user&view=login&return=aW5kZXgucGhwP29wdGlvbj1jb21fcGl6emFwaWU=

One catch - it only works on base64_encode'd internal urls.

This will work:
localhost/joomla/index.php?option=com_user&view=login&return=aW5kZXgucGhwP29wdGlvbj1jb21fcGl6emFwaWU=

This will not work:
localhost/joomla/index.php?option=com_user&view=login&return=index.php?option=com_pizzapie
localhost/joomla/index.php?option=com_user&view=login&return=com_pizzapie
localhost/joomla/index.php?option=com_user&view=login&return=http://www.disney.com

I guess, if you had a module that redirect the user to external links (like weblinks), you could encode those links and use them.
Dirty work, but you dont have to do any hacking. :)

And finally, a link to an online base64 encoder/decoder:
www.motobit.com/util/base64-decoder-encoder.asp

Happy redirectin' ;)

Please Log in or Create an account to join the conversation.

More
16 years 2 months ago #40457 by [email protected]
I've been looking for something that does exactly this. I have pages behind authentication that I want to load automatically post-login.

To build and encode redirectUrl (as indicated in your post), it would need to capture the unencoded value ("category=" blah blah blah) from the inbound URL. Do you know where that value is captured? What module or where in the code? Is this in Controller.php in comUser?

I'm fine with it being internal URLs only. I just need to know where to record the inbound so I can translate it to the encoded outbound returnUrl.

I'm more than happy to hack it, but I'm not sure where that inbound value is identified.

Please Log in or Create an account to join the conversation.

More
16 years 2 months ago #40464 by LittleJohn
So, you are basicly asking for which file that generates the "Login" link in kunena? (so you can hack it)

Please Log in or Create an account to join the conversation.

More
16 years 2 months ago - 16 years 2 months ago #41919 by nttranbao
Wow, looks like Kunena redirect to current page after loggin in is a big issue. I googled and found other posts regarding this issue.

There are some workarounds, but all require lots of modification (some 5+ files or more), which is hard to trace.

So here is my workaround, for Kunena 1.5.9, Joomla 1.5.15:

Edit one file: ccmponents/com_kunena/template/default/plugin/profilebox/profilebox.php, and make it like below:

...

<?php // AFTER LOGIN AREA
if ($fbConfig->fb_profile == 'cb')
{
$loginlink = CKunenaCBProfile::getLoginURL();
$logoutlink = CKunenaCBProfile::getLogoutURL();
$registerlink = CKunenaCBProfile::getRegisterURL();
$lostpasslink = CKunenaCBProfile::getLostPasswordURL();
}
else if ($fbConfig->fb_profile == 'jomsocial')
{
$loginlink = JRoute::_('index.php?option=com_community&amp;view=frontpage');
$logoutlink = JRoute::_('index.php?option=com_community&amp;view=frontpage');
$registerlink = JRoute::_('index.php?option=com_community&amp;view=register');
$lostpasslink = JRoute::_('index.php?option=com_community&amp;view=frontpage');
}
else
{


$redirectUrl = $_SERVER;
$redirectUrl = base64_encode($redirectUrl);
$redirectUrl = '&amp;return='.$redirectUrl;

//Start of modification
//nttranbao : add "&return=current-page" for Kunena to redirect to current page after log in

$loginlink = 'index.php?option=com_user&amp;view=login' . $redirectUrl;
$logoutlink = 'index.php?option=com_user&amp;view=login' . $redirectUrl;
$registerlink = 'index.php?option=com_user&amp;view=register&amp;Itemid=' . $Itemid ; // registerlink : we dont want it to redirect
$lostpasslink = 'index.php?option=com_user&amp;view=reset&amp;Itemid=' . $Itemid . $redirectUrl;


$loginlink = JRoute::_($loginlink);
$logoutlink = JRoute::_($logoutlink);
$registerlink = JRoute::_($registerlink);
$lostpasslink = JRoute::_($lostpasslink);


//Comment out/delete these 4 lines:
//$loginlink = JRoute::_('index.php?option=com_user&amp;view=login');
//$logoutlink = JRoute::_('index.php?option=com_user&amp;view=login');
//$registerlink = JRoute::_('index.php?option=com_user&amp;view=register&amp;Itemid=' . $Itemid);
//$lostpasslink = JRoute::_('index.php?option=com_user&amp;view=reset&amp;Itemid=' . $Itemid);
}

...

Save. And try for yourself: go to any page, then click login, enter credentials and bump, you are now at the previous page with logged on status.

PS: you can edit the above links to redirect to whereever you want, after login/logout/register or Lostpassword action

Enjoy

Bao Nguyen
Last edit: 16 years 2 months ago by nttranbao.

Please Log in or Create an account to join the conversation.

Time to create page: 0.246 seconds