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.

Assigning members (users) to member groups???

June 24, 2007 1:28pm

Subscribe [6]
  • #16 / Jun 29, 2007 1:40pm

    hothousegraphix

    851 posts

    I guess my question is here:

    foreach ($_POST as $key => $val)
            {        
            if (strstr($key, 'toggle') AND ! is_array($val))
            {                   
                if ($_POST['action'] == 'activate')
                {

    Which works fine off the “cp_members_validate_members” hook but seems not to with the
    “member_register_validate_members” hook.

    Is each page request accessed from the URL string provided in the member account activation e-mail considered a POST action? Please forgive my ignorance.

    How do I get at/determine what user is trying to activate their account. I assume the query for the users related information will remain the same as well as the switch logic I’m using. 

    In guessing, I’m thinking that it will be if…user has selected to activate account…do stuff. I’m stuck on how to construct the if statement?

    Could someone lend some advice?

    Thanks.

  • #17 / Jun 29, 2007 2:37pm

    hothousegraphix

    851 posts

    So…in looking more closely at mod.member_register.php…and where the hook “member_register_validate_members” falls…it seems EE goes thru a group reassignment process just prior to the hook bing called assigning self-activated users to whatever has been determined as being the default member group.

    Meaning that on self-activation the user will be placed into my sites default member group.
    So…instead of trying to figure out who is activating themselves..wouldn’t it make sense to simply run an evaluation of the user/s in my default member group.

    Something like:
    foreach(user who’s group_id == ‘default_member_group’)
    do my member_group reassignment?

    foreach('member_id'){
         if('group_id' == 'default_member_group');
         {
         do stuff
         }
    }

    Make sense?

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

ExpressionEngine News!

#eecms, #events, #releases