Page MenuHomeIn-Portal Phabricator

INP-1915 - Add support for IPv6 addresses
Needs RevisionPublic

Authored by alex on Thu, Jul 10, 10:14 AM.

Details

Reviewers
erik
Test Plan

Test Plan

Part 1

  1. perform clean install
  2. execute tests from the other parts of the test plan
  3. perform upgrade
  4. execute tests from the other parts of the test plan

Part 2 - unit tests

  1. run these tests and confirm, that they've passed:
    • kUtilTest::testNetMatch
    • DebuggerUtilTest::testNetMatch

Part 3 - debug mode supports IPv4 and IPv6

  1. ensure that the IPv4 address you're using to access an In-Portal or a subnet it (IPv4 address) belongs to is listed in the $dbg_options['DBG_IP'] key of the /system/debug.php file
  2. open the website
  3. confirm that Debug Mode is enabled
  4. add $_SERVER['REMOTE_ADDR'] = '971a:6ff4:3fe8:ce27:7085:f498:fc5a:9895'; line at the beginning of the /core/kernel/startup.php file and save changes
  5. open the website
  6. confirm that Debug Mode is disabled
  7. replace the value of the $dbg_options['DBG_IP'] key (make a backup) in the /system/debug.php file into 971a:6ff4:3fe8:ce27:7085:f498:fc5a:9893 and save changes
  8. confirm that Debug Mode is disabled
  9. replace the value of the $dbg_options['DBG_IP'] key in the /system/debug.php file into 971a:6ff4:3fe8:ce27:7085:f498:fc5a:9893-971a:6ff4:3fe8:ce27:7085:f498:fc5a:9895 and save changes
  10. confirm that Debug Mode is enabled
  11. replace the value of the $dbg_options['DBG_IP'] key in the /system/debug.php file into 971a:6ff4:3fe8:ce27:7085:f498:fc5a:9893/64 and save changes
  12. confirm that Debug Mode is enabled
  13. replace the value of the $dbg_options['DBG_IP'] key in the /system/debug.php file into 971a:6ff4:3fe8:ce27:7085:f498:fc5a:9895 and save changes
  14. confirm that Debug Mode is enabled

Part 4 - form submissions

  1. login to the Admin Console
  2. go to the Website & ContentForms section
  3. create a form with any configuration (if you don't have any form already)
  4. go to the Website & ContentStructure & Data section
  5. create a section (category) with these properties (the any value means any value you want):
    • Section Title: any value
    • Parent Section: any value
    • Template: "Online Form :: /platform/designs/form"
    • Online Form: any non-empty value
  6. go to the Front-End
  7. open the above-created page
  8. submit the form (it's fine that you're stayed on the same page)
  9. go to the Admin Console
  10. go to the Website & ContentFormsyour form name section
  11. confirm, that:
    • just made form submission is shown in the grid
    • the IPv6 address of that record is shortened based on the available column width
  12. resize the column with an IP address so that "..." is no longer displayed
  13. confirm that the shown IP address matches IPv6 address from the /core/kernel/startup.php file
  14. open just made form submission for viewing
  15. confirm that the IP address of just made form submission matches IPv6 address from the /core/kernel/startup.php file

Part 5 - session

  1. login to the Admin Console
  2. go to the ConfigurationWebsiteAdvanced section
  3. enable the Track database changes to change log system setting and save changes
  4. logout
  5. login
  6. go to the database editor (e.g. phpMyAdmin)
  7. confirm that the value of the UserSessions.IpAddress column for your session matches IPv6 address from the /core/kernel/startup.php file
  8. go to the Admin Console
  9. go to the Logs & ReportsSession Log section
  10. confirm, that:
    • session log record of the current session is shown in the grid
    • the IPv6 address of that record is shortened based on the available column width
  11. resize the column with an IP address so that "..." is no longer displayed
  12. confirm that the shown IP address matches IPv6 address from the /core/kernel/startup.php file

Part 6 - adding user

  1. login to the Admin Console
  2. go to the User ManagementUsers section
  3. show the IP Address column in the grid
  4. add a new user
  5. confirm, that:
    • user was created
    • just added user is shown in the grid
    • the IPv6 address of that record is shortened based on the available column width
  6. resize the column with an IP address so that "..." is no longer displayed
  7. confirm that the shown IP address matches IPv6 address from the /core/kernel/startup.php file
  8. open just added user for editing
  9. confirm that IP address of just added user matches IPv6 address from the /core/kernel/startup.php file

Part 7 - phrases

  1. login to the Admin Console
  2. go to the Website & ContentLabels & Phrases section
  3. change translation of any phrase (remember its label)
  4. confirm that changes were saved to the database
  5. go to the database editor (e.g. phpMyAdmin)
  6. confirm that the value of the LanguageLabels.LastChangeIP column for the changed phrase matches IPv6 address from the /core/kernel/startup.php file

Part 8 - system log

  1. login to the Admin Console
  2. make sure, that Debug Mode is enabled
  3. go to the User ManagementUsers section
  4. open the new user creation popup
  5. press the Save button without filling-in any of the required fields
  6. confirm, that you'll see a validation error
  7. close the new user creation popup
  8. go to the Logs & ReportsSystem Log section
  9. confirm, that:
    • a record about a validation error is shown in the grid
    • the IPv6 address of that record is shortened based on the available column width
  10. resize the column with an IP address so that "..." is no longer displayed
  11. confirm that the shown IP address matches IPv6 address from the /core/kernel/startup.php file
  12. open that record for viewing
  13. confirm, that IP address of that record IPv6 address from the /core/kernel/startup.php file

Part 9 - catalog ratings, reviews & spam control

  1. login to the Admin Console
  2. go to the Website & ContentStructure & DataDirectory section (you should be on the Sections tab)
  3. create a Sub Directory subsection
  4. go to the Website & ContentStructure & DataDirectorySub Directory section (you should be on the Links tab)
  5. create a new link in the Active status
  6. login to the Front-End
  7. navigate to the created link detail page
  8. rate that link (adds rating)
  9. comment on that link (adds review)
  10. go to the database editor (e.g. phpMyAdmin)
  11. confirm that the value of the CatalogRatings.IPAddress column for added rating matches IPv6 address from the /core/kernel/startup.php file
  12. confirm that the value of the SpamControl.IPaddress column for added rating matches IPv6 address from the /core/kernel/startup.php file
  13. confirm that the value of the CatalogReviews.IPAddress column for added comment matches IPv6 address from the /core/kernel/startup.php file
  14. confirm that the value of the SpamControl.IPaddress column for added comment matches IPv6 address from the /core/kernel/startup.php file

Part 10 - user visits (require In-Commerce)

  1. login to the Admin Console
  2. go to the ConfigurationWebsiteAdvanced section
  3. enable the Use Visitor Tracking system setting and save changes
  4. go to the Front-End
  5. logout (if you're logged in)
  6. login
  7. go to the Admin Console
  8. go to the ConfigurationWebsiteModules section
  9. disable the In-Commerce module
  10. go to the Logs & ReportsVisitor Log section
  11. confirm, that:
    • at least 2 records are present (one for Guest user and one for user you've used to login on the Front-End)
    • the IPv6 addresses of these records are shortened based on the available column width
  12. resize the column with an IP address so that "..." is no longer displayed
  13. confirm that shown IP addresses matches IPv6 address from the /core/kernel/startup.php file
  14. go to the ConfigurationWebsiteModules section
  15. enable the In-Commerce module
  16. go to the Logs & ReportsVisitor Log section
  17. confirm, that:
    • at least 2 records are present (one for the Guest user and one for the user you've used to log in on the Front-End)
    • the IPv6 addresses of these records are shortened based on the available column width
  18. resize the column with an IP address so that "..." is no longer displayed
  19. confirm that shown IP addresses matches IPv6 address from the /core/kernel/startup.php file

Part 11 - polls (require In-Bulletin)

NOTE: Apply the D527 before testing this.
  1. login to the Admin Console
  2. go to the Website & ContentPolls section
  3. create a poll with 2 answers
  4. go to the Front-End
  5. go to the page for the Forums section (category)
  6. click on the Add Comment link below the above-created poll
  7. add a comment
  8. go to the database editor (e.g. phpMyAdmin)
  9. confirm, that:
    1. a record in the PollsComments table was created for your poll comment
    2. the value of the PollsComments.UserIP column for your poll comment matches IPv6 address from the /core/kernel/startup.php file
  10. close the modal window
  11. vote on any of the poll answers
  12. go to the database editor (e.g. phpMyAdmin)
  13. confirm, that:
    1. a record in the PollsStatistics table was created for your poll vote
    2. the value of the PollsStatistics.UserIP column for your poll vote matches IPv6 address from the /core/kernel/startup.php file

Part 12 - topic posts (require In-Bulletin)

  1. login to the Admin Console
  2. go to the Website & ContentStructure & DataForums section (you should be on the Topics tab)
  3. switch to the Sections tab
  4. create a new section
  5. login to the Front-End
  6. go to the above-created category
  7. use the New Topic link in the sidebar to create a new topic
  8. go to the database editor (e.g. phpMyAdmin)
  9. confirm, that:
    1. the record for just created post (creating a topic also created a first post in it) exists
    2. the value of the Posting.IPAddress column for your post matches IPv6 address from the /core/kernel/startup.php file

Part 13 - misc

  • login to the Admin Console
    1. go to the ConfigurationWebsiteSite Domains section
    2. click on the Add toolbar button
    3. scroll down to the Range of IPs field
    4. confirm, that Range of IPs field tooltip contains examples with IPv4 and IPv6 addresses
  • in the IDE:
    1. open the /core/kernel/utility/temp_handler.php file
    2. add the die('testing'); to the beginning of the kTempTablesHandler::DoCopyTempToOriginal method
    3. save changes
  • in the Admin Console
    1. fill in required fields to create a site domain
    2. click on the Save toolbar button
    3. confirm that you're seeing testing text and a modal/popup window wasn't closed
  • go to the database editor (e.g. phpMyAdmin)
  • confirm, that:
    1. the record for just to-be-created site domain exists in the Semaphores table
    2. the value of the Semaphores.IpAddress column for the above-created record matches IPv6 address from the /core/kernel/startup.php file
  • revert changes made to the /core/kernel/utility/temp_handler.php file

Part 14 - downlodable product & orders (require In-Commerce)

  1. login to the Admin Console
  2. go to the Website & ContentStructure & DataProducts section (you should be on the Products tab)
  3. switch to the Sections tab
  4. add a Sub Products section (category)
  5. go to the Website & ContentStructure & DataProductsSub Products section (you should be on the Products tab)
  6. create a downloadable product in Active status with 1 file in it
  7. login to the Front-End
  8. go to the Products > Sub Products category and buy the above-created product
  9. go to the Admin Console
  10. go to the {anv E-commerce > Orders} section (you should be on the Pending tab)
  11. open just submitted sales order for editing
  12. confirm, that on the General tab:
    • you're seeing an IP address
    • the shown IP address matches IPv6 address from the /core/kernel/startup.php file
  13. close sales order editing modal/popup window
  14. select just submitted sales order
  15. click on the Approve toolbar button
  16. confirm that the sales order is longer shown in the Pending orders grid
  17. go to the Front-End
  18. click on the My Downloads link in the side bar
  19. click the Download Now toolbar button
  20. go to the Admin Console
  21. go to the {anv Logs & Reports > Download Log} section
  22. confirm, that:
    • a record for a just downloaded file exists
    • the IPv6 address of that record is shortened based on the available column width
  23. resize the column with an IP address so that "..." is no longer displayed
  24. confirm that the shown IP address matches IPv6 address from the /core/kernel/startup.php file

Diff Detail

Repository
rINP In-Portal
Branch
/in-portal/branches/5.2.x
Lint
Lint ErrorsExcuse: Unrelated
SeverityLocationCodeMessage
Errorcore/tests/Unit/kernel/kUtilTest.php:4PHPCS.E.Squiz.Classes.ValidClassName.NotCamelCapsSquiz.Classes.ValidClassName.NotCamelCaps
Errorcore/units/forms/form_submissions/form_submissions_config.php:125PHPCS.E.CodingStandard.Arrays.Array.SpaceAfterKeywordCodingStandard.Arrays.Array.SpaceAfterKeyword
Errorcore/units/forms/form_submissions/form_submissions_config.php:125PHPCS.E.Generic.PHP.LowerCaseKeyword.FoundGeneric.PHP.LowerCaseKeyword.Found
Errorcore/units/forms/form_submissions/form_submissions_config.php:126PHPCS.E.CodingStandard.Arrays.Array.SpaceAfterKeywordCodingStandard.Arrays.Array.SpaceAfterKeyword
Errorcore/units/forms/form_submissions/form_submissions_config.php:126PHPCS.E.Generic.PHP.LowerCaseKeyword.FoundGeneric.PHP.LowerCaseKeyword.Found
Errorcore/units/forms/form_submissions/form_submissions_config.php:127PHPCS.E.CodingStandard.Arrays.Array.SpaceAfterKeywordCodingStandard.Arrays.Array.SpaceAfterKeyword
Errorcore/units/forms/form_submissions/form_submissions_config.php:127PHPCS.E.Generic.PHP.LowerCaseConstant.FoundGeneric.PHP.LowerCaseConstant.Found
Errorcore/units/forms/form_submissions/form_submissions_config.php:127PHPCS.E.Generic.PHP.LowerCaseKeyword.FoundGeneric.PHP.LowerCaseKeyword.Found
Errorcore/units/logs/session_logs/session_logs_config.php:122PHPCS.E.CodingStandard.Arrays.Array.SpaceAfterKeywordCodingStandard.Arrays.Array.SpaceAfterKeyword
Errorcore/units/logs/session_logs/session_logs_config.php:122PHPCS.E.Generic.PHP.LowerCaseConstant.FoundGeneric.PHP.LowerCaseConstant.Found
Errorcore/units/logs/session_logs/session_logs_config.php:122PHPCS.E.Generic.PHP.LowerCaseKeyword.FoundGeneric.PHP.LowerCaseKeyword.Found
Errorcore/units/logs/session_logs/session_logs_config.php:123PHPCS.E.CodingStandard.Arrays.Array.SpaceAfterKeywordCodingStandard.Arrays.Array.SpaceAfterKeyword
Errorcore/units/logs/session_logs/session_logs_config.php:123PHPCS.E.Generic.PHP.LowerCaseKeyword.FoundGeneric.PHP.LowerCaseKeyword.Found
Errorcore/units/logs/session_logs/session_logs_config.php:124PHPCS.E.CodingStandard.Arrays.Array.SpaceAfterKeywordCodingStandard.Arrays.Array.SpaceAfterKeyword
Errorcore/units/logs/session_logs/session_logs_config.php:124PHPCS.E.Generic.PHP.LowerCaseKeyword.FoundGeneric.PHP.LowerCaseKeyword.Found
Errorcore/units/logs/system_logs/system_logs_config.php:154PHPCS.E.CodingStandard.Arrays.Array.SpaceAfterKeywordCodingStandard.Arrays.Array.SpaceAfterKeyword
Errorcore/units/logs/system_logs/system_logs_config.php:154PHPCS.E.Generic.PHP.LowerCaseKeyword.FoundGeneric.PHP.LowerCaseKeyword.Found
Errorcore/units/logs/system_logs/system_logs_config.php:155PHPCS.E.CodingStandard.Arrays.Array.SpaceAfterKeywordCodingStandard.Arrays.Array.SpaceAfterKeyword
Errorcore/units/logs/system_logs/system_logs_config.php:155PHPCS.E.Generic.PHP.LowerCaseKeyword.FoundGeneric.PHP.LowerCaseKeyword.Found
Errorcore/units/phrases/phrases_config.php:127PHPCS.E.CodingStandard.Arrays.Array.SpaceAfterKeywordCodingStandard.Arrays.Array.SpaceAfterKeyword
Errorcore/units/phrases/phrases_config.php:127PHPCS.E.Generic.PHP.LowerCaseConstant.FoundGeneric.PHP.LowerCaseConstant.Found
Errorcore/units/phrases/phrases_config.php:127PHPCS.E.Generic.PHP.LowerCaseKeyword.FoundGeneric.PHP.LowerCaseKeyword.Found
Errorcore/units/phrases/phrases_config.php:128PHPCS.E.CodingStandard.Arrays.Array.SpaceAfterKeywordCodingStandard.Arrays.Array.SpaceAfterKeyword
Errorcore/units/phrases/phrases_config.php:128PHPCS.E.Generic.PHP.LowerCaseKeyword.FoundGeneric.PHP.LowerCaseKeyword.Found
Errorcore/units/phrases/phrases_config.php:129PHPCS.E.Generic.PHP.LowerCaseKeyword.FoundGeneric.PHP.LowerCaseKeyword.Found
Unit
No Unit Test Coverage
Build Status
Buildable 11098
Build 3798: arc lint + arc unit

Event Timeline

alex created this revision.Thu, Jul 10, 10:14 AM
alex requested review of this revision.Thu, Jul 10, 10:14 AM
alex edited the test plan for this revision. (Show Details)Thu, Jul 10, 10:21 AM
alex updated this revision to Diff 1352.Thu, Jul 10, 12:41 PM

Use www.in-portal.org domain for testing instead of www.google.com to avoid Anycast DNS issues (random IP address returned on each DNS query).

erik requested changes to this revision.Fri, Jul 11, 6:55 AM

After clean install:

2.1 kUtilTest::testNetMatch test, 2 tests failed

name: www.in-portal.org; actual: 69.27.40.110
This test printed output: name: www.in-portal.org; actual: 69.27.40.110

name: www.yahoo.com; actual: 188.125.94.204
This test printed output: name: www.yahoo.com; actual: 188.125.94.204

4.1. "Online Form: any non-empty value" - maybe, test plan must contain note, that "Admin Console Interface" must be in advanced mode. Without that "Online Form" field is not visible

5.5. enable the Track database changes to change log system setting and save changes - does not work "Save" button in the Advanced configuration section (in General - works good). "1" value was set through phpMyAdmin

5.12. confirm that the shown IP address matches IPv6 address from the /core/kernel/startup.php file - shown ip does not match, there is shown truncated value "971a:6ff4:3fe8: " in the session log grid, UserSessionLogs.IP is varchar(15) in DB after clean install (not after upgrade)

14.16 "confirm that the sales order is longer shown in the Pending orders grid" - maybe, need fix test instruction - order record is disappeared from pending section

14.19 "click the Download Now toolbar button" - downloaded file has empty content (zero size file)

after upgrade

same issues as after clean install, but

5.12. confirm that the shown IP address matches IPv6 address from the /core/kernel/startup.php file - works good.

This revision now requires changes to proceed.Fri, Jul 11, 6:55 AM