Log in

View Full Version : Switch Default User Groups?


AndreaBash
08-01-2003, 05:06 PM
I asked this over at vbulletin.com and they sent me over here. I'm just going to copy/paste what I posted there.
----

I did a search and didn't find a definite answer, so I'm asking again. Sorry if this has been asked.

I have 2 user groups. One is 'Registered' and the other only allows access to a single forum.

When a new user is approved, they are automatically tossed into 'Registered'. Is there a way to automatically put them into the other group instead? Basically I want the other group to be default (or at least selectable).

It seems like you should be able to choose the user group for the member you are approving, but that doesn't seem to be the case.

My other admins aren't familiar with changing user groups and they really want this feature to be automatic and I really don't want to take the time to set up an exact duplicate of 'Registered' then move all of my users over to it if I don't have to.

Make sense?

assassingod
08-01-2003, 05:32 PM
Alright, here is how I did it on my testboard (I had to turn off Verify Email address, but if its on I doubt there will be any problems)

Make a back-up of register.php if you use this - or test it on a testboard

Get the ID of the usergroup you want new users to be put into.

Open register.php

Find;

if ($verifyemail) {
$newusergroupid=3;
} else {
if ($moderatenewmembers or $coppauser) {
$newusergroupid=4;
} else {
$newusergroupid=2;
}
}


Change the 2 to the new usergroup ID.

Find:

(NULL, $userid, ".time().", '$activateid', 0, " . iif($newusergroupid == 4, 4, 2) . ")


Change the 2 to the new usergroup ID.

Find:

$usergroup=$DB_site->query_first("SELECT usertitle FROM usergroup WHERE usergroupid=2");


Change the 2 to the new usergroup ID.

That should work, as I said make a backup of register.php

AndreaBash
08-02-2003, 03:56 PM
Thank you so much! I will try it out today and let you know how it goes. :)

AndreaBash
08-02-2003, 10:00 PM
hmm... well. I am not sure if I'm missing something, but I made these 3 changes and new users are still getting added to the Registered group.

Is there another way to do this? Can I swap the registered ID number with the new group's ID?

assassingod
08-02-2003, 10:06 PM
Well I am not totally sure why it isn't working for you, it worked fine on my testboard.

Just a quick question, why dont you just edit the Registered usergroup?

AndreaBash
08-03-2003, 05:05 PM
I think I'm going to have to do that. I just didn't want to spend all that time creating a new group and moving all the settings over there... then changing the Registered group to be exactly the same as the other group... not if there was an easy way to just switch them. Ya know?

I'll just do it manually... cause I am spending more time trying to switch them than it would have taken me to just manually create new groups. :)

Thanks for your help!