ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Some help getting started with member management

November 17, 2012 9:37am

Subscribe [3]
  • #1 / Nov 17, 2012 9:37am

    apfeiffer

    13 posts

    So, I’ve been away from EE for a while (doing mobile UX and design) and now I find myself needing to build a simple site for a freelance job I was silly enough to accept. Anyway, what I need to do is very simple but for some reason I can’t seem to find enough info in the User Guide to puzzle out how to do it. I tried searching the forums but couldn’t find anything relevant, if I missed a posting please feel free to send me the link.

    Here’s what I’m looking to do:

    There are 3 member groups for the site as well as the super admin group. Each of the 3 member groups have unique content (Safecracker forms used to track sales training - they check items off as they complete them). What I would like is for a user to log in and then be taken directly to the correct section of the site based on their login info. The super admin will work the same way except they will be taken to a page that shows a dashboard containing a report on the progress of members of the other 3 groups.

    How do I go about setting up a structure that allows me to redirect users based on their login? I’m familiar with setting up member groups, assigning privileges and using the login forms but I can’t figure out how to stitch it all together.  If there are any good tutorials our there please let me know. Also, would I be better off using an add-on such as Zoo’s Visitor or Solspace User? I’ve heard they simplify things quite a bit.

    Thanks.

  • #2 / Nov 17, 2012 11:03am

    apfeiffer

    13 posts

    I found an add-on called JC Redirect that looks as though it may do the trick. Only trouble is the instructions are pretty vague. Anybody have any experience with this add-on and know where to place the code to get it to work?

    JC Redirect

  • #3 / Nov 17, 2012 3:28pm

    jezpeters

    6 posts

    If I understand what you want correctly, one way to do it would be to upon a successful login, return the user to a template which has some logic within that redirects the user to the relevant page according to their member group.


    So for example:

    {if member_group == "2"}
    {redirect='blah/blah'}
    {if:else if member_group == "3"}
    {redirect='blah/blahblah'}
    {if:else}
    {redirect='blah/blahblahblah'}
    {/if}

    http://ellislab.com/expressionengine/user-guide/modules/member/index.html

  • #4 / Nov 18, 2012 12:19pm

    apfeiffer

    13 posts

    Jez,

    I thought that’s how I should do it as well but it doesn’t seem to work. My login form points to a template called gateway that has this code in it:

    {if group_id == "6"}
     {redirect="vce/vam"}
    {if:else if group_id == "7"}
     {redirect="vce/vpam"}
    {if:else}
     {redirect=""}
    {/if}

    All I get is a white page after logging in. However, if I remove the if:else if statement and just use this:

    {if group_id == "6"}
     {redirect="vce/vam"}
    {if:else}
     {redirect=""}
    {/if}

    then it works fine. I have no idea why it won’t work with the if:else if statement. [Bangs head against wall…]

  • #5 / Nov 18, 2012 1:59pm

    jezpeters

    6 posts

    Sorry my mistake - there shouldn’t be a space in the else if conditional:

    so

    {if:elseif…


    not

    {if:else if…

    http://ellislab.com/expressionengine/user-guide/templates/globals/conditionals.html

  • #6 / Nov 18, 2012 3:38pm

    apfeiffer

    13 posts

    Nothing to apologize for. I read the entire section in the user guide about conditionals after your post and still didn’t catch the typo. Thanks for the help. Admin, you an mark this post as resolved if you like.

  • #7 / Nov 20, 2012 12:03pm

    Shane Eckert

    7174 posts

    Hey there apfeiffer,

    I am glad that jezpeters was able to help out!

    If you need anything else, please just let me know by opening a new thread.

    Cheers,

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases