Redirect "returning logged in already" user

Permalink Browser Info Environment
Hi
I dont think this package does this but would it be possible to find a solution to this?
I need to add new "required" attributes to user but i use a 1 year logged in cookie and most people don't log out.

I'm willing to pay for this update

Kevin

Type: Discussion
Status: New
kevinbrown04
View Replies: View Best Answer
GregJoyce replied on at Permalink Reply
GregJoyce
Hi Kevin,
I think this will work for you if you use groups. You can have a group of users you want to redirect, but your case you will want all of your users to be in this group.
kevinbrown04 replied on at Permalink Reply
kevinbrown04
...but my problem is the users are all logged in with long cookies that I don't want to kill.
Login Redirect (I think) is only triggered when the user logs in and not when the user is returning to the site while still logged in.

Do you see the problem?

:)

K
GregJoyce replied on at Permalink Best Answer Reply
GregJoyce
I see what you mean now. Yeah that would be a problem. I don't think the login attribute would do what you need then because it is tied to the login process. Probably the way you would need to do this is to have either like a cookie or session variable to determine if the user has been redirected before.

I think you could get something started using something like :
$u = new User();
if ($u->isLoggedIn()) {
  //user is logged in
}


and then from there you can do the redirection stuff.
kevinbrown04 replied on at Permalink Reply
kevinbrown04
Thats great, thank you :)

Could I ask one more thing? where would I put this code? which file?

Thanks again

k
GregJoyce replied on at Permalink Reply
GregJoyce
well you have a couple options I suppose. The more correct answer is probably to follow this technique:
http://www.concrete5.org/documentation/how-tos/designers/tutorial-b...

Where you will be hooking in to the on_start event, but you will not be doing the theme switch or anything.

Alternatively, you could get something similar if you put the redirection code in the header of your theme. Also, as a concrete5.org tip, if you have more general programming questions regarding concrete5, the "building with concrete5" gets more eyes than these add-on subforums do.

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.