?
avatar PhilETaylor
PhilETaylor
8 Jul 2020

Steps to reproduce the issue

add public $root_user = 'admin'; in your /configuration.php of a Joomla3/4 site
Navigate to /administrator/

Expected result

No notification on login screen

Actual result

It says Im logged in - Im not.
It says I can click to automatically remove the value - I can't

Screenshot 2020-07-08 at 09 05 28

Screenshot 2020-07-08 at 09 23 59

avatar PhilETaylor PhilETaylor - open - 8 Jul 2020
avatar joomla-cms-bot joomla-cms-bot - change - 8 Jul 2020
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 8 Jul 2020
avatar PhilETaylor PhilETaylor - change - 8 Jul 2020
Title
[4.0] When $root_user defined in configuration.php, message on login screen
3/4 When $root_user defined in configuration.php, message on login screen
avatar PhilETaylor PhilETaylor - edited - 8 Jul 2020
avatar PhilETaylor PhilETaylor - change - 8 Jul 2020
The description was changed
avatar PhilETaylor PhilETaylor - edited - 8 Jul 2020
avatar toivo
toivo - comment - 8 Jul 2020

@PhilETaylor unable to reproduce in an out-of-the-box Beta3-dev of 8 July with no patches applied. No luck in 3.9.19 either, the message is displayed only after I have logged in.


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

avatar PhilETaylor
PhilETaylor - comment - 8 Jul 2020

Sorry for the mis information.

On debugging it looks like one of the mySites.guru tools (that is in development) had removed the setting value, but not removed the class property from JConfig

I have replicated again in Joomla 4 just now by setting public $root_user = null; in global config.
I have replicated again in Joomla 3 just now by setting public $root_user = ''; in global config.

avatar PhilETaylor
PhilETaylor - comment - 8 Jul 2020

in Joomla 4 (as that's the code open on my screen) the check starts with

if (property_exists('\JConfig', 'root_user'))

thus explaining the behaviour Im seeing with null and ''

avatar toivo
toivo - comment - 8 Jul 2020

@PhilETaylor Now saw the message in the admin login page of Joomla4 after using an empty root user in configuration.php: public $root_user = '';

Managed to get rid of the message in the above situation by adding a default value to the preceding get(), right or wrong:
// Safety check for when configuration.php root_user is in use.
$rootUser = $this->get('root_user', 'this-user-does-not-exist');

Maybe the should separate the two use cases more clearly, first when a Super User is already logged in and then when someone wants to login to the back end.


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

avatar PhilETaylor
PhilETaylor - comment - 8 Jul 2020

could just go for a smaller change (as 'this-user-does-not-exist' might actually exist ;-) )

if (property_exists('\JConfig', 'root_user') && $rootuser)

This would then cover "", '', null and false :-)

avatar toivo
toivo - comment - 8 Jul 2020

You are right, that works but it would introduce a bug because the variable is not $rootuser but $rootUser ;-)
if (property_exists('\JConfig', 'root_user') && $rootUser)


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

avatar PhilETaylor
PhilETaylor - comment - 8 Jul 2020

Ah well - blame typing the comment on iphone ;-)

avatar PhilETaylor PhilETaylor - change - 8 Jul 2020
Status New Closed
Closed_Date 0000-00-00 00:00:00 2020-07-08 15:54:01
Closed_By PhilETaylor
avatar PhilETaylor
PhilETaylor - comment - 8 Jul 2020

#30057 for Joomla 3 - and pray George is still bubbling up these fixes into the Joomla 4 codebase :)

avatar PhilETaylor PhilETaylor - close - 8 Jul 2020

Add a Comment

Login with GitHub to post a comment