aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/install/install_install.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2006-06-13 18:32:48 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2006-06-13 18:32:48 +0000
commit81d7bbff36dc07dacbd663728a52ff5d5c4c30c9 (patch)
tree548a0469ac27a82109afbafd7cc8c45c25e2fcd5 /phpBB/install/install_install.php
parente1437d7a21e294b7531cbd6acd5b77814c82ec8b (diff)
downloadforums-81d7bbff36dc07dacbd663728a52ff5d5c4c30c9.tar
forums-81d7bbff36dc07dacbd663728a52ff5d5c4c30c9.tar.gz
forums-81d7bbff36dc07dacbd663728a52ff5d5c4c30c9.tar.bz2
forums-81d7bbff36dc07dacbd663728a52ff5d5c4c30c9.tar.xz
forums-81d7bbff36dc07dacbd663728a52ff5d5c4c30c9.zip
use user_add function for bot adding
git-svn-id: file:///svn/phpbb/trunk@6056 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/install/install_install.php')
-rwxr-xr-xphpBB/install/install_install.php41
1 files changed, 18 insertions, 23 deletions
diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php
index c4b548cd5f..fc0aa675aa 100755
--- a/phpBB/install/install_install.php
+++ b/phpBB/install/install_install.php
@@ -25,8 +25,8 @@ if (!empty($setmodules))
}
/**
-* @package install
* Installation
+* @package install
*/
class install_install extends module
{
@@ -1379,11 +1379,13 @@ class install_install extends module
*/
function add_bots($mode, $sub)
{
- global $db;
+ global $db, $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);
- $group_id = (int) $db->sql_fetchfield('group_id', 0, $result);
+ $group_id = (int) $db->sql_fetchfield('group_id');
$db->sql_freeresult($result);
if (!$group_id)
@@ -1392,39 +1394,32 @@ class install_install extends module
$this->p_master->error($lang['NO_GROUP'], __LINE__, __FILE__);
}
+ if (!function_exists('user_add'))
+ {
+ include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ }
+
foreach ($this->bot_list as $bot_name => $bot_ary)
{
- $sql = 'INSERT INTO ' . USERS_TABLE . ' ' . $db->sql_build_array('INSERT', array(
+ $user_row = array(
'user_type' => GROUP_HIDDEN,
'group_id' => $group_id,
'username' => $bot_name,
'user_regdate' => time(),
'user_password' => '',
- 'user_lang' => 'en',
- 'user_style' => 1,
- 'user_rank' => 0,
'user_colour' => '9E8DA7',
- ));
-
- $result = $db->sql_query($sql);
+ 'user_email' => ''
+ );
+
+ $user_id = user_add($user_row);
- if (!$result)
+ if (!$user_id)
{
// If we can't insert this user then continue to the next one to avoid inconsistant data
$this->p_master->db_error('Unable to insert bot into users table', $sql, __LINE__, __FILE__, true);
continue;
}
- $user_id = $db->sql_nextid();
-
- $sql = 'INSERT INTO ' . USER_GROUP_TABLE . ' ' . $db->sql_build_array('INSERT', array(
- 'group_id' => $group_id,
- 'user_id' => $user_id,
- 'group_leader' => 0,
- 'user_pending' => 0,
- ));
- $result = $db->sql_query($sql);
-
$sql = 'INSERT INTO ' . BOTS_TABLE . ' ' . $db->sql_build_array('INSERT', array(
'bot_active' => 1,
'bot_name' => $bot_name,
@@ -1770,7 +1765,7 @@ class install_install extends module
'COMMENTS' => 'remove_remarks'
),
'mssql' => array(
- 'LABEL' => 'MS SQL Server 7/2000',
+ 'LABEL' => 'MS SQL Server 2000+',
'SCHEMA' => 'mssql',
'MODULE' => 'mssql',
'DELIM' => 'GO',