1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-11 11:13:59 +02:00

- some bugfixes

- bugfixes for the convertor (typecasting for example was totally broken)


git-svn-id: file:///svn/phpbb/trunk@6865 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen
2007-01-09 14:10:44 +00:00
parent 164fb66f44
commit 2b35b9d60d
15 changed files with 82 additions and 56 deletions

View File

@@ -390,6 +390,7 @@ if (!$get_info)
array('ban_ip', 'banlist.ban_ip', 'decode_ban_ip'),
array('ban_userid', 'banlist.ban_userid', 'phpbb_user_id'),
array('ban_email', 'banlist.ban_email', ''),
'where' => "banlist.ban_ip NOT LIKE '%.%'",
),
@@ -397,10 +398,11 @@ if (!$get_info)
array(
'target' => BANLIST_TABLE,
array('ban_email', 'banlist.ban_email', ''),
array('ban_userid', 'banlist.ban_userid', 'phpbb_user_id'),
array('ban_ip', 'banlist.ban_ip', ''),
array('ban_userid', '0', ''),
array('ban_email', '', ''),
'where' => "banlist.ban_ip = ''",
'where' => "banlist.ban_ip LIKE '%.%'",
),
array(

View File

@@ -749,7 +749,7 @@ function phpbb_convert_authentication($mode)
// We only check for ACL_YES equivalence entry
if (isset($access[$old_auth_key]) && $access[$old_auth_key] == 1)
{
mass_auth('group', $new_forum_id, $access['group_id'], $new_acl, ACL_YES);
mass_auth('group', $new_forum_id, (int) $access['group_id'], $new_acl, ACL_YES);
}
}
}
@@ -761,7 +761,7 @@ function phpbb_convert_authentication($mode)
// We only check for ACL_YES equivalence entry
if (isset($access[$old_auth_key]) && $access[$old_auth_key] == 1)
{
mass_auth('user', $new_forum_id, phpbb_user_id($access['user_id']), $new_acl, ACL_YES);
mass_auth('user', $new_forum_id, (int) phpbb_user_id($access['user_id']), $new_acl, ACL_YES);
}
}
}
@@ -776,7 +776,7 @@ function phpbb_convert_authentication($mode)
// We only check for ACL_YES equivalence entry
if (isset($access[$old_auth_key]) && $access[$old_auth_key] == 1)
{
mass_auth('group', $new_forum_id, $access['group_id'], $new_acl, ACL_YES);
mass_auth('group', $new_forum_id, (int) $access['group_id'], $new_acl, ACL_YES);
}
}
}
@@ -788,7 +788,7 @@ function phpbb_convert_authentication($mode)
// We only check for ACL_YES equivalence entry
if (isset($access[$old_auth_key]) && $access[$old_auth_key] == 1)
{
mass_auth('user', $new_forum_id, phpbb_user_id($access['user_id']), $new_acl, ACL_YES);
mass_auth('user', $new_forum_id, (int) phpbb_user_id($access['user_id']), $new_acl, ACL_YES);
}
}
}
@@ -820,7 +820,7 @@ function phpbb_convert_authentication($mode)
while ($row = $db->sql_fetchrow($result))
{
mass_auth('user_role', 0, phpbb_user_id($row['user_id']), 'USER_NOAVATAR');
mass_auth('user_role', 0, (int) phpbb_user_id($row['user_id']), 'USER_NOAVATAR');
}
$db->sql_freeresult($result);
@@ -832,7 +832,7 @@ function phpbb_convert_authentication($mode)
while ($row = $db->sql_fetchrow($result))
{
mass_auth('user_role', 0, phpbb_user_id($row['user_id']), 'USER_NOPM');
mass_auth('user_role', 0, (int) phpbb_user_id($row['user_id']), 'USER_NOPM');
}
$db->sql_freeresult($result);
}
@@ -848,8 +848,8 @@ function phpbb_convert_authentication($mode)
{
if (isset($access['auth_mod']) && $access['auth_mod'] == 1)
{
mass_auth('user_role', $forum_id, phpbb_user_id($access['user_id']), 'MOD_STANDARD');
mass_auth('user_role', $forum_id, phpbb_user_id($access['user_id']), 'FORUM_STANDARD');
mass_auth('user_role', $forum_id, (int) phpbb_user_id($access['user_id']), 'MOD_STANDARD');
mass_auth('user_role', $forum_id, (int) phpbb_user_id($access['user_id']), 'FORUM_STANDARD');
}
}
}
@@ -862,8 +862,8 @@ function phpbb_convert_authentication($mode)
{
if (isset($access['auth_mod']) && $access['auth_mod'] == 1)
{
mass_auth('group_role', $forum_id, $access['group_id'], 'MOD_STANDARD');
mass_auth('group_role', $forum_id, $access['group_id'], 'FORUM_STANDARD');
mass_auth('group_role', $forum_id, (int) $access['group_id'], 'MOD_STANDARD');
mass_auth('group_role', $forum_id, (int) $access['group_id'], 'FORUM_STANDARD');
}
}
}

View File

@@ -324,6 +324,11 @@ $database_update_info = array(
USERS_TABLE => array(
'user_options' => array('UINT:11', 895),
),
FORUMS_TABLE => array(
'prune_days' => array('UINT', 0),
'prune_viewed' => array('UINT', 0),
'prune_freq' => array('UINT', 0),
),
),
// Remove the following keys
'drop_keys' => array(

View File

@@ -479,6 +479,24 @@ class install_convert extends module
// @todo Need to confirm that max post length in source is <= max post length in destination or there may be interesting formatting issues
$config['max_post_chars'] = -1;
$convert->mysql_convert = false;
switch ($db->sql_layer)
{
// Thanks MySQL, for silently converting...
case 'mysql':
case 'mysql4':
if (version_compare($db->mysql_version, '4.1.3', '>='))
{
$convert->mysql_convert = true;
}
break;
case 'mysqli':
$convert->mysql_convert = true;
break;
}
// Set up a user as well. We _should_ have enough of a database here at this point to do this
// and it helps for any core code we call
$user->session_begin();
@@ -889,24 +907,6 @@ class install_convert extends module
$counting = -1;
$batch_time = 0;
$convert->mysql_convert = false;
switch ($db->sql_layer)
{
// Thanks MySQL, for silently converting...
case 'mysql':
case 'mysql4':
if (version_compare($db->mysql_version, '4.1.3', '>='))
{
$convert->mysql_convert = true;
}
break;
case 'mysqli':
$convert->mysql_convert = true;
break;
}
while (($counting === -1 || $counting >= $convert->batch_size) && still_on_time())
{
$old_current_table = $current_table;
@@ -1600,7 +1600,12 @@ class install_convert extends module
{
if (strpos($type, 'typecast') === 0)
{
$value = settype($value, $execution);
if (!is_array($value))
{
$value = array($value);
}
$value = $value[0];
settype($value, $execution);
}
else if (strpos($type, 'function') === 0)
{

View File

@@ -254,9 +254,9 @@ CREATE TABLE phpbb_forums (
enable_icons tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
enable_prune tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
prune_next int(11) UNSIGNED DEFAULT '0' NOT NULL,
prune_days tinyint(4) DEFAULT '0' NOT NULL,
prune_viewed tinyint(4) DEFAULT '0' NOT NULL,
prune_freq tinyint(4) DEFAULT '0' NOT NULL,
prune_days mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
prune_viewed mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
prune_freq mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
PRIMARY KEY (forum_id),
KEY left_right_id (left_id, right_id),
KEY forum_lastpost_id (forum_last_post_id)

View File

@@ -254,9 +254,9 @@ CREATE TABLE phpbb_forums (
enable_icons tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
enable_prune tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
prune_next int(11) UNSIGNED DEFAULT '0' NOT NULL,
prune_days tinyint(4) DEFAULT '0' NOT NULL,
prune_viewed tinyint(4) DEFAULT '0' NOT NULL,
prune_freq tinyint(4) DEFAULT '0' NOT NULL,
prune_days mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
prune_viewed mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
prune_freq mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
PRIMARY KEY (forum_id),
KEY left_right_id (left_id, right_id),
KEY forum_lastpost_id (forum_last_post_id)

View File

@@ -509,9 +509,9 @@ CREATE TABLE phpbb_forums (
enable_icons number(1) DEFAULT '1' NOT NULL,
enable_prune number(1) DEFAULT '0' NOT NULL,
prune_next number(11) DEFAULT '0' NOT NULL,
prune_days number(4) DEFAULT '0' NOT NULL,
prune_viewed number(4) DEFAULT '0' NOT NULL,
prune_freq number(4) DEFAULT '0' NOT NULL,
prune_days number(8) DEFAULT '0' NOT NULL,
prune_viewed number(8) DEFAULT '0' NOT NULL,
prune_freq number(8) DEFAULT '0' NOT NULL,
CONSTRAINT pk_phpbb_forums PRIMARY KEY (forum_id)
)
/

View File

@@ -386,9 +386,9 @@ CREATE TABLE phpbb_forums (
enable_icons INT2 DEFAULT '1' NOT NULL CHECK (enable_icons >= 0),
enable_prune INT2 DEFAULT '0' NOT NULL CHECK (enable_prune >= 0),
prune_next INT4 DEFAULT '0' NOT NULL CHECK (prune_next >= 0),
prune_days INT2 DEFAULT '0' NOT NULL,
prune_viewed INT2 DEFAULT '0' NOT NULL,
prune_freq INT2 DEFAULT '0' NOT NULL,
prune_days INT4 DEFAULT '0' NOT NULL CHECK (prune_days >= 0),
prune_viewed INT4 DEFAULT '0' NOT NULL CHECK (prune_viewed >= 0),
prune_freq INT4 DEFAULT '0' NOT NULL CHECK (prune_freq >= 0),
PRIMARY KEY (forum_id)
);

View File

@@ -247,9 +247,9 @@ CREATE TABLE phpbb_forums (
enable_icons INTEGER UNSIGNED NOT NULL DEFAULT '1',
enable_prune INTEGER UNSIGNED NOT NULL DEFAULT '0',
prune_next INTEGER UNSIGNED NOT NULL DEFAULT '0',
prune_days tinyint(4) NOT NULL DEFAULT '0',
prune_viewed tinyint(4) NOT NULL DEFAULT '0',
prune_freq tinyint(4) NOT NULL DEFAULT '0'
prune_days INTEGER UNSIGNED NOT NULL DEFAULT '0',
prune_viewed INTEGER UNSIGNED NOT NULL DEFAULT '0',
prune_freq INTEGER UNSIGNED NOT NULL DEFAULT '0'
);
CREATE INDEX phpbb_forums_left_right_id ON phpbb_forums (left_id, right_id);