? Success

User tests: Successful: Unsuccessful:

avatar jo-sf
jo-sf
9 Aug 2016

Login and Logout form actions set to "index.php", in doing so undoing the change made Dec 8, 2014.

Reason for this change is that JRoute::_() doesn't honor the third parameter (the "usesecure" flag) when a complete URL is passed, this is due to the following lines in that method:

if (!is_array($url) && (strpos($url, '&') !== 0) && (strpos($url, 'index.php') !== 0))
{
        return $url;
}

Assume that http://www.example.org/index.php is the current URL which is passed as a string as first parameter to JRoute::_(). A string is not an array, there is no "&" in the string (so strpos() returns false which is not identical to "0") and the substring "index.php" doesn't start at position 0 in the string. Therefore the given URL is returned without any modifications, here: no changing of the scheme to HTTPS if the flag "usesecure" is set.

It is no problem to pass simply "index.php" here as action since the real target after logging in is passed in the hidden field "return".

Testing Instructions

For testing this change you need a current Joomla installation with the sample data installed.

Preparations

  • log in to the administration
  • important: check that caching is disabled, if not disable it and clear the site cache
  • open "Extensions", "Modules"
  • search for all site modules containing the string "login" - you should find 3 such modules
  • open the "Login Form" module (this should be positioned at "position-7")
  • change "Encrypt Login Form" to "Yes" and save the settings

Status Quo

  • open the site homepage using HTTP
  • locate the login form in the bottom right of the page
  • check the login form action, it should be something like http://<server>/index.php
  • log in using any valid user and password
  • you're still visiting the site via HTTP
  • log out and close the site homepage

Changes

  • install this PR
  • open the site homepage using HTTP
  • locate the login form and check the login form action, now it should be something like https://<server>/index.php
  • log in using any valid user and password
  • you should now visit the site via HTTPS, the current page is probably the user profile (this is somewhat unexpected, but this is another issue to be fixed separately)
  • go the the site homepage
  • locate the logout form and check the logout form action, it should be something like https://<server>/index.php
  • log out, afterwards you still visit the site via HTTPS (this again is another issue to be fixed separately)
  • close the site homepage
avatar joomla-cms-bot joomla-cms-bot - change - 9 Aug 2016
Category Front End Modules
avatar jo-sf jo-sf - open - 9 Aug 2016
avatar jo-sf jo-sf - change - 9 Aug 2016
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 9 Aug 2016
Labels Added: ?
avatar andrepereiradasilva andrepereiradasilva - test_item - 9 Aug 2016 - Tested successfully
avatar andrepereiradasilva
andrepereiradasilva - comment - 9 Aug 2016

I have tested this item successfully on 8dd80b3

works as expected.

IMHO we should have the same behaviour in the offline pages (protostar and system).
But i guess that needs a parameter at user component level.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/11533.

avatar jeckodevelopment jeckodevelopment - test_item - 9 Aug 2016 - Tested successfully
avatar jeckodevelopment
jeckodevelopment - comment - 9 Aug 2016

I have tested this item successfully on 8dd80b3


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/11533.

avatar infograf768 infograf768 - change - 11 Aug 2016
Status Pending Ready to Commit
avatar infograf768
infograf768 - comment - 11 Aug 2016

2 good testers. RTC


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/11533.

avatar joomla-cms-bot joomla-cms-bot - change - 11 Aug 2016
Labels Added: ?
avatar wilsonge wilsonge - change - 13 Aug 2016
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2016-08-13 21:32:16
Closed_By wilsonge
avatar wilsonge wilsonge - close - 13 Aug 2016
avatar wilsonge wilsonge - merge - 13 Aug 2016
avatar joomla-cms-bot joomla-cms-bot - close - 13 Aug 2016
avatar joomla-cms-bot joomla-cms-bot - change - 13 Aug 2016
Labels Removed: ?

Add a Comment

Login with GitHub to post a comment