2009-08-02, 04:14 AM
2009-08-13, 07:01 PM
switch($db->type)
{
case "pgsql":
case "sqlite3":
case "sqlite2":
$query = $db->simple_select("users", "uid", "','||additionalgroups||',' LIKE '%,{$usergroup['gid']},%'");
break;
default:
$query = $db->simple_select("users", "uid", "CONCAT(',',additionalgroups,',') LIKE '%,{$usergroup['gid']},%'");
}
while($user = $db->fetch_array($query))
{
leave_usergroup($user['uid'], $usergroup['gid']);
}
I don't see anything wrong with that.
Ryan
2009-08-13, 10:22 PM
leave_usergroup()
Hmm..never noticed that function. I could use that in some of my plugins too.
Maybe the problem exists there.
Hmm..never noticed that function. I could use that in some of my plugins too.
function leave_usergroup($uid, $leavegroup)
{
global $db, $mybb, $cache;
if($uid == $mybb->user['uid'])
{
$user = $mybb->user;
}
else
{
$query = $db->simple_select("users", "*", "uid='".intval($uid)."'");
$user = $db->fetch_array($query);
}
$groupslist = "";
$usergroups = "";
$usergroups = $user['additionalgroups'].",";
$groups = explode(",", $user['additionalgroups']);
if(is_array($groups))
{
foreach($groups as $gid)
{
if(trim($gid) != "" && $leavegroup != $gid && !$donegroup[$gid])
{
$groupslist .= $comma.$gid;
$comma = ",";
$donegroup[$gid] = 1;
}
}
}
$dispupdate = "";
if($leavegroup == $user['displaygroup'])
{
$dispupdate = ", displaygroup=usergroup";
}
$db->write_query("
UPDATE ".TABLE_PREFIX."users
SET additionalgroups='$groupslist' $dispupdate
WHERE uid='".intval($uid)."'
");
$cache->update_moderators();
}
Maybe the problem exists there.
2009-08-13, 10:36 PM
I looked in there as well. I don't see any problems.
2009-08-13, 10:42 PM
Give SQA a chance to test this then.
2009-08-20, 06:47 PM
I cannot reproduce this issue. Marked as bogus.
2009-08-20, 06:56 PM
Well...I guess I will look into this more. Maybe it's another issue with using the upgrade package versus full version.