Frontend user (FEU) can not login
Frontend user (FEU) can not login
Hi,
I am using FEU in combination with Eventmanager. By registering a user can suscribe to an event (in my case a course).
This all goes well. A user registers, gets an activation link, activates and is logged in. After that he or she can suscribe.
The user is automaticaly logged out after 1800 seconds.
Now gets the tricky part. If a user returns to the page and would like to login with his user data, that doesn't work. After loging in with the right credentials, the only thing that happens is that the user is being redirected to the previous page.
I really don't know whats happening and could use all the help there is.
If you would like to try, login to http://baukejonkmans.nl/events/7/94/Bas ... dagen.html with un: bauke.jonkmans@gmail.com and pw: testuser
Thank you for your help!
I am using FEU in combination with Eventmanager. By registering a user can suscribe to an event (in my case a course).
This all goes well. A user registers, gets an activation link, activates and is logged in. After that he or she can suscribe.
The user is automaticaly logged out after 1800 seconds.
Now gets the tricky part. If a user returns to the page and would like to login with his user data, that doesn't work. After loging in with the right credentials, the only thing that happens is that the user is being redirected to the previous page.
I really don't know whats happening and could use all the help there is.
If you would like to try, login to http://baukejonkmans.nl/events/7/94/Bas ... dagen.html with un: bauke.jonkmans@gmail.com and pw: testuser
Thank you for your help!
Re: Frontend user (FEU) can not login
Looks like you fixed it, FEU has a couple ways of redirecting after login, one is set in FEU admin, the other is set in the tag, both are mentioned in the Help...
Re: Frontend user (FEU) can not login
Hi Dr. CSS,
Thanks for taking a look. Unfortunately it is not fixed. What actually happens when you login (at this moment) is that the page redirects to the parent page (/kalender). What should happen is that the user stays on this page, but is able to register.
I used this tag {FrontEndUsers form="login"} and have not set a redirect in the FEU admin.
Do you have any idea what could be wrong?
Thanks for taking a look. Unfortunately it is not fixed. What actually happens when you login (at this moment) is that the page redirects to the parent page (/kalender). What should happen is that the user stays on this page, but is able to register.
I used this tag {FrontEndUsers form="login"} and have not set a redirect in the FEU admin.
Do you have any idea what could be wrong?
Re: Frontend user (FEU) can not login
I don't quite follow what you want and what is not working, a little more detail with step by step walk thru of what should happen...
Re: Frontend user (FEU) can not login
The detail page URL is a constructed route. After login, the user is redirected back to /kalendar as that is the real page.
Try capturing the URL route and then put that in the FEU tag as the redirect to location.
Try capturing the URL route and then put that in the FEU tag as the redirect to location.
Re: Frontend user (FEU) can not login
If my previous comment doesn't work, try the following. I've used it in a few instances and it seems to work OK.
In your detail template, capture the constructed URL, eg if you have CGExtensions and CGSimpleSmarty installed:
In your summary ('/kalendar') template put:
What it does is:
1. On the detail page, when the user logs in, it saves the constructed URL to a session var.
2. Once the user is logged in, by default it returns to the /kalendar summary page template.
3. That template checks to see if the session var 'detailurl' exists and if so, assigns it to a local var, erases the session var then automatically redirects back to the detail page with the correct URL.
hth
psy
In your detail template, capture the constructed URL, eg if you have CGExtensions and CGSimpleSmarty installed:
Code: Select all
{session_put var=detailurl value=$cgsimple->self_url()}
Code: Select all
{if $ccuser->loggedin() and !empty($smarty.session.detailurl)}
{assign var='redirecturl' value=$smarty.session.detailurl}
{session_erase var='detailurl'}
{redirect url=$redirecturl}
{/if}
What it does is:
1. On the detail page, when the user logs in, it saves the constructed URL to a session var.
2. Once the user is logged in, by default it returns to the /kalendar summary page template.
3. That template checks to see if the session var 'detailurl' exists and if so, assigns it to a local var, erases the session var then automatically redirects back to the detail page with the correct URL.
hth
psy
Re: Frontend user (FEU) can not login
Hi Psy,
Thank you for your suggestions.
Just one question. Can you tell me what the best way is tot capture the URL route?
Aside from that, is that; won't the URL route be different for every event?
As for the alternative you mentioned (changing the template). Where to place the first code you gave?
Thank you for your suggestions.
Just one question. Can you tell me what the best way is tot capture the URL route?
Aside from that, is that; won't the URL route be different for every event?
As for the alternative you mentioned (changing the template). Where to place the first code you gave?
Re: Frontend user (FEU) can not login
Code: Select all
{session_put var='detailurl' value=$cgsimple->self_url()}
It will capture the route URL and put in into a session var called 'detailurl'. You can then test for $detailurl in the summary template.
Re: Frontend user (FEU) can not login
Yes, the route URL will be different for every event which is what is captured by $cgsimple->self_url(). It gets the route URL as displayed in the browser for each event detail page.
Once saved, the 2nd part of the code will take the user back to the same event detail page they were on when they logged-in.
Once saved, the 2nd part of the code will take the user back to the same event detail page they were on when they logged-in.
Re: Frontend user (FEU) can not login
Hi Psy,
Thank you. I succesfully put
in my event detail template. (Couldn't make it work without the $ preceeder.
Now i tried to add
In the summary template (/kalender). Unfortunately this calls for the following error when calling for /kalender:
Thank you. I succesfully put
Code: Select all
{$session_put var='detailurl' value=$cgsimple->self_url()}
Now i tried to add
Code: Select all
{if
$ccuser->loggedin() and !empty($smarty.session.detailurl)}
{assign var='redirecturl' value=$smarty.session.detailurl}
{session_erase var='detailurl'}
{redirect url=$redirecturl}
{/if}
Do you have any suggestions on how to handle this?string(142) "Smarty error: [in module_db_tpl:EventsManager;summary_Custom line 5]: [plugin] unknown tag - 'session_erase' (core.load_plugins.php, line 198)" string(154) "Smarty error: [in module_db_tpl:EventsManager;summary_Custom line 5]: syntax error: unrecognized tag 'session_erase' (Smarty_Compiler.class.php, line 590)" string(137) "Smarty error: [in module_db_tpl:EventsManager;summary_Custom line 6]: [plugin] unknown tag - 'redirect' (core.load_plugins.php, line 198)" string(149) "Smarty error: [in module_db_tpl:EventsManager;summary_Custom line 6]: syntax error: unrecognized tag 'redirect' (Smarty_Compiler.class.php, line 590)"
Re: Frontend user (FEU) can not login
As mentioned in my original post with this method, you need CGExtensions and CGSimpleSmarty installed.
{$cgsimple->self_url()} , {session_erase} and {session_put} are CGSimpleSmarty tags.
{$cgsimple->self_url()} , {session_erase} and {session_put} are CGSimpleSmarty tags.
Re: Frontend user (FEU) can not login
Hi Psy,
Thank you for your answer and patience. I diden't read your post well enough.
I succesfully installed the CGSimpleSmarty module, added the code to the summary page /kalender and deleted the $ preceeder in your code for the detail event page.
When calling for /kalender, it generates the following faillure (with debugging on)
Do you have any suggestions?
Again, your help is very much appreciated. Thanks for that!
Thank you for your answer and patience. I diden't read your post well enough.
I succesfully installed the CGSimpleSmarty module, added the code to the summary page /kalender and deleted the $ preceeder in your code for the detail event page.
When calling for /kalender, it generates the following faillure (with debugging on)
I tried your code also with "redirect_url" instead of "redirect url" but that doesn't seem to work either.string(137) "Smarty error: [in module_db_tpl:EventsManager;summary_Custom line 5]: [plugin] unknown tag - 'redirect' (core.load_plugins.php, line 198)" string(149) "Smarty error: [in module_db_tpl:EventsManager;summary_Custom line 5]: syntax error: unrecognized tag 'redirect' (Smarty_Compiler.class.php, line 590)" Notice: Undefined index: ccuser in /home/vhosting/j/vhost0039238/domains/baukejonkmans.nl/htdocs/www/tmp/templates_c/EventsManager^%%30^30E^30E6A6B8%%module_db_tpl%3AEventsManager%3Bsummary_Custom.php on line 5 Fatal error: Call to a member function loggedin() on a non-object in /home/vhosting/j/vhost0039238/domains/baukejonkmans.nl/htdocs/www/tmp/templates_c/EventsManager^%%30^30E^30E6A6B8%%module_db_tpl%3AEventsManager%3Bsummary_Custom.php on line 5
Do you have any suggestions?
Again, your help is very much appreciated. Thanks for that!
Re: Frontend user (FEU) can not login
Oops, I should have checked Extensions->Tags to get the correct syntax which is:
{redirect_url to=$redirecturl}
Note: The $ sign is necessary to let Smarty know it's a var within a tag.
{redirect_url to=$redirecturl}
Note: The $ sign is necessary to let Smarty know it's a var within a tag.
Re: Frontend user (FEU) can not login
Hi Psy,
Thanks. I made the changes and there seems to happen something, thats possitive The other side is that there seems to be another faillure:
Thanks. I made the changes and there seems to happen something, thats possitive The other side is that there seems to be another faillure:
Does this sound familiar to you and do you know how I can fix it?Notice: Undefined index: ccuser in /home/vhosting/j/vhost0039238/domains/baukejonkmans.nl/htdocs/www/tmp/templates_c/EventsManager^%%30^30E^30E6A6B8%%module_db_tpl%3AEventsManager%3Bsummary_Custom.php on line 5 Fatal error: Call to a member function loggedin() on a non-object in /home/vhosting/j/vhost0039238/domains/baukejonkmans.nl/htdocs/www/tmp/templates_c/EventsManager^%%30^30E^30E6A6B8%%module_db_tpl%3AEventsManager%3Bsummary_Custom.php on line 5
Re: Frontend user (FEU) can not login
Doh! FrontEndUsers and CustomContent are so closely intertwined I forgot that they are separate modules. It's almost second nature to install both.
$ccuser is a CustomContent module object. Install the CustomContent module and read the help text.
Also check the FEU help.
$ccuser is a CustomContent module object. Install the CustomContent module and read the help text.
Also check the FEU help.