mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00: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
1 changed files with 3 additions and 12 deletions
|
@ -1137,21 +1137,12 @@ function user_group_auth($group, $select_query, $use_src_db)
|
||||||
}
|
}
|
||||||
else
|
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))
|
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
|
// this might become quite a lot of INSERTS unfortunately
|
||||||
$sql = 'INSERT INTO ' . USER_GROUP_TABLE . ' (user_id, group_id, user_pending)
|
$sql = 'INSERT INTO ' . USER_GROUP_TABLE . " (user_id, group_id, user_pending)
|
||||||
VALUES (' . implode(', ', $data) . ')';
|
VALUES ({$row['user_id']}, $group_id, 0)";
|
||||||
$db->sql_query($sql);
|
$db->sql_query($sql);
|
||||||
}
|
}
|
||||||
$src_db->sql_freeresult($result);
|
$src_db->sql_freeresult($result);
|
||||||
|
|
Loading…
Add table
Reference in a new issue