Log in

View Full Version : How to assign usergroup to users from PHP?


Genent
10-22-2005, 09:25 PM
Hi,
I would like to do the following, but it's not exactly clear how (is there a better doc on Data Managers than on vbulletin.com?)

So basically we have a membership based paysite, and we are running a forum on a separate domain for our visitors.

Everyone can register on the forum for free, but we would like to give access to a few extra forums for the paysite members.

We have a completely separate user database for the forum and for the paysite.
On the paysite members will be able to give their forum username and password in their profile, and they should get VIP access to the special forums.

I made a usergroup called "VIP Member" on the forum, and I would like to automatically assign this usergroup to every user that provided his username/password on the paysite. (and remove them from this group when their paysite membership expires)

What I could figure out is that I should use data managers, but there is very little documentation on how to use usergroups for instance.

Marco van Herwaarden
10-23-2005, 06:13 AM
Why not use the standard vB Payed Subscriptions for this?

Genent
10-23-2005, 01:33 PM
Why not use the standard vB Payed Subscriptions for this?

Because we have a system already going on that can't be amended - are billing with other IPSPs, and our billing mechanism is way more complex.
The forum is an extra and represents 5% of the services - it's not the main feature - it should just be an amendment to our current services.

Genent
10-27-2005, 05:33 PM
No one is able to tell how to do this?

Paul M
10-27-2005, 06:19 PM
If you want the new group to be their primary group then just use a simple sql update query to set the value of usergroupid, for their record in the user table, to your desired value.

Genent
10-27-2005, 06:28 PM
If you want the new group to be their primary group then just use a simple sql update query to set the value of usergroupid, for their record in the user table, to your desired value.

Thank you Paul :)
And If i want to add them additional groups? we have multiple sites - and by subscribing to 2 sites gives them 2 extra group memberships - I guess this can't be done with primary groups

Paul M
10-27-2005, 07:09 PM
add them as a comma seperated list to the membergroupids field.

Genent
11-09-2005, 06:57 PM
add them as a comma seperated list to the membergroupids field.

Thank you it worked out this way :)