git-svn-id: file:///svn/phpbb/trunk@6855 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen 2007-01-07 17:38:51 +00:00
parent 8f4c3a1fee
commit 29ef0fdb86

View file

@ -1648,7 +1648,7 @@ function add_default_groups()
*/ */
function add_bots() function add_bots()
{ {
global $db, $convert, $user, $config; global $db, $convert, $user, $config, $phpbb_root_path, $phpEx;
$sql = 'SELECT group_id FROM ' . GROUPS_TABLE . " WHERE group_name = 'BOTS'"; $sql = 'SELECT group_id FROM ' . GROUPS_TABLE . " WHERE group_name = 'BOTS'";
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
@ -1723,6 +1723,11 @@ function add_bots()
'YahooSeeker [Bot]' => array('YahooSeeker/', ''), 'YahooSeeker [Bot]' => array('YahooSeeker/', ''),
); );
if (!function_exists('user_add'))
{
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
}
foreach ($bots as $bot_name => $bot_ary) foreach ($bots as $bot_name => $bot_ary)
{ {
$user_row = array( $user_row = array(
@ -1739,8 +1744,10 @@ function add_bots()
'user_allow_massemail' => 0, 'user_allow_massemail' => 0,
); );
$user_id = $db->sql_nextid(); $user_id = user_add($user_row);
if ($user_id)
{
add_user_group($group_id, $user_id, false); add_user_group($group_id, $user_id, false);
$sql = 'INSERT INTO ' . BOTS_TABLE . ' ' . $db->sql_build_array('INSERT', array( $sql = 'INSERT INTO ' . BOTS_TABLE . ' ' . $db->sql_build_array('INSERT', array(
@ -1753,6 +1760,7 @@ function add_bots()
$db->sql_query($sql); $db->sql_query($sql);
} }
} }
}
/** /**
* Update any dynamic configuration variables after the conversion is finished * Update any dynamic configuration variables after the conversion is finished