1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-05-05 15:16:16 +02:00
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()
{
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'";
$result = $db->sql_query($sql);
@ -1723,6 +1723,11 @@ function add_bots()
'YahooSeeker [Bot]' => array('YahooSeeker/', ''),
);
if (!function_exists('user_add'))
{
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
}
foreach ($bots as $bot_name => $bot_ary)
{
$user_row = array(
@ -1739,18 +1744,21 @@ function add_bots()
'user_allow_massemail' => 0,
);
$user_id = $db->sql_nextid();
$user_id = user_add($user_row);
add_user_group($group_id, $user_id, false);
if ($user_id)
{
add_user_group($group_id, $user_id, false);
$sql = 'INSERT INTO ' . BOTS_TABLE . ' ' . $db->sql_build_array('INSERT', array(
'bot_active' => 1,
'bot_name' => $bot_name,
'user_id' => $user_id,
'bot_agent' => $bot_ary[0],
'bot_ip' => $bot_ary[1])
);
$db->sql_query($sql);
$sql = 'INSERT INTO ' . BOTS_TABLE . ' ' . $db->sql_build_array('INSERT', array(
'bot_active' => 1,
'bot_name' => $bot_name,
'user_id' => $user_id,
'bot_agent' => $bot_ary[0],
'bot_ip' => $bot_ary[1])
);
$db->sql_query($sql);
}
}
}