base64 login redirect not working

9 years 4 months ago #132590 by karlja
Hi ckayfish,

a redirect-plugin would raise the issue of remembering two (or more) referring pages as mentioned before.

So, all I did was modifying the template file for the Joomla login (components/com_user/views/login/tmpl/default_login.php) to
[code:1]<?php defined('_JEXEC') or die('Restricted access'); ?>[/code:1]
(basically I just emptyied it and so it is not shown anymore)

Regards,
Karlja
The following user(s) said Thank You: joebrickley
9 years 4 months ago #132602 by ckayfish
Karlaj, I could see that working as well. I prefer to modify the template because once set, it remians fairly static, while Joomla still needs to be upgraded a few times a year. Also, in general, I avoid core hacks when ever possible. Since I already have my templates set up to do different things depending on if the user is logged in or not, this is very straight forward for me to add.

Thanks for sharing your option though.

I hope the joomlapolis crew consider how/what to change in CBLogin so I wont have to hack this in the future either, but no hurry. Edit: If I come up with something that I think will work for everyone, I'll forward my ideas/code along

Post edited by: ckayfish, at: 2010/05/09 19:33

Tips for understanding and solving your issue - Props to Krileon for creating this.
My Opensource CB Plugins: Mutual Connections and MYCB Cookie available here
9 years 4 months ago #132612 by ckayfish
As I was about to apply this to another site, I realized it's not really whether the user is logged on or not that I care about when displaying the joomla login page. I dont want my users to see any part of it ever. So I changed my template as follows:

Replaced

[code:1]<jdoc:include type="component" />[/code:1]
with
[code:1]<?php if($option=="com_user") { ?>
<jdoc:include type="modules" name="juserpage" style="xhtml" />
<?php } else { ?>
<jdoc:include type="component" />
<?php } ?>
[/code:1]

So by testing that the joomla option/component being loaded is com_user, and not ever dislaying it, I ensure they never see any of the joomla user stuff. If you wanted, you could specify the view of the component (eg login page only), but I dont need to do this

I then publish a CBLogin module, and anything else I want, to the module position "juserpage".

Edit: Note that I had forgot an equaly sign in my if statement. I only had 1, which set the variable, but need 2 to compare. Silly me.

Post edited by: ckayfish, at: 2010/05/09 21:05

Tips for understanding and solving your issue - Props to Krileon for creating this.
My Opensource CB Plugins: Mutual Connections and MYCB Cookie available here
9 years 1 month ago #138287 by anisa
Hi guys,

I have had the same problem, namely that I wanted users to get redirected to the link they previously clicked. Thanks to the suggestions on this thread I was able to do that.

But,I also want to have a static redirect for users that are not accessing a link on the registered site. So, if users do not access a specific link in the registered section I would like to redirect them to a registered page which provides some extra information otherwise redirect them to the link they wanted to visit.

Can somebody help me with suggestions on how to achieve that?

Thanks in advance,
Anisa
9 years 1 month ago #138406 by dmoorefus
I haven't been able to get the suggestion on this thread to work and was wondering if anyone had any ideas on why it wasn't working on mine...

I'm using:
Joomla 1.5.18
CB 1.2.3
CBSubs 1.0.3
(also using sh404SEF 1.5.12.464, Kunena 1.5, and GroupJive 1.8)

I'm using the following code suggested in this post:
[code:1]
//echo '<input type="hidden" name="return" value="B:' . base64_encode( $login ) . '" />'."\n";
$myReturn = JRequest::getVar('return', '', '_GET');
echo '<input type="hidden" name="return" value="B:'.$myReturn.'" />';
[/code:1]

I have the behavior in CBSubs to redirect on login for a specific group left blank.

I have the Login Redirection URL field in the CB Login Module set to blank also.

Whenever a user clicks on the link to a forum posting, they're prompted to login via the CB login page and upon login, they're redirected to the home URL for the site rather than the original link.

Anything think of something I'm missing?

Thanks!
9 years 1 month ago #138426 by anisa
Hi dmoorefus,

After reading some documentation, I adapted the given solution to the following:

[code:1]
$myReturn = JRequest::getVar('return', '', '_GET');
echo '<input type="hidden" name="return" value="B:'. base64_encode($return) .'" />';
[/code:1]


Maybe this works for you too.
Moderators: beatnantkrileon
Time to create page: 0.384 seconds
Facebook Twitter Google LinkedIn