mirror of
https://github.com/phpbb/phpbb.git
synced 2025-05-05 23:25:30 +02:00
Changed the way we assemble user_group entries during cross-DB conversion. The old way produced many invalid entries for admins.
git-svn-id: file:///svn/phpbb/trunk@7662 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
34f183217b
commit
648399cff3
@ -1137,21 +1137,12 @@ function user_group_auth($group, $select_query, $use_src_db)
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = $src_db->sql_query(str_replace('{' . strtoupper($group) . '}', $group_id . ', 0', $select_query));
|
||||
$result = $src_db->sql_query(str_replace('{' . strtoupper($group) . '}', $group_id . ' ', $select_query));
|
||||
while ($row = $src_db->sql_fetchrow($result))
|
||||
{
|
||||
// make sure it's exactly 3 ints that were returned
|
||||
$data = array();
|
||||
reset($row);
|
||||
for ($i = 0; $i < 3; $i++)
|
||||
{
|
||||
$data[] = (int) current($row);
|
||||
next($row);
|
||||
}
|
||||
|
||||
// this might become quite a lot of INSERTS unfortunately
|
||||
$sql = 'INSERT INTO ' . USER_GROUP_TABLE . ' (user_id, group_id, user_pending)
|
||||
VALUES (' . implode(', ', $data) . ')';
|
||||
$sql = 'INSERT INTO ' . USER_GROUP_TABLE . " (user_id, group_id, user_pending)
|
||||
VALUES ({$row['user_id']}, $group_id, 0)";
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
$src_db->sql_freeresult($result);
|
||||
|
Loading…
x
Reference in New Issue
Block a user