1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-12 11:44:08 +02:00

- fixed bug within the database update script

- #6254
- #6242
- #6184
- #6160
- #6020


git-svn-id: file:///svn/phpbb/trunk@6770 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen
2006-12-15 14:54:52 +00:00
parent 11e70be6ed
commit 2e4cd16058
7 changed files with 27 additions and 14 deletions

View File

@@ -206,7 +206,7 @@ class acp_bots
}
else if ($bot_id)
{
$sql = 'SELECT user_id
$sql = 'SELECT user_id, bot_name
FROM ' . BOTS_TABLE . "
WHERE bot_id = $bot_id";
$result = $db->sql_query($sql);
@@ -218,10 +218,18 @@ class acp_bots
trigger_error($user->lang['NO_BOT'] . adm_back_link($this->u_action . "&id=$bot_id&action=$action"), E_USER_WARNING);
}
$sql = 'UPDATE ' . USERS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', array(
$sql_ary = array(
'user_style' => (int) $bot_row['bot_style'],
'user_lang' => (string) $bot_row['bot_lang'])
) . " WHERE user_id = {$row['user_id']}";
'user_lang' => (string) $bot_row['bot_lang'],
);
if ($bot_row['bot_name'] !== $row['bot_name'])
{
$sql_ary['username'] = (string) $bot_row['bot_name'];
$sql_ary['username_clean'] = (string) utf8_clean_string($bot_row['bot_name']);
}
$sql = 'UPDATE ' . USERS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " WHERE user_id = {$row['user_id']}";
$db->sql_query($sql);
$sql = 'UPDATE ' . BOTS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', array(
@@ -232,6 +240,12 @@ class acp_bots
) . " WHERE bot_id = $bot_id";
$db->sql_query($sql);
// Updated username?
if ($bot_row['bot_name'] !== $row['bot_name'])
{
user_update_name($row['bot_name'], $bot_row['bot_name']);
}
$log = 'UPDATED';
}