? ? Pending

User tests: Successful: Unsuccessful:

avatar SharkyKZ
SharkyKZ
21 Jul 2020

Fixes #30147.

Summary of Changes

Redirect to com_admin instead of com_users when forced TFA is enabled in backend.

Testing Instructions

Enable some Two Factor Authentication plugins.
Enable "Enforce Two Factor Authentication" for Backend
Create a new user with Access Level "Manager"
Login to backend with new user, setup two factor authentication

Actual result BEFORE applying this Pull Request

Message: "You don't have permission to access this. Please contact a website administrator if this is incorrect."

Expected result AFTER applying this Pull Request

Get redirected to user profile page where TFA can be set up properly.

Documentation Changes Required

No.

avatar SharkyKZ SharkyKZ - open - 21 Jul 2020
avatar SharkyKZ SharkyKZ - change - 21 Jul 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 21 Jul 2020
Category Libraries
avatar SharkyKZ SharkyKZ - change - 21 Jul 2020
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - change - 21 Jul 2020
Category Libraries Administration com_admin Libraries
avatar Harmageddon
Harmageddon - comment - 22 Jul 2020

Just a short note for the testing instructions: Might be worth to mention there that one needs to enable one of the TFA plugins in order to run into this situation. ;-)

avatar ChristineWk
ChristineWk - comment - 22 Jul 2020

Manager Level, before Patch, I got:
Notice
You were redirected because you are required to set up Two Factor Authentication to continue.
An error has occurred.
403 You don't have permission to access this. Please contact a website administrator if this is incorrect.

With Patch:
tfa_manager_only

Then I can't close/leave the session. Had to clear Browser Cache to be able to start again with /administrator entry.

avatar SharkyKZ SharkyKZ - change - 23 Jul 2020
The description was changed
avatar SharkyKZ SharkyKZ - edited - 23 Jul 2020
avatar SharkyKZ
SharkyKZ - comment - 23 Jul 2020

@Harmageddon Thanks, test instructions updated.

@le-jou @ChristineWk please test again.

avatar le-jou le-jou - test_item - 23 Jul 2020 - Tested successfully
avatar le-jou
le-jou - comment - 23 Jul 2020

I have tested this item successfully on ba7c763

Works now, but finishes with warning "Warning
COM_USERS_USERS_ERROR_CANNOT_EDIT_OWN_GROUP"


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

avatar SharkyKZ
SharkyKZ - comment - 23 Jul 2020

That's not intended.

avatar PhilETaylor
PhilETaylor - comment - 23 Jul 2020

Then I can't close/leave the session. Had to clear Browser Cache to be able to start again with /administrator entry.

same as : #29301

avatar PhilETaylor
PhilETaylor - comment - 23 Jul 2020

Just a short note for the testing instructions: Might be worth to mention there that one needs to enable one of the TFA plugins in order to run into this situation. ;-)

Cough Cough #29298

avatar ChristineWk ChristineWk - test_item - 23 Jul 2020 - Tested successfully
avatar ChristineWk
ChristineWk - comment - 23 Jul 2020

I have tested this item successfully on ba7c763

With Patch (Manager):
Notice
You were redirected because you are required to set up Two Factor Authentication to continue.
FYI: But I couldn't set up TFA (no experience with this)
@Harmageddon Thks for your assistance to be able to test this PR.


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

avatar SharkyKZ
SharkyKZ - comment - 24 Jul 2020

PR updated. Please test again.

avatar le-jou le-jou - test_item - 24 Jul 2020 - Tested successfully
avatar le-jou
le-jou - comment - 24 Jul 2020

I have tested this item successfully on 30103dd


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

avatar Harmageddon
Harmageddon - comment - 24 Jul 2020

This PR does solve the bug. But I'm not sure whether it is the best solution. Is there any particular reason why the save method of ProfileModel has to be independent of its parent? This implementation leads to much duplicated code and I can see issues similar to this one here arising when someone changes UserModel::save without remembering that the same changes have to be included in ProfileModel.

In my tests, reducing the ProfileModel::save method to the following seemed to work:

	public function save($data)
	{
		$user = Factory::getUser();
		$pk   = $user->id;
		$data['id'] = $pk;
		$data['block'] = $user->block;
		return parent::save($data);
	}

Or am I missing something? What do you think about it?

avatar toivo toivo - test_item - 25 Jul 2020 - Tested successfully
avatar toivo
toivo - comment - 25 Jul 2020

I have tested this item successfully on 30103dd

Tested successfully in Beta3-dev of 25 July.


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

avatar SharkyKZ
SharkyKZ - comment - 25 Jul 2020

@Harmageddon I tried not to touch existing logic. With your code I get this when using super user account:

Save failed with the following error: You can't save a user account without selecting at least one user group.

avatar Harmageddon
Harmageddon - comment - 25 Jul 2020

@SharkyKZ Oh, I see. Okay, best then to proceed merging this PR here as-is, to fix the described bug.

I'm going to write a new PR for the reduction of duplicated code, so we can test it more in detail there.

avatar Harmageddon Harmageddon - test_item - 25 Jul 2020 - Tested successfully
avatar Harmageddon
Harmageddon - comment - 25 Jul 2020

I have tested this item successfully on 30103dd


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

avatar Quy Quy - change - 25 Jul 2020
Status Pending Ready to Commit
avatar Quy
Quy - comment - 25 Jul 2020

RTC


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

avatar wilsonge wilsonge - change - 25 Jul 2020
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2020-07-25 22:52:20
Closed_By wilsonge
Labels Added: ?
avatar wilsonge wilsonge - close - 25 Jul 2020
avatar wilsonge wilsonge - merge - 25 Jul 2020
avatar wilsonge
wilsonge - comment - 25 Jul 2020

Thanks!

Add a Comment

Login with GitHub to post a comment