Merge lp:~paulgear/wordpress-teams-integration/no-openid-reset-on-logout into lp:wordpress-teams-integration

Proposed by Paul Gear
Status: Merged
Merged at revision: 32
Proposed branch: lp:~paulgear/wordpress-teams-integration/no-openid-reset-on-logout
Merge into: lp:wordpress-teams-integration
Diff against target: 28 lines (+0/-11)
1 file modified
openid-teams.php (+0/-11)
To merge this branch: bzr merge lp:~paulgear/wordpress-teams-integration/no-openid-reset-on-logout
Reviewer Review Type Date Requested Status
Paul Collins lgtm Approve
Review via email: mp+330051@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Paul Collins (pjdc) :
review: Approve (lgtm)
Revision history for this message
Paul Gear (paulgear) wrote :

To summarise the no-longer-visible commit log:

Do not remove OpenID roles on logout

There is no guarantee that logout will be run anyway, and removing the roles is actively harmful, because it prevents an editor from attributing posts to an author after logout.

OpenID roles are reset to their current values on login, so there is no risk in this arrangement that a user will receive increased privileges due to their roles remaining while they are logged out.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'openid-teams.php'
2--- openid-teams.php 2015-01-14 16:21:38 +0000
3+++ openid-teams.php 2017-09-01 01:01:35 +0000
4@@ -32,7 +32,6 @@
5 'openid_teams_add_extenstion', 10, 2);
6 add_action('openid_finish_auth', 'openid_teams_finish_auth', 9, 2);
7 add_action('wp_login', 'openid_teams_assign_on_login');
8-add_action('wp_logout', 'openid_teams_assign_on_logout');
9 /**
10 * Add the teams admin page to the main admin menu
11 */
12@@ -613,16 +612,6 @@
13 }
14
15 /**
16- * Clear the user's roles assigned by openid teams on logout if possible
17- *
18- * It isn't guaranteed that users will use the logout button but this will
19- * remove the roles from the admin interface if they do.
20- */
21-function openid_teams_assign_on_logout() {
22- restore_old_roles(wp_get_current_user());
23-}
24-
25-/**
26 * Remove roles from the user which were assigned on last login by openid teams
27 *
28 * @param object $user

Subscribers

People subscribed via source and target branches