Changing the auth method requires info about remoteuser getting lost

Bug #1180194 reported by Kristina Hoeppner
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
High
Robert Lyon
1.5
Fix Released
High
Robert Lyon
1.6
Fix Released
High
Robert Lyon
1.8
Fix Released
High
Robert Lyon

Bug Description

When you change the auth method on /admin/users/bulk.php for users who have an external auth method, their remote username is deleted even if you change it to another external auth method. Thus, you'll need to redo the remote username from scratch.

There should be a help button with info about what happens so admins aren't surprised when the remote username is suddenly missing.

tags: added: bite-sized
Revision history for this message
Robert Lyon (robertl-9) wrote :

I was unable to replicate.

I set up a test institution with a few different external auth methods
I added a dozen users to the institution - all of which had a remote user name set.

I tried changing the auth method for some of them via the bulk update page and watched the authinstance and remoteusername db columns

I tried changing a bunch of users:
- of the same external auth method to another external auth method
- of different external auth methods to another external auth method
- to Institution:internal auth then back to an external option
- to mahara:internal auth then back to an institution's external option

The users changed auth method as expected but in none of my tests did the remote user name disappear

Revision history for this message
Robert Lyon (robertl-9) wrote :

Ah now I see what is going on - there are two authinstance columns, one in usr, one in auth_remote_user.

If I update a user's auth on /admin/users/edit.php it updates both table columns

But if I do bulk update it only updates the usr table and not the auth_remote_usr table as well

Right will try and fix

Changed in mahara:
assignee: nobody → Robert Lyon (robertl-9)
Robert Lyon (robertl-9)
Changed in mahara:
status: Triaged → In Progress
Revision history for this message
Robert Lyon (robertl-9) wrote :

Ok, have submitted a patch
https://reviews.mahara.org/#/c/2242/

To test:

Before applying patch:
1) Set up a mahara site with an institution that has more than one remote authentication type
2) Add a bunch of users to this institution and give them a remote authentication choice (can all be same or a mix different types) and make sure each has a remote username - this can be checked by going to Users -> get report for the users in question.
3) on the Users page select the ones you want to change and click 'Edit' this will take you to the /admin/users/bulk.php page
4) Select a new authentication from the 'Change authentication method' and click 'Submit'
5) Check users again by going to Users -> get report for the users in question - it should now show that they have lost their remote username

Now apply the patch and do steps 3 - 5 above (or start with new users) and this time the remote username field should contain their remote username as expected for the auth method they are on.

Changed in mahara:
milestone: none → 1.7.2
Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/2242
Committed: http://gitorious.org/mahara/mahara/commit/cfe80afbc8f45e01f0c7b3279a01cdfbf6b35da7
Submitter: Son Nguyen (<email address hidden>)
Branch: master

commit cfe80afbc8f45e01f0c7b3279a01cdfbf6b35da7
Author: Robert Lyon <email address hidden>
Date: Mon May 27 08:00:42 2013 +1200

Fix for bulk user change auth method problem (Bug #1180194)

The auth_remote_user db table was not being updated correctly when
users were being moved from one auth method to another in bulk.
Fix adds in the correct lines to that table. Code similar to what
is used in admin/users/edit.php for single user update.

Moved some things around to improve performance and fixed a mistake
Used a better way to check authname

Change-Id: Ieb2d453bc06646444aadaff92ea5b42af4246411
Signed-off-by: Robert Lyon <email address hidden>

Son Nguyen (ngson2000)
Changed in mahara:
status: In Progress → Fix Committed
Revision history for this message
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/2316
Committed: http://gitorious.org/mahara/mahara/commit/7d6ab3e30b664b00bf772e8e7927dcf90dd6b5b0
Submitter: Son Nguyen (<email address hidden>)
Branch: 1.6_STABLE

commit 7d6ab3e30b664b00bf772e8e7927dcf90dd6b5b0
Author: Robert Lyon <email address hidden>
Date: Mon May 27 08:00:42 2013 +1200

Fix for bulk user change auth method problem (Bug #1180194)

The auth_remote_user db table was not being updated correctly when
users were being moved from one auth method to another in bulk.
Fix adds in the correct lines to that table. Code similar to what
is used in admin/users/edit.php for single user update.

Moved some things around to improve performance and fixed a mistake

Change-Id: Ieb2d453bc06646444aadaff92ea5b42af4246411
Signed-off-by: Robert Lyon <email address hidden>

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/2317
Committed: http://gitorious.org/mahara/mahara/commit/ac2a5530566ac68d47d0c82e49abc37bd968c9c7
Submitter: Son Nguyen (<email address hidden>)
Branch: 1.5_STABLE

commit ac2a5530566ac68d47d0c82e49abc37bd968c9c7
Author: Robert Lyon <email address hidden>
Date: Mon May 27 08:00:42 2013 +1200

Fix for bulk user change auth method problem (Bug #1180194)

The auth_remote_user db table was not being updated correctly when
users were being moved from one auth method to another in bulk.
Fix adds in the correct lines to that table. Code similar to what
is used in admin/users/edit.php for single user update.

Moved some things around to improve performance and fixed a mistake

Change-Id: Ieb2d453bc06646444aadaff92ea5b42af4246411
Signed-off-by: Robert Lyon <email address hidden>

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/2315
Committed: http://gitorious.org/mahara/mahara/commit/739881aa759c67547a44c5ab2eeb92f1e1b22387
Submitter: Son Nguyen (<email address hidden>)
Branch: 1.7_STABLE

commit 739881aa759c67547a44c5ab2eeb92f1e1b22387
Author: Robert Lyon <email address hidden>
Date: Mon May 27 08:00:42 2013 +1200

Fix for bulk user change auth method problem (Bug #1180194)

The auth_remote_user db table was not being updated correctly when
users were being moved from one auth method to another in bulk.
Fix adds in the correct lines to that table. Code similar to what
is used in admin/users/edit.php for single user update.

Moved some things around to improve performance and fixed a mistake

Change-Id: Ieb2d453bc06646444aadaff92ea5b42af4246411
Signed-off-by: Robert Lyon <email address hidden>

Revision history for this message
Aaron Wells (u-aaronw) wrote :

Catching up on my code reviews, I noticed some problems in how the database API was used in this patch. I've added a newer patch of my own which corrects the problem: https://reviews.mahara.org/2366

Changed in mahara:
status: Fix Committed → In Progress
Revision history for this message
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/2366
Committed: http://gitorious.org/mahara/mahara/commit/df089016f2a23dca961b7d2024c5166fc99dd3bc
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit df089016f2a23dca961b7d2024c5166fc99dd3bc
Author: Aaron Wells <email address hidden>
Date: Tue Jul 23 17:28:14 2013 +1200

Better usage of the DML API

Bug1180194

Change-Id: Idfaad6ba9138eabc8e0efa4f72a5a3da224c7eab

Robert Lyon (robertl-9)
Changed in mahara:
status: In Progress → Fix Committed
Revision history for this message
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/2372
Committed: http://gitorious.org/mahara/mahara/commit/aaff1d003a47418085511b123f53a917e44900e4
Submitter: Aaron Wells (<email address hidden>)
Branch: 1.7_STABLE

commit aaff1d003a47418085511b123f53a917e44900e4
Author: Aaron Wells <email address hidden>
Date: Tue Jul 23 17:28:14 2013 +1200

Better usage of the DML API

Bug1180194

Change-Id: Idfaad6ba9138eabc8e0efa4f72a5a3da224c7eab

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/2373
Committed: http://gitorious.org/mahara/mahara/commit/1fdd0b410c854397baa2af8be0489d76d5ce54f6
Submitter: Aaron Wells (<email address hidden>)
Branch: 1.6_STABLE

commit 1fdd0b410c854397baa2af8be0489d76d5ce54f6
Author: Aaron Wells <email address hidden>
Date: Tue Jul 23 17:28:14 2013 +1200

Better usage of the DML API

Bug1180194

Change-Id: Idfaad6ba9138eabc8e0efa4f72a5a3da224c7eab

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Reviewed: https://reviews.mahara.org/2374
Committed: http://gitorious.org/mahara/mahara/commit/57c13fd74e45d47a97f40a3f221c333c2d5d5285
Submitter: Aaron Wells (<email address hidden>)
Branch: 1.5_STABLE

commit 57c13fd74e45d47a97f40a3f221c333c2d5d5285
Author: Aaron Wells <email address hidden>
Date: Tue Jul 23 17:28:14 2013 +1200

Better usage of the DML API

Bug1180194

Change-Id: Idfaad6ba9138eabc8e0efa4f72a5a3da224c7eab

Robert Lyon (robertl-9)
Changed in mahara:
status: Fix Committed → Fix Released
Aaron Wells (u-aaronw)
Changed in mahara:
milestone: 1.7.2 → 1.8.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers