? ? Pending

User tests: Successful: Unsuccessful:

avatar PhilETaylor
PhilETaylor
24 Aug 2021

Summary of Changes

When trying to login, with a username/password that doesnt match the internal Joomla database of users, and with LDAP configured, but the LDAP server is down, Symfony LDAP currently throws an LdapException that is not caught

This PR catches that (using PHP 7.1 piped exceptions - thanks @mbabker) and displays a normal Joomla based message instead of a displaying an uncaught exception.

Testing Instructions

YOU DONT NEED LDAP EXPERIENCE OR AN LDAP SERVER TO TEST THIS !!

Configure the LDAP Authentication Plugin, making sure that whatever you put in the HOST field is a valid IP or server, but NOT a valid LDAP service running on that host - my settings:

Screenshot 2021-08-24 at 15 50 34

try to login to Joomla admin with fake credentials.

Actual result BEFORE applying this Pull Request

Screenshot 2021-08-24 at 15 46 27

or with debug enabled

Screenshot 2021-08-24 at 15 45 47

Expected result AFTER applying this Pull Request

Screenshot 2021-08-24 at 15 45 37

Documentation Changes Required

None

avatar PhilETaylor PhilETaylor - open - 24 Aug 2021
avatar PhilETaylor PhilETaylor - change - 24 Aug 2021
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 24 Aug 2021
Category Front End Plugins
avatar PhilETaylor PhilETaylor - change - 24 Aug 2021
The description was changed
avatar PhilETaylor PhilETaylor - edited - 24 Aug 2021
avatar PhilETaylor PhilETaylor - change - 24 Aug 2021
Labels Added: ?
avatar PhilETaylor PhilETaylor - change - 24 Aug 2021
The description was changed
avatar PhilETaylor PhilETaylor - edited - 24 Aug 2021
avatar PhilETaylor PhilETaylor - change - 24 Aug 2021
The description was changed
avatar PhilETaylor PhilETaylor - edited - 24 Aug 2021
avatar PhilETaylor
PhilETaylor - comment - 24 Aug 2021

This PR seems to have broken Drone?

avatar alikon alikon - test_item - 25 Aug 2021 - Tested successfully
avatar alikon
alikon - comment - 25 Aug 2021

I have tested this item successfully on 1728702

without a LDAP server


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

avatar richard67
richard67 - comment - 25 Aug 2021

@PhilETaylor The fix works nice for Authorisation Method = "Bind and search". But with Authorisation Method = "Bind Directly as User" it doesn't. Would it need the same change which you did in line 88 also in line 146?

catch (ConnectionException $exception)

I.e. change there to catch (ConnectionException|LdapException $exception), too.

I've tested that here and it worked.

avatar richard67
richard67 - comment - 25 Aug 2021

@PhilETaylor Beside the above suggestions for code style, did you check my comment above about the other place where I think the changes is also needed? #35347 (comment)

avatar PhilETaylor
PhilETaylor - comment - 25 Aug 2021

Im not really bothered, now knowing this plugin is not worth the bytes it consumes and needs rewriting from scratch to support all the features Joomla 3 supported, and to fix other bugs :-) if you can suggest the other places in the PR I'll hit the merge button on those ... a bit busy today catching up with non-joomla work.

avatar richard67
richard67 - comment - 25 Aug 2021

if you can suggest the other places in the PR I'll hit the merge button on those

@PhilETaylor Can't use suggestion on GitHub because too far away from changed code. Will make PR for your branch instead.

avatar PhilETaylor
PhilETaylor - comment - 25 Aug 2021

ah sorry

avatar richard67
richard67 - comment - 25 Aug 2021

@PhilETaylor See PhilETaylor#11 .. it also contains testing instructions for the part which it adds to your PR.

avatar PhilETaylor
PhilETaylor - comment - 25 Aug 2021

Merged.

avatar richard67 richard67 - test_item - 25 Aug 2021 - Tested successfully
avatar richard67
richard67 - comment - 25 Aug 2021

I have tested this item successfully on e20b98e

With the PR applied, I get an error alert depending on the authorisation method chosen in the plugin's options:

  • Authorisation Method "Bind Directly as User": Message is "Username and password do not match or you do not have an account yet.".
  • Authorisation Method "Bind and search": Message is "Unable to connect to authentication service.".

Without the PR I get an unhandled exception in both cases.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/35347.
avatar richard67
richard67 - comment - 25 Aug 2021

@alikon Could you test again, this time for both possible authorisation methods "Bind Directly as User" and "Bind and search"? Thanks in advance.

avatar PhilETaylor
PhilETaylor - comment - 25 Aug 2021

thanks guys

avatar alikon alikon - test_item - 25 Aug 2021 - Tested successfully
avatar alikon
alikon - comment - 25 Aug 2021

I have tested this item successfully on e20b98e

without a LDAP server


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

avatar alikon alikon - change - 25 Aug 2021
Status Pending Ready to Commit
avatar alikon
alikon - comment - 25 Aug 2021

RTC


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

avatar wilsonge wilsonge - change - 26 Aug 2021
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2021-08-26 14:35:48
Closed_By wilsonge
Labels Added: ?
avatar wilsonge
wilsonge - comment - 26 Aug 2021

Thanks!

Add a Comment

Login with GitHub to post a comment