1

I'm trying to find what hook there is for immediately after the user logged in?

I've been looking at sessions_start and sessions_end but I'm not sure how exactly they work and nothing seems to be working the way I want it to, the docs arent the clearest.

Thanks.

1

member_member_login_start is what you're looking for

1
  • I decided to code it in a different way but I wanted a hook that would log them in first, then activate the hook. With member_member_login_start the user isn't logged in when the hook is activated. Thanks for your help though, appreciated. – Owen Kavanagh Sep 4 '13 at 15:58
0

What is it you are trying to do?

This may help. Download plugin ress and look at source code.

Edit: no, my mistake session_start is wrong hook. Sorry

Another suggestion, point return params of all login pages to an empty template where you run a plugin to test for T&C = done. If so, redirect here. If not, redirect there.

You can also use group_ids to redirect.

{exp:member:login_form return="template_group/my_login_redirect_template"}

For example

{if logged_in}
    {exp:my_login_plugin}
            {redirect='pages/terms_conditions'}
    {/exp:my_login_plugin}
{/if}

OR

{exp:switchee variable = "{group_id}" parse="inward"}

{case value="9"}
    {redirect='pages/terms_conditions'}
{/case}

{case value="6"}
    {redirect='template_name/member'}
{/case}

{case default="Yes"}
    {redirect='template_name/welcome'}
{/case}

{/exp:switchee}
4
  • When the user first logs in they need to agree to Terms and Conditions (accounts are made by the system so the user cant agree to these at registration). So I need to check if they've agreed to the T&Cs and redirect them accordingly straight after log in. – Owen Kavanagh Sep 3 '13 at 16:22
  • Ok, did you look at the source? Copy, rename to make your own plugin and just add a query in the session_start method to check if previously agreed to T&C – Lloyd Hill Sep 3 '13 at 16:41
  • I decided use a different method but thank you for your help. – Owen Kavanagh Sep 4 '13 at 15:55
  • Another solution to consider has been added – Lloyd Hill Sep 4 '13 at 20:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.