View Full Version : Users being removed from Usergroups
Murty
10-10-2007, 06:11 AM
Hey guys,
I am having some problems with random users being removed from their usergroup.
Does anyone know why this might be happening?
Thanks
--------------- Added at 08:21 ---------------
I asked the same thing at vbulletin.com, and they said it is either a promotion thing or a modification i have installed.
I don't have any promotions setup so it must be a modification. Does anyone know of a mod that can cause this?
Murty
10-11-2007, 11:17 AM
Bump?
lolzers
10-11-2007, 11:17 AM
What mod's do you have installed?
Murty
10-11-2007, 11:35 AM
zoints local
post thank you hack
paypal donate
vbgooglemap member edition
user modlog
ip info
admin log in as user
vbdrupal
auto media embedding
email reminder for inactive users
nospam!
psistats
image resizer
time/days spent on board
prevent double posting
photoplog
multiple account login detector
yet another mass private message system
webtemplates
living avatars
proxy to real ip conversation
ajaxreg
make your forums speed seem faster
auto resize large images with img tag
check similar threads before posting
unactivated user management
bibliasoft
top statistic
log logins hack
advanced faq
quick news
fading pages
zoints staff private thread comment
And another custom mod made for me which "Associates custom profile fields with groups". But i have had that mod double checked for me to make sure it has no bugs, but i may have to get someone else to check it for me as well.
So yeah... any thoughts?
--------------- Added at 09:58 ---------------
Bump?
--------------- Added at 13:24 ---------------
Bump?
Marco van Herwaarden
10-12-2007, 06:06 AM
Impossible to say what is causing this.
Quicjest way to find out would be to disable all your modifications and see if it still happens.
Murty
10-12-2007, 10:15 AM
Yeah.
Do you know who i can contact about checking out a mod for me?
--------------- Added at 15:54 ---------------
Would there be anyone willing to take a look at the mod for me. I could give you a little bit of money if you want.
--------------- Added at 20:37 ---------------
Bump?
Murty
10-13-2007, 01:07 PM
Bump?
Lynne
10-13-2007, 03:36 PM
I would search through your mods for anything that has to do with a query to the user table and modifying either the usergroupid or membergroupid.
Murty
10-14-2007, 05:24 AM
Yeah I think i have found the mod that is causing the problem. But it was a custom made mod that someone made for me, and i cant get in contact with them at the moment. Is there someone that has any idea about coding and would be willing to take a look at the mod for me?
Thanks
Marco van Herwaarden
10-14-2007, 07:23 AM
Try posting the code here, and maybe someone has a solution for you.
Murty
10-14-2007, 07:27 AM
OK, well here is the code.
This is the .php file under /includes
<?php
foreach (explode(',',$userdata->fetch_field('membergroupids')) as $pg_group)
{
$pg_groupids[$pg_group] = $pg_group;
}
foreach (explode("\n",$vbulletin->options['profile_groups']) as $pg_triple)
{
list($pg_field,$pg_groupid,$pg_yes) = split(';',trim($pg_triple));
if ($pg_field and $pg_groupid)
{
if (!$pg_yes)
{
$pg_yes = 'Yes';
}
if ($userdata->userfield[$pg_field] == $pg_yes)
{
if (!($pg_groupids[$pg_groupid]))
{
$pg_groupids[$pg_groupid] = $pg_groupid;
}
}
else
{
if ($pg_groupids[$pg_groupid])
{
$pg_groupids[$pg_groupid] = 0;
}
}
}
}
foreach ($pg_groupids as $pg_groupid => $pg_value)
{
if ($pg_value == 0)
{
continue;
}
if ($pg_membergroups)
{
$pg_membergroups .= ',' . $pg_value;
}
else
{
$pg_membergroups = $pg_value;
}
}
$userdata->set('membergroupids', $pg_membergroups);
?>There are also some plugins and an admincp thing if you want them?
Murty
10-15-2007, 07:39 AM
I hate having to bump all the time, but i really need some help with this.
Thanks
Lynne
10-15-2007, 04:37 PM
It is sometimes hard to just jump in and 'read' someone else's code which is why you probably aren't getting a whole lot of help with this. Maybe explain what you are trying to do with that script and people can think about how they would go about it and then 'read' what the problems are with how you went about it.
Murty
10-15-2007, 11:36 PM
OK, fair enough.
Just to refresh peoples minds, my problem is that users are being removed from their usergroup randomly.
Well basically what this mod does is when a user registers, they select 'male' or 'female' (setup in 'user profile field manager'). Then depending whether they select 'male' or 'female' it puts them in the specified user group that I define.
There is an option in 'admincp' where i can define these settings.
This is what it looks like:
field5;9;Female
field5;10;Male
So 'field5' is the profile field; '9' or '10' are the usergroups; 'female' or 'male' are the options that the user can select at registration.
Note: the user can only select their gender AT registration, nowhere else.
There are also 2 plugins.
One has a hook in the 'register_addmember_process' location, with php code: require_once(DIR . '/includes/profile_groups.php');The other one has a hook in the 'profile_updateprofile' location, with the php code: require_once(DIR . '/includes/profile_groups.php');
(That "/includes/profile_groups.php" is the code a couple posts above.)
I'm not 100% sure, but I'm not sure if there should be a plugin at the 'profile_updateprofile' location...
Marco van Herwaarden
10-16-2007, 07:06 AM
That sounds like a logical explanation. If your members can only enter their gender at registration time, then there is no use to also run it when they update their profile. I can imagine that this automagically changes the usergroup.
But i guess this could be easy tested.
Murty
10-16-2007, 08:09 AM
Well i've turned it off, ill see how it goes.
Thanks for your advice marco.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.