PDA

View Full Version : [fixed] Usergroup ID/Title mismatch when moving after email/moderation subscription



Jet
Thu 13th Dec '01, 6:25am
Hi. I posted something about in HowdoI? forum a couple of days ago.
You can follow the entire story here (http://vbulletin.com/forum/showthread.php?s=&threadid=31105&perpage=30) ... :p

Hwr, the problem is: in my board I have both email verifying and admin moderation for new member subscriptions.
But the state of the user (title below nickname) doesn't correctly follow the usergroup, which instead changes correctly.

Group flow should be:
- 1st state (never displayed...) : usergroupid=1 - Not registered.
- 2nd state : usergroupid=3 - Awaiting email confirmation
- 3rd state : usergroupid=4 - Awaiting admin moderation (COPPA)
- 4rd state : usergroupid=2 - Registered member

Note: as said in the linked thread, COPPA is off but everything works correctly, at least groupid 'morphing'... :p

Usergroupid changes well during flow, instead the title always stay on 'Awaiting email confirmation', displayed this way even customtitle is always 0 !!! (verified by phpMyAdmin)
:confused:

I don't think the right way to do this is 'update counters (member titles)' each time, is it ? :eek:

Is this a bug or what ?
Could I fix meanwhile with a couple of instructions somewhere in register.php ?

Thanks a lot.
Please, needed an answer ASAP.
Bye.

Jet
Fri 14th Dec '01, 9:43am
Well. I think it should be A FINAL BUGFIX of the above problem.
I wrote with some difficulties but would share it with all of you, if someone need it.
If it's a real bugfix, after verifying it, please could Tubedogg or Firefly move it
to the right area, so something like could be inserted in the next VB official release ?
Thanks a lot.

Well.

In register.php should replace the lines:

if ($userinfo[coppauser] or ($moderatenewmembers and !$bbuserinfo['posts'])) {

// put user in moderated group
$DB_site->query("UPDATE user SET usergroupid=4 WHERE userid='$u'");

eval("standarderror(\"".gettemplate("error_moderateuser")."\");");
} else {
// activate account
$DB_site->query("UPDATE user SET usergroupid=2 WHERE userid='$u'");

$username=$userinfo[username];
eval("standarderror(\"".gettemplate("error_activatedthanks")."\");");
}


with:

if ($userinfo[coppauser] or ($moderatenewmembers and !$bbuserinfo['posts'])) {

// put user in moderated group
$nextugid=4;
$nextugrp=$DB_site->query_first("SELECT usertitle FROM usergroup WHERE usergroupid='$nextugid'");
$DB_site->query("UPDATE user SET usergroupid='$nextugid', usertitle='$nextugrp[usertitle]' WHERE userid='$u'");

eval("standarderror(\"".gettemplate("error_moderateuser")."\");");
} else {
// activate account
$nextugid=2;
$nextugrp=$DB_site->query_first("SELECT usertitle FROM usergroup WHERE usergroupid='$nextugid'");
$DB_site->query("UPDATE user SET usergroupid='$nextugid', usertitle='$nextugrp[usertitle]' WHERE userid='$u'");

$username=$userinfo[username];
eval("standarderror(\"".gettemplate("error_activatedthanks")."\");");
}



And in admin/user.php replace:

$DB_site->query("UPDATE user SET usergroupid=2 WHERE userid=$key");

with

$nextugid=2;
$nextugrp=$DB_site->query_first("SELECT usertitle FROM usergroup WHERE usergroupid='$nextugid'");
$DB_site->query("UPDATE user SET usergroupid='$nextugid',usertitle='$nextugrp[usertitle]',customtitle=0 WHERE userid=$key");


That's all, folks. :)
It simply updates the user table (single userid...)
with the correct usertitle near the target usergroup
where the userid is moved.

Thanks.

Jet
Sun 16th Dec '01, 9:39am
.

Pogo
Tue 4th Jun '02, 8:43pm
This problem still exists.

Burns
Sun 21st Jul '02, 4:03pm
I just had the same problem ( vB 2.2.6 ),
and it's really annoying since many users who see thier status still as "Awaiting Email Comfirmation",
will worry about it, will try to re-confirm, contact admin etc.

Jet, your fix is still working, great, thanks a lot.

Could someone move this thread in "vBulletin 2 Bug Reports" ?

Scott MacVicar
Sun 21st Jul '02, 7:30pm
The title should also update as soon as the user first posts, at least thats what happened on my test board. The usertitle was Awaiting Email Confirmation in the admin panel even though they were in the Registered Usergroup and as soon as I posted with that account is updated to Junior Member.

Steve_S
Mon 22nd Jul '02, 5:18am
BTW, In my 2.2.4 non hacked version I have a custom title below the member name for the group: Banned By Moderator which does not update properly which I believe is part of this bug. Yes, access masks are turned on.

HTH