diff options
Diffstat (limited to 'phpBB/install')
-rw-r--r-- | phpBB/install/convertors/convert_phpbb20.php | 8 | ||||
-rw-r--r-- | phpBB/install/convertors/functions_phpbb20.php | 20 | ||||
-rw-r--r-- | phpBB/install/database_update.php | 5 | ||||
-rw-r--r-- | phpBB/install/install_convert.php | 43 | ||||
-rw-r--r-- | phpBB/install/schemas/mysql_40_schema.sql | 6 | ||||
-rw-r--r-- | phpBB/install/schemas/mysql_41_schema.sql | 6 | ||||
-rw-r--r-- | phpBB/install/schemas/oracle_schema.sql | 6 | ||||
-rw-r--r-- | phpBB/install/schemas/postgres_schema.sql | 6 | ||||
-rw-r--r-- | phpBB/install/schemas/sqlite_schema.sql | 6 |
9 files changed, 59 insertions, 47 deletions
diff --git a/phpBB/install/convertors/convert_phpbb20.php b/phpBB/install/convertors/convert_phpbb20.php index d2bec49982..92a0f24913 100644 --- a/phpBB/install/convertors/convert_phpbb20.php +++ b/phpBB/install/convertors/convert_phpbb20.php @@ -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( diff --git a/phpBB/install/convertors/functions_phpbb20.php b/phpBB/install/convertors/functions_phpbb20.php index 2f7edc18cd..b827c113b0 100644 --- a/phpBB/install/convertors/functions_phpbb20.php +++ b/phpBB/install/convertors/functions_phpbb20.php @@ -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'); } } } diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index a003254df3..90583c8a5a 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -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( diff --git a/phpBB/install/install_convert.php b/phpBB/install/install_convert.php index 03ed5d7f40..a4b5629596 100644 --- a/phpBB/install/install_convert.php +++ b/phpBB/install/install_convert.php @@ -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) { diff --git a/phpBB/install/schemas/mysql_40_schema.sql b/phpBB/install/schemas/mysql_40_schema.sql index 7ceacea8b9..545642ab74 100644 --- a/phpBB/install/schemas/mysql_40_schema.sql +++ b/phpBB/install/schemas/mysql_40_schema.sql @@ -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) diff --git a/phpBB/install/schemas/mysql_41_schema.sql b/phpBB/install/schemas/mysql_41_schema.sql index a34b478be1..05d81ab209 100644 --- a/phpBB/install/schemas/mysql_41_schema.sql +++ b/phpBB/install/schemas/mysql_41_schema.sql @@ -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) diff --git a/phpBB/install/schemas/oracle_schema.sql b/phpBB/install/schemas/oracle_schema.sql index a1d1e129e7..9f3d287e83 100644 --- a/phpBB/install/schemas/oracle_schema.sql +++ b/phpBB/install/schemas/oracle_schema.sql @@ -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) ) / diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql index a5a3a4b546..d0005a16a7 100644 --- a/phpBB/install/schemas/postgres_schema.sql +++ b/phpBB/install/schemas/postgres_schema.sql @@ -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) ); diff --git a/phpBB/install/schemas/sqlite_schema.sql b/phpBB/install/schemas/sqlite_schema.sql index d33f38b35a..184d2332ab 100644 --- a/phpBB/install/schemas/sqlite_schema.sql +++ b/phpBB/install/schemas/sqlite_schema.sql @@ -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); |