From a2ab14d9d57005157d1a31a768ee833e11124159 Mon Sep 17 00:00:00 2001 From: juanse254 Date: Thu, 22 Mar 2018 19:40:08 +0100 Subject: [PATCH 1/5] [ticket/15594] Removed references to AOL and AIM as it is discontinued. Since AIM is not available anymore, AOL fields must be removed and redirected to profile. Also, a migration file was created for current users updating to 3.2.x. PHPBB3-15594 --- phpBB/docs/FAQ.html | 23 --- phpBB/install/convertors/convert_phpbb20.php | 1 - phpBB/install/schemas/schema_data.sql | 1 - .../data/v400/remove_profilefield_aol.php | 141 ++++++++++++++++++ 4 files changed, 141 insertions(+), 25 deletions(-) create mode 100644 phpBB/phpbb/db/migration/data/v400/remove_profilefield_aol.php diff --git a/phpBB/docs/FAQ.html b/phpBB/docs/FAQ.html index 5e0403e804..f8b93d55d4 100644 --- a/phpBB/docs/FAQ.html +++ b/phpBB/docs/FAQ.html @@ -60,7 +60,6 @@
  • According to viewonline a user is doing/reading something they should not be able to!
  • I keep getting Mail sending errors when I (or my users) post/send PM's/etc.!
  • My users are complaining that emails are not in their selected language!
  • -
  • My AOL based users keep getting logged out!
  • I am unable to upload avatars from my computer, regardless of the settings.
  • I just cannot get gallery avatars to appear!
  • How do I use/set permissions?
  • @@ -182,28 +181,6 @@ I want to sue you because i think you host an illegal board!
    -

    My AOL based users keep getting logged out!

    - -
    -
    - -
    - -

    phpBB uses sessions to keep track of users as they browse the board. These sessions use a combination of a unique session id, the users IP and if specified the users browser and/or the users x-forwarded-for header to identify each user. We make use of all of this as an extra safe-guard to help prevent sessions being hijacked (by discovering the unique session id).

    - -

    Unfortunately this only works when the users IP is constant as they browse the board. For most users this will be the case. However certain providers route their users via a cluster of proxys. In some cases, particularly the AOL browser, this results in different IPs being forwarded as the user moves between pages. We take account of this by not checking the entire IP by default but only the first "three quads" (A.B.C). Again in most cases this will be fine. However again AOL uses IPs which can vary so much that checking only the first two quads results in a fairly static IP being available for session validation.

    - -

    If you are experiencing problems related to this you can set the Session IP validation parameter found in Admin->General->Server Configuration->Security Settings to A.B. Please note that reducing the IP validation length does potentially increase the risk of sessions being hijacked (this is something for you to consider, phpBB Limited takes no responsibility should anything happen!). We suggest to at least additionally enable the browser validation.

    - -
    - - - -
    -
    - -
    -

    I am unable to upload avatars from my computer, regardless of the settings.

    diff --git a/phpBB/install/convertors/convert_phpbb20.php b/phpBB/install/convertors/convert_phpbb20.php index 994ef9b1a3..f98810baf9 100644 --- a/phpBB/install/convertors/convert_phpbb20.php +++ b/phpBB/install/convertors/convert_phpbb20.php @@ -963,7 +963,6 @@ if (!$get_info) array('pf_phpbb_location', 'users.user_from', array('function1' => 'phpbb_set_encoding')), array('pf_phpbb_icq', 'users.user_icq', array('function1' => 'phpbb_set_encoding')), array('pf_phpbb_yahoo', 'users.user_yim', array('function1' => 'phpbb_set_encoding')), - array('pf_phpbb_aol', 'users.user_aim', array('function1' => 'phpbb_set_encoding')), array('pf_phpbb_website', 'users.user_website', 'validate_website'), 'where' => 'users.user_id <> -1', diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index da7cad3915..5e41cde7d6 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -832,7 +832,6 @@ INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_len INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_website', 'profilefields.type.url', 'phpbb_website', '40', '12', '255', '', '', '', 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 2, 1, 'VISIT_WEBSITE', '%s'); INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_interests', 'profilefields.type.text', 'phpbb_interests', '3|30', '2', '500', '', '', '.*', 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, '', ''); INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_occupation', 'profilefields.type.text', 'phpbb_occupation', '3|30', '2', '500', '', '', '.*', 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 4, 0, '', ''); -INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_aol', 'profilefields.type.string', 'phpbb_aol', '40', '5', '255', '', '', '.*', 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 5, 1, '', ''); INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_icq', 'profilefields.type.string', 'phpbb_icq', '20', '3', '15', '', '', '[0-9]+', 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 6, 1, 'SEND_ICQ_MESSAGE', 'https://www.icq.com/people/%s/'); INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_yahoo', 'profilefields.type.string', 'phpbb_yahoo', '40', '5', '255', '', '', '.*', 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 8, 1, 'SEND_YIM_MESSAGE', 'ymsgr:sendim?%s'); INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_facebook', 'profilefields.type.string', 'phpbb_facebook', '20', '5', '50', '', '', '[\w.]+', 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 9, 1, 'VIEW_FACEBOOK_PROFILE', 'http://facebook.com/%s/'); diff --git a/phpBB/phpbb/db/migration/data/v400/remove_profilefield_aol.php b/phpBB/phpbb/db/migration/data/v400/remove_profilefield_aol.php new file mode 100644 index 0000000000..07c8a91b45 --- /dev/null +++ b/phpBB/phpbb/db/migration/data/v400/remove_profilefield_aol.php @@ -0,0 +1,141 @@ + + * @license GNU General Public License, version 2 (GPL-2.0) + * + * For full copyright and license information, please see + * the docs/CREDITS.txt file. + * + */ + +namespace phpbb\db\migration\data\v400; + +class remove_profilefield_aol extends \phpbb\db\migration\migration +{ + static public function depends_on() + { + return array( + '\phpbb\db\migration\data\v400\v400', + ); + } + + public function update_schema() + { + return array( + 'drop_columns' => array( + $this->table_prefix . 'profile_fields_data' => array( + 'pf_phpbb_aol', + ), + ), + ); + } + + public function revert_schema() + { + return array( + 'add_columns' => array( + $this->table_prefix . 'profile_fields_data' => array( + 'pf_phpbb_aol' => array('VCHAR', ''), + ), + ), + ); + } + + public function update_data() + { + return array( + array('custom', array(array($this, 'delete_custom_profile_field_data'))), + ); + } + + public function revert_data() + { + return array( + array('custom', array(array($this, 'create_custom_field'))), + ); + } + + public function delete_custom_profile_field_data() + { + $sql = 'SELECT field_id + FROM ' . PROFILE_FIELDS_TABLE . " + WHERE field_name = 'phpbb_aol'"; + $result = $this->db->sql_query($sql); + $field_id = (int) $this->db->sql_fetchfield('field_id'); + $this->db->sql_freeresult($result); + + $sql = 'DELETE FROM ' . PROFILE_FIELDS_TABLE . ' + WHERE field_id = ' . (int) $field_id; + $this->db->sql_query($sql); + + $sql = 'DELETE FROM ' . PROFILE_LANG_TABLE . ' + WHERE field_id = ' . (int) $field_id; + $this->db->sql_query($sql); + + $sql = 'DELETE FROM ' . PROFILE_FIELDS_LANG_TABLE . ' + WHERE field_id = ' . (int) $field_id; + $this->db->sql_query($sql); + } + + public function create_custom_field() + { + $sql = 'SELECT MAX(field_order) as max_field_order + FROM ' . PROFILE_FIELDS_TABLE; + $result = $this->db->sql_query($sql); + $max_field_order = (int) $this->db->sql_fetchfield('max_field_order'); + $this->db->sql_freeresult($result); + + $sql_ary = array( + 'field_name' => 'phpbb_aol', + 'field_type' => 'profilefields.type.string', + 'field_ident' => 'phpbb_aol', + 'field_length' => '40', + 'field_minlen' => '5', + 'field_maxlen' => '255', + 'field_novalue' => '', + 'field_default_value' => '', + 'field_validation' => '.*', + 'field_required' => 0, + 'field_show_novalue' => 0, + 'field_show_on_reg' => 0, + 'field_show_on_pm' => 1, + 'field_show_on_vt' => 1, + 'field_show_on_ml' => 0, + 'field_show_profile' => 1, + 'field_hide' => 0, + 'field_no_view' => 0, + 'field_active' => 1, + 'field_is_contact' => 1, + 'field_contact_desc' => '', + 'field_contact_url' => '', + 'field_order' => $max_field_order + 1, + ); + + $sql = 'INSERT INTO ' . PROFILE_FIELDS_TABLE . ' ' . $this->db->sql_build_array('INSERT', $sql_ary); + $this->db->sql_query($sql); + $field_id = (int) $this->db->sql_nextid(); + + $insert_buffer = new \phpbb\db\sql_insert_buffer($this->db, PROFILE_LANG_TABLE); + + $sql = 'SELECT lang_id + FROM ' . LANG_TABLE; + $result = $this->db->sql_query($sql); + $lang_name = 'AOL'; + while ($lang_id = (int) $this->db->sql_fetchfield('lang_id')) + { + $insert_buffer->insert(array( + 'field_id' => (int) $field_id, + 'lang_id' => (int) $lang_id, + 'lang_name' => $lang_name, + 'lang_explain' => '', + 'lang_default_value' => '', + )); + } + $this->db->sql_freeresult($result); + + $insert_buffer->flush(); + } +} From ca2a380d03049ad621ff16156a073e71b1e99603 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 30 Aug 2020 22:08:44 +0200 Subject: [PATCH 2/5] [ticket/15594] Move remove_profilefield_aol migration to v33x PHPBB3-15594 --- .../db/migration/data/{v400 => v33x}/remove_profilefield_aol.php | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename phpBB/phpbb/db/migration/data/{v400 => v33x}/remove_profilefield_aol.php (100%) diff --git a/phpBB/phpbb/db/migration/data/v400/remove_profilefield_aol.php b/phpBB/phpbb/db/migration/data/v33x/remove_profilefield_aol.php similarity index 100% rename from phpBB/phpbb/db/migration/data/v400/remove_profilefield_aol.php rename to phpBB/phpbb/db/migration/data/v33x/remove_profilefield_aol.php From 269f9251a2e3b2a5cb5575b21997a8d74f724f80 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 30 Aug 2020 22:12:03 +0200 Subject: [PATCH 3/5] [ticket/15594] Convert to short array syntax PHPBB3-15594 --- .../data/v33x/remove_profilefield_aol.php | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/phpBB/phpbb/db/migration/data/v33x/remove_profilefield_aol.php b/phpBB/phpbb/db/migration/data/v33x/remove_profilefield_aol.php index 07c8a91b45..3ae4ef9956 100644 --- a/phpBB/phpbb/db/migration/data/v33x/remove_profilefield_aol.php +++ b/phpBB/phpbb/db/migration/data/v33x/remove_profilefield_aol.php @@ -17,45 +17,45 @@ class remove_profilefield_aol extends \phpbb\db\migration\migration { static public function depends_on() { - return array( + return [ '\phpbb\db\migration\data\v400\v400', - ); + ]; } public function update_schema() { - return array( - 'drop_columns' => array( - $this->table_prefix . 'profile_fields_data' => array( + return [ + 'drop_columns' => [ + $this->table_prefix . 'profile_fields_data' => [ 'pf_phpbb_aol', - ), - ), - ); + ], + ], + ]; } public function revert_schema() { - return array( - 'add_columns' => array( - $this->table_prefix . 'profile_fields_data' => array( - 'pf_phpbb_aol' => array('VCHAR', ''), - ), - ), - ); + return [ + 'add_columns' => [ + $this->table_prefix . 'profile_fields_data' => [ + 'pf_phpbb_aol' => ['VCHAR', ''], + ], + ], + ]; } public function update_data() { - return array( - array('custom', array(array($this, 'delete_custom_profile_field_data'))), - ); + return [ + ['custom', [[$this, 'delete_custom_profile_field_data']]], + ]; } public function revert_data() { - return array( - array('custom', array(array($this, 'create_custom_field'))), - ); + return [ + ['custom', [[$this, 'create_custom_field']]], + ]; } public function delete_custom_profile_field_data() @@ -88,7 +88,7 @@ class remove_profilefield_aol extends \phpbb\db\migration\migration $max_field_order = (int) $this->db->sql_fetchfield('max_field_order'); $this->db->sql_freeresult($result); - $sql_ary = array( + $sql_ary = [ 'field_name' => 'phpbb_aol', 'field_type' => 'profilefields.type.string', 'field_ident' => 'phpbb_aol', @@ -112,7 +112,7 @@ class remove_profilefield_aol extends \phpbb\db\migration\migration 'field_contact_desc' => '', 'field_contact_url' => '', 'field_order' => $max_field_order + 1, - ); + ]; $sql = 'INSERT INTO ' . PROFILE_FIELDS_TABLE . ' ' . $this->db->sql_build_array('INSERT', $sql_ary); $this->db->sql_query($sql); @@ -126,13 +126,13 @@ class remove_profilefield_aol extends \phpbb\db\migration\migration $lang_name = 'AOL'; while ($lang_id = (int) $this->db->sql_fetchfield('lang_id')) { - $insert_buffer->insert(array( + $insert_buffer->insert([ 'field_id' => (int) $field_id, 'lang_id' => (int) $lang_id, 'lang_name' => $lang_name, 'lang_explain' => '', 'lang_default_value' => '', - )); + ]); } $this->db->sql_freeresult($result); From e56088f921d9a2bc8ba50102bc28bd3e397294c8 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 30 Aug 2020 22:14:56 +0200 Subject: [PATCH 4/5] [ticket/15594] Adjust depends_on and add effectively_installed check PHPBB3-15594 --- .../db/migration/data/v33x/remove_profilefield_aol.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/phpBB/phpbb/db/migration/data/v33x/remove_profilefield_aol.php b/phpBB/phpbb/db/migration/data/v33x/remove_profilefield_aol.php index 3ae4ef9956..207c4efe3f 100644 --- a/phpBB/phpbb/db/migration/data/v33x/remove_profilefield_aol.php +++ b/phpBB/phpbb/db/migration/data/v33x/remove_profilefield_aol.php @@ -15,10 +15,15 @@ namespace phpbb\db\migration\data\v400; class remove_profilefield_aol extends \phpbb\db\migration\migration { + public function effectively_installed() + { + return !$this->db_tools->sql_column_exists($this->table_prefix . 'profile_fields_data', 'pf_phpbb_aol'); + } + static public function depends_on() { return [ - '\phpbb\db\migration\data\v400\v400', + '\phpbb\db\migration\data\v33x\v331', ]; } From 4de62a3712124177a56773e141bc9e4329616b6e Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 10 Sep 2020 12:52:11 +0200 Subject: [PATCH 5/5] [ticket/15594] Use correct v33x namespace for migration PHPBB3-15594 --- phpBB/phpbb/db/migration/data/v33x/remove_profilefield_aol.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/phpbb/db/migration/data/v33x/remove_profilefield_aol.php b/phpBB/phpbb/db/migration/data/v33x/remove_profilefield_aol.php index 207c4efe3f..db2df684a2 100644 --- a/phpBB/phpbb/db/migration/data/v33x/remove_profilefield_aol.php +++ b/phpBB/phpbb/db/migration/data/v33x/remove_profilefield_aol.php @@ -11,7 +11,7 @@ * */ -namespace phpbb\db\migration\data\v400; +namespace phpbb\db\migration\data\v33x; class remove_profilefield_aol extends \phpbb\db\migration\migration {