Welcome to Geeklog, Anonymous Friday, March 29 2024 @ 08:02 am EDT

Geeklog Forums

Automatically assigning users to different groups


Status: offline

chief123

Forum User
Chatty
Registered: 05/02/03
Posts: 58
I have searched, read, and tried to find the answer on my own but so far no luck.

What I want to do is to automatically assign certain users to certain groups without doing it manually.

So when Joe Regular User signs up he is assigned automatically as is now.

When Joe Special User signs up he is assigned automatically to a special group for special users or whatever.

If this functionality isn't currently available do any of you see workarounds to get close to what I need?

Thanks in advance.
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Such functionality is not currently available. The main reason being the question what makes Joe Special User so special (i.e. different from Joe Normal User) that he can be assigned to a certain group automatically?

Once you've figured that one out, you can write the code to do just that. The hooks (custom user registration) are all there ...

bye, Dirk
 Quote

Status: offline

rjrufo

Forum User
Regular Poster
Registered: 06/14/03
Posts: 95
I'm looking to do the same thing. Could (or should) I create a new table with the group assignments I'd like the new users to belong to, and have a drop down menu to have them select which group they want to join?

My idea is to have certain geographic locations, and have each new user select the appropriate location to where they live. That way, they can have the content delivered to them that pertains to their location, and not somewhere else.

Or is there a better way?
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Quote by rjrufo: My idea is to have certain geographic locations, and have each new user select the appropriate location to where they live.

Sounds pretty much like what this plugin does. It lets users choose which (regional) Mac user group they belong to.

bye, Dirk
 Quote

Status: offline

rjrufo

Forum User
Regular Poster
Registered: 06/14/03
Posts: 95
Thanks Dirk,

I was just looking at that when the notification of your reply came in. It will have to be modified to fit what I want to do, and I'll need to figure out how to implement it when new users sign up, but I think it's what I want.

Thanks again for your prompt reply. I'm beginning to wonder how you get anything done, other than replying to everything posted in the forums. It seems that every time I post something, you reply within minutes, regardless of the time of day. Could it be that you're a robot of some kind? If so, I sure can use you around here...
 Quote

Status: offline

rjrufo

Forum User
Regular Poster
Registered: 06/14/03
Posts: 95
Dirk,

I'm stumped. I'm trying to convert the check boxes from the MacIG plugin you referred to to a select list so that I can save screen space. I had it so that every location would show up in it's own select list, but I want all of them in one. I then broke the whole thing, and now have to revert back to the original code. The code I'm trying to modify - not break - is:
Text Formatted Code

/**
* Create a set of checkboxes with all available MacIG groups.
*/
function macig_makeSelection ($uid)
{
    global $_TABLES;

    $retval = '';

    $grplist = macig_getGroups ($uid);
    $macigs = macig_getAll ();

    foreach ($macigs as $name => $id) {
        $retval .= '<input type="checkbox" name="macig_group[]" value="'
                . $id . '"';
        if ($grplist[$name] == $id) {
            $retval .= ' checked="checked"';
        }
        $retval .= '>' . $name . '<br>' . LB;
    }

    return $retval;
}



 


Any ideas on what I need to do?

Can someone help me Maybe I shouldn't have addressed this to Dirk, but rather ask if anyone has any ideas. I'm sure Dirk has better things to do than to reply to my questions - even though it's usually within minutes that he gets back to me - which by the way, I really appreciate.
 Quote

Status: offline

rjrufo

Forum User
Regular Poster
Registered: 06/14/03
Posts: 95
Ok, maybe this wasn't the approriate topic to post my question. I worked on it some more, and got better results today. I posted a new topic with the code here.

Thanks.
 Quote

All times are EDT. The time is now 08:02 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content