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
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 |
...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
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
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 :
and then from there you can do the redirection stuff.
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.
Thats great, thank you :)
Could I ask one more thing? where would I put this code? which file?
Thanks again
k
Could I ask one more thing? where would I put this code? which file?
Thanks again
k
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.
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.
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.