User tests: Successful: Unsuccessful:
Fixes #30147.
Redirect to com_admin
instead of com_users
when forced TFA is enabled in backend.
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
Message: "You don't have permission to access this. Please contact a website administrator if this is incorrect."
Get redirected to user profile page where TFA can be set up properly.
No.
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries |
Labels |
Added:
?
|
Category | Libraries | ⇒ | Administration com_admin Libraries |
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.
Then I can't close/leave the session. Had to clear Browser Cache to be able to start again with /administrator entry.
@Harmageddon Thanks, test instructions updated.
@le-jou @ChristineWk please test again.
I have tested this item
Works now, but finishes with warning "Warning
COM_USERS_USERS_ERROR_CANNOT_EDIT_OWN_GROUP"
That's not intended.
I have tested this item
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.
PR updated. Please test again.
I have tested this item
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?
I have tested this item
Tested successfully in Beta3-dev of 25 July.
@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.
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC
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:
?
|
Thanks!
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. ;-)