aboutsummaryrefslogtreecommitdiffstats
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
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
-rw-r--r--phpBB/includes/functions_user.php4
-rwxr-xr-xphpBB/install/install_install.php41
-rwxr-xr-xphpBB/install/install_main.php2
-rw-r--r--phpBB/language/en/common.php1
-rw-r--r--phpBB/language/en/posting.php1
5 files changed, 24 insertions, 25 deletions
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php
index 5574c85a5d..1bbeeff8bc 100644
--- a/phpBB/includes/functions_user.php
+++ b/phpBB/includes/functions_user.php
@@ -126,7 +126,7 @@ function user_add($user_row, $cp_data = false)
{
global $db, $config;
- if (empty($user_row['username']) || !isset($user_row['group_id']) || empty($user_row['user_email']) || !isset($user_row['user_type']))
+ if (empty($user_row['username']) || !isset($user_row['group_id']) || !isset($user_row['user_email']) || !isset($user_row['user_type']))
{
return false;
}
@@ -182,6 +182,8 @@ function user_add($user_row, $cp_data = false)
'user_sig' => '',
'user_sig_bbcode_uid' => '',
'user_sig_bbcode_bitfield' => 0,
+
+ 'user_rank' => 0,
);
// Now fill the sql array with not required variables
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',
diff --git a/phpBB/install/install_main.php b/phpBB/install/install_main.php
index d399c36ec1..1960db93c8 100755
--- a/phpBB/install/install_main.php
+++ b/phpBB/install/install_main.php
@@ -25,8 +25,8 @@ if (!empty($setmodules))
}
/**
-* @package install
* Main Tab - Installation
+* @package install
*/
class install_main extends module
{
diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php
index 9160a1e976..7f2f46f1b5 100644
--- a/phpBB/language/en/common.php
+++ b/phpBB/language/en/common.php
@@ -68,6 +68,7 @@ $lang = array_merge($lang, array(
'AVATAR_INVALID_FILENAME' => '%s is an invalid filename',
'AVATAR_NOT_UPLOADED' => 'Avatar could not be uploaded.',
'AVATAR_NO_SIZE' => 'Could not obtain width or height of linked avatar, please enter them manually.',
+ 'AVATAR_PARTIAL_UPLOAD' => 'The uploaded file was only partially uploaded',
'AVATAR_PHP_SIZE_NA' => 'The avatar\'s filesize is too large.<br />Could not determine the maximum size defined by PHP in php.ini.',
'AVATAR_PHP_SIZE_OVERRUN' => 'The avatar\'s filesize is too large, maximum upload size is %d MB.<br />Please note this is set in php.ini and cannot be overriden.',
'AVATAR_URL_INVALID' => 'The URL you specified is invalid.',
diff --git a/phpBB/language/en/posting.php b/phpBB/language/en/posting.php
index d7e196ebf8..1e24aebe8b 100644
--- a/phpBB/language/en/posting.php
+++ b/phpBB/language/en/posting.php
@@ -124,6 +124,7 @@ $lang = array_merge($lang, array(
'NO_POST' => 'The requested post does not exist.',
'NO_POST_MODE' => 'No post mode specified',
+ 'PARTIAL_UPLOAD' => 'The uploaded file was only partially uploaded',
'PHP_SIZE_NA' => 'The attachment\'s filesize is too large.<br />Could not determine the maximum size defined by PHP in php.ini.',
'PHP_SIZE_OVERRUN' => 'The attachment\'s filesize is too large, the maximum upload size is %d MB.<br />Please note this is set in php.ini and cannot be overriden.',
'PLACE_INLINE' => 'Place inline',