Redirect after login

17 years 9 months ago #17343 by mikko
Redirect after login was created by mikko
I would need a plugin or a modification that redirects users after login to an url that is specified as a parameter. The reason for this is that I want to be able to send out links to content that is only visible to registered users, and make it easy for users to login and view this content.

An example
1 User goest to a page that is not public
2 Site redirects to a login page which has this url as a hidden field
3 User enters his username and password and submits
4 CB login is called and the login is processed
5 User is redirected to the page that was initially requested

I know that this needs a Joomla plugin and have some ideas on how to do it, but is it possible to do the CB part as a plugin?

See www.webdesignhero.com/index.php?option=com_content&task=view&id=7&Itemid=13 for a description on how this could be done. (not my site)

mikko

Please Log in to join the conversation.

17 years 9 months ago #17349 by RAGEDBULL
Replied by RAGEDBULL on topic Re:Redirect after login
Hey,

Since that is my site, I'd like to give you an update. I have experimented with the code for the $_GET method. In good news, it works as I expected, in bad news, it works as I expected. You can specify a whole website, which would all to easilt be spammed. I am currently working on a workaround to this dilema through some regex I think may solve it, but I still want to make sure its bulletproof before I release any new code. If you want to know more, drop me an email at my website - www.webdesignhero.com

-Eric

PS I think I might have a safe way for you to do your exact process as of now, I'll let you know. The only thing I am unsure of is step 3&4.. do you want 2 seperate logins, I don't use CB very much, but I thought it has its own login script, which may perform slightly differently from the standard joomla one (in terms of variable names maybe). After I fix it for normal joomla login, I'm sure its the same for CB.

Please Log in to join the conversation.

17 years 9 months ago #17350 by mikko
Replied by mikko on topic Re:Redirect after login
Regexp comparison to live site variable should solve the security issue. Moreover, this could be used to enforce absolute urls.

What comes to the separate login, I think that it is nescessary but really straightforward to implement. If the user is just given "access denied", it is not useable. So a plain login form would be better.

mikko

Please Log in to join the conversation.

17 years 9 months ago #17358 by RAGEDBULL
Replied by RAGEDBULL on topic Re:Redirect after login
All right, I found a succesul way to implement it with regular Joomla Login, I'll leave the CB integration to you. I'm going to write up a good explanation of how to modify this and how it works, and later in the week I may even create a demo componenent. I will be placing the article and code on my website, which you can check out later, I won't post here since its not truly CB, and would be more useful to greater Joomla. I'm really suprised this wasn't included with joomla flat out, the ability is kind of already scripted....



-Eric

-Check my site in about 6 hours for the update (18:00 -5GMT)

Please Log in to join the conversation.

17 years 9 months ago #17386 by RAGEDBULL
Replied by RAGEDBULL on topic Re:Redirect after login
Here is the article, I'm working on the other parts. I tried to explain everything as simply as possibly. Since I do not have any active CB installations, I will not be experimenting with CB itself, but the concept should be the same, as from my memory, the CB login and registration are the same, just stores stuff in different places.

www.webdesignhero.com/index.php?option=com_content&task=view&id=10&Itemid=13


Maybe at some points I'll go and experiment with CB, I'll check this post in a few days and see if I have the time. Hope someone find it useful.

Please Log in to join the conversation.

17 years 9 months ago #17392 by RAGEDBULL
Replied by RAGEDBULL on topic Re:Redirect after login
There has been a request for the a diff between the orginal and the new file, I used a visual diff file, so here is the ouput as html:

www.webdesignhero.com/index.php?option=com_content&task=view&id=11&Itemid=11#c0

Hope this helps some more

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.351 seconds

Facebook Twitter LinkedIn