diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2007-01-07 17:38:51 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2007-01-07 17:38:51 +0000 |
commit | 29ef0fdb86b3a9fb544d0e2d55d1af74bd2dbec8 (patch) | |
tree | d95cd83c81dd0173de48f2387c7db31b2c626cc6 /phpBB | |
parent | 8f4c3a1feeb04cc5b5a613472e14be1b98bf493c (diff) | |
download | forums-29ef0fdb86b3a9fb544d0e2d55d1af74bd2dbec8.tar forums-29ef0fdb86b3a9fb544d0e2d55d1af74bd2dbec8.tar.gz forums-29ef0fdb86b3a9fb544d0e2d55d1af74bd2dbec8.tar.bz2 forums-29ef0fdb86b3a9fb544d0e2d55d1af74bd2dbec8.tar.xz forums-29ef0fdb86b3a9fb544d0e2d55d1af74bd2dbec8.zip |
erm...
git-svn-id: file:///svn/phpbb/trunk@6855 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/includes/functions_convert.php | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/phpBB/includes/functions_convert.php b/phpBB/includes/functions_convert.php index 6968950cea..a356101e9a 100644 --- a/phpBB/includes/functions_convert.php +++ b/phpBB/includes/functions_convert.php @@ -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(); - - add_user_group($group_id, $user_id, false); + $user_id = user_add($user_row); - $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); + 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); + } } } |