Version Description
- Correctly encode the
redirect_to
parameter in the login screen message.
=
Download this release
Release Info
Developer | johnbillion |
Plugin | User Switching |
Version | 0.8.6 |
Comparing to | |
See all releases |
Code changes from version 0.8.5 to 0.8.6
- readme.txt +211 -208
- user-switching.php +3 -3
readme.txt
CHANGED
@@ -1,208 +1,211 @@
|
|
1 |
-
=== User Switching ===
|
2 |
-
|
3 |
-
Contributors: johnbillion
|
4 |
-
Tags: user, users, profiles, switching, wpmu, multisite, buddypress, bbpress, become, user control, user management, user access, developer
|
5 |
-
Requires at least: 3.1
|
6 |
-
Tested up to: 3.8
|
7 |
-
Stable tag: 0.8.
|
8 |
-
License: GPL v2 or later
|
9 |
-
|
10 |
-
Instant switching between user accounts in WordPress.
|
11 |
-
|
12 |
-
== Description ==
|
13 |
-
|
14 |
-
This plugin allows you to quickly swap between user accounts in WordPress at the click of a button. You'll be instantly logged out and logged in as your desired user. This is handy for test environments where you regularly log out and in between different accounts, or for adminstrators who need to switch between multiple accounts.
|
15 |
-
|
16 |
-
= Features =
|
17 |
-
|
18 |
-
* Switch user: Instantly switch to any user account from the *Users* screen.
|
19 |
-
* Switch back: Instantly switch back to your originating account.
|
20 |
-
* Switch off: Log out of your account but retain the ability to instantly switch back in again.
|
21 |
-
* It's completely secure (see the *Security* section below).
|
22 |
-
* Compatible with WordPress, WordPress Multisite, BuddyPress and bbPress.
|
23 |
-
|
24 |
-
= Security =
|
25 |
-
|
26 |
-
* Only users with the ability to edit other users can switch user accounts. By default this is only Administrators on single site installs, and Super Admins on Multisite installs.
|
27 |
-
* Passwords are not (and cannot be) revealed.
|
28 |
-
* Implements WordPress' nonce security system, meaning only those who intend to switch users can switch.
|
29 |
-
* Full support for administration over SSL (if applicable).
|
30 |
-
|
31 |
-
= Usage =
|
32 |
-
|
33 |
-
1. Visit the *Users* menu in WordPress and you'll see a *Switch To* link next to each user.
|
34 |
-
2. Click this and you will immediately switch into that user account.
|
35 |
-
3. You can switch back to your originating account via the *Switch back* link on each dashboard screen or in your profile menu in the WordPress toolbar.
|
36 |
-
|
37 |
-
See the [FAQ](http://wordpress.org/plugins/user-switching/faq/) for information about the *Switch Off* feature.
|
38 |
-
|
39 |
-
= Translations Included =
|
40 |
-
|
41 |
-
* Arabic by Hassan Hisham
|
42 |
-
* Chinese Simplified by Tunghsiao Liu
|
43 |
-
* Farsi (Persian) by Amin Ab
|
44 |
-
* German by Ralph Stenzel
|
45 |
-
* Japanese by Yusuke Hayasaki
|
46 |
-
* Lithuanian by Tommixoft
|
47 |
-
* Polish by Bartosz Arendt
|
48 |
-
* Russian by R J
|
49 |
-
* Slovak by Max Samael
|
50 |
-
|
51 |
-
== Screenshots ==
|
52 |
-
|
53 |
-
1. ![The *Switch To* link on the Users screen](https://raw.github.com/johnbillion/user-switching/master/assets-wp-repo/screenshot-1.png)
|
54 |
-
2. ![The *Switch To* link on a user's profile](https://raw.github.com/johnbillion/user-switching/master/assets-wp-repo/screenshot-2.png)
|
55 |
-
|
56 |
-
== Installation ==
|
57 |
-
|
58 |
-
If you have the [WordPress Developer plugin](http://wordpress.org/plugins/developer/) installed then User Switching is a one-click install from the Tools -> Developer screen.
|
59 |
-
|
60 |
-
Alternatively, you can install this plugin directly from your WordPress dashboard:
|
61 |
-
|
62 |
-
1. Go to the *Plugins* menu and click *Add New*.
|
63 |
-
2. Search for *User Switching*.
|
64 |
-
3. Click *Install Now* next to the *User Switching* plugin.
|
65 |
-
4. Activate the plugin.
|
66 |
-
|
67 |
-
== Frequently Asked Questions ==
|
68 |
-
|
69 |
-
= What does "Switch off" mean? =
|
70 |
-
|
71 |
-
Switching off logs you out of your account but retains your user ID in an authorisation cookie so you can switch straight back without having to log in again manually. It's akin to switching to no user, and being able to switch back.
|
72 |
-
|
73 |
-
The *Switch Off* link can be found in your profile menu in the WordPress toolbar. Once you've switched off you'll see a *Switch back* link in the footer of your site.
|
74 |
-
|
75 |
-
= Does this plugin work with WordPress Multisite? =
|
76 |
-
|
77 |
-
Yes, and you'll also be able to switch users from the Users screen in Network Admin.
|
78 |
-
|
79 |
-
= Does this plugin work with BuddyPress? =
|
80 |
-
|
81 |
-
Yes, and you'll also be able to switch users from member profile screens and the member listing screen.
|
82 |
-
|
83 |
-
= Does this plugin work with bbPress? =
|
84 |
-
|
85 |
-
Yes, and you'll also be able to switch users from member profile screens.
|
86 |
-
|
87 |
-
= Does this work as a mu-plugin? =
|
88 |
-
|
89 |
-
Yes, but you'll need to install `user-switching.php` into the root of your `mu-plugins` directory, not in the `user-switching` subdirectory. This is a restriction of WordPress.
|
90 |
-
|
91 |
-
= What capability does a user need in order to switch accounts? =
|
92 |
-
|
93 |
-
A user needs the `edit_users` capability in order to switch user accounts. By default only Administrators have this capability, and with Multisite enabled only Super Admins have this capability.
|
94 |
-
|
95 |
-
= Can regular admins on Multisite installs switch accounts? =
|
96 |
-
|
97 |
-
No. This can be enabled though by installing the [User Switching for Regular Admins](https://github.com/johnbillion/user-switching-for-regular-admins) plugin.
|
98 |
-
|
99 |
-
= Are any plugin hooks called when users switch accounts? =
|
100 |
-
|
101 |
-
Yes. When a user switches to another account, the `switch_to_user` hook is called with the new and old user IDs passed as parameters.
|
102 |
-
|
103 |
-
When a user switches back to their original account, the `switch_back_user` hook is called with the new (original) and old user IDs passed as parameters. Note that the old user ID can be boolean false if the user is switching back after they've been switched off.
|
104 |
-
|
105 |
-
When a user switches off, the `switch_off_user` hook is called with the old user ID as a parameter.
|
106 |
-
|
107 |
-
== Upgrade Notice ==
|
108 |
-
|
109 |
-
= 0.8.
|
110 |
-
*
|
111 |
-
|
112 |
-
== Changelog ==
|
113 |
-
|
114 |
-
= 0.8.
|
115 |
-
*
|
116 |
-
|
117 |
-
= 0.8.
|
118 |
-
*
|
119 |
-
|
120 |
-
= 0.8.
|
121 |
-
*
|
122 |
-
|
123 |
-
|
124 |
-
*
|
125 |
-
|
126 |
-
|
127 |
-
*
|
128 |
-
|
129 |
-
= 0.8.
|
130 |
-
*
|
131 |
-
|
132 |
-
= 0.8 =
|
133 |
-
*
|
134 |
-
|
135 |
-
|
136 |
-
*
|
137 |
-
|
138 |
-
|
139 |
-
*
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
*
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
*
|
148 |
-
|
149 |
-
= 0.6.
|
150 |
-
*
|
151 |
-
|
152 |
-
= 0.6.
|
153 |
-
*
|
154 |
-
|
155 |
-
= 0.6 =
|
156 |
-
*
|
157 |
-
|
158 |
-
|
159 |
-
*
|
160 |
-
|
161 |
-
|
162 |
-
*
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
*
|
168 |
-
|
169 |
-
= 0.5.1.
|
170 |
-
*
|
171 |
-
|
172 |
-
= 0.5.1 =
|
173 |
-
*
|
174 |
-
|
175 |
-
= 0.5 =
|
176 |
-
*
|
177 |
-
|
178 |
-
= 0.
|
179 |
-
*
|
180 |
-
|
181 |
-
= 0.4 =
|
182 |
-
*
|
183 |
-
|
184 |
-
|
185 |
-
*
|
186 |
-
|
187 |
-
|
188 |
-
* Fix
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
*
|
193 |
-
|
194 |
-
= 0.3 =
|
195 |
-
*
|
196 |
-
|
197 |
-
= 0.
|
198 |
-
*
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
*
|
203 |
-
|
204 |
-
= 0.2 =
|
205 |
-
*
|
206 |
-
|
207 |
-
= 0.
|
208 |
-
*
|
|
|
|
|
|
1 |
+
=== User Switching ===
|
2 |
+
|
3 |
+
Contributors: johnbillion
|
4 |
+
Tags: user, users, profiles, switching, wpmu, multisite, buddypress, bbpress, become, user control, user management, user access, developer
|
5 |
+
Requires at least: 3.1
|
6 |
+
Tested up to: 3.8
|
7 |
+
Stable tag: 0.8.6
|
8 |
+
License: GPL v2 or later
|
9 |
+
|
10 |
+
Instant switching between user accounts in WordPress.
|
11 |
+
|
12 |
+
== Description ==
|
13 |
+
|
14 |
+
This plugin allows you to quickly swap between user accounts in WordPress at the click of a button. You'll be instantly logged out and logged in as your desired user. This is handy for test environments where you regularly log out and in between different accounts, or for adminstrators who need to switch between multiple accounts.
|
15 |
+
|
16 |
+
= Features =
|
17 |
+
|
18 |
+
* Switch user: Instantly switch to any user account from the *Users* screen.
|
19 |
+
* Switch back: Instantly switch back to your originating account.
|
20 |
+
* Switch off: Log out of your account but retain the ability to instantly switch back in again.
|
21 |
+
* It's completely secure (see the *Security* section below).
|
22 |
+
* Compatible with WordPress, WordPress Multisite, BuddyPress and bbPress.
|
23 |
+
|
24 |
+
= Security =
|
25 |
+
|
26 |
+
* Only users with the ability to edit other users can switch user accounts. By default this is only Administrators on single site installs, and Super Admins on Multisite installs.
|
27 |
+
* Passwords are not (and cannot be) revealed.
|
28 |
+
* Implements WordPress' nonce security system, meaning only those who intend to switch users can switch.
|
29 |
+
* Full support for administration over SSL (if applicable).
|
30 |
+
|
31 |
+
= Usage =
|
32 |
+
|
33 |
+
1. Visit the *Users* menu in WordPress and you'll see a *Switch To* link next to each user.
|
34 |
+
2. Click this and you will immediately switch into that user account.
|
35 |
+
3. You can switch back to your originating account via the *Switch back* link on each dashboard screen or in your profile menu in the WordPress toolbar.
|
36 |
+
|
37 |
+
See the [FAQ](http://wordpress.org/plugins/user-switching/faq/) for information about the *Switch Off* feature.
|
38 |
+
|
39 |
+
= Translations Included =
|
40 |
+
|
41 |
+
* Arabic by Hassan Hisham
|
42 |
+
* Chinese Simplified by Tunghsiao Liu
|
43 |
+
* Farsi (Persian) by Amin Ab
|
44 |
+
* German by Ralph Stenzel
|
45 |
+
* Japanese by Yusuke Hayasaki
|
46 |
+
* Lithuanian by Tommixoft
|
47 |
+
* Polish by Bartosz Arendt
|
48 |
+
* Russian by R J
|
49 |
+
* Slovak by Max Samael
|
50 |
+
|
51 |
+
== Screenshots ==
|
52 |
+
|
53 |
+
1. ![The *Switch To* link on the Users screen](https://raw.github.com/johnbillion/user-switching/master/assets-wp-repo/screenshot-1.png)
|
54 |
+
2. ![The *Switch To* link on a user's profile](https://raw.github.com/johnbillion/user-switching/master/assets-wp-repo/screenshot-2.png)
|
55 |
+
|
56 |
+
== Installation ==
|
57 |
+
|
58 |
+
If you have the [WordPress Developer plugin](http://wordpress.org/plugins/developer/) installed then User Switching is a one-click install from the Tools -> Developer screen.
|
59 |
+
|
60 |
+
Alternatively, you can install this plugin directly from your WordPress dashboard:
|
61 |
+
|
62 |
+
1. Go to the *Plugins* menu and click *Add New*.
|
63 |
+
2. Search for *User Switching*.
|
64 |
+
3. Click *Install Now* next to the *User Switching* plugin.
|
65 |
+
4. Activate the plugin.
|
66 |
+
|
67 |
+
== Frequently Asked Questions ==
|
68 |
+
|
69 |
+
= What does "Switch off" mean? =
|
70 |
+
|
71 |
+
Switching off logs you out of your account but retains your user ID in an authorisation cookie so you can switch straight back without having to log in again manually. It's akin to switching to no user, and being able to switch back.
|
72 |
+
|
73 |
+
The *Switch Off* link can be found in your profile menu in the WordPress toolbar. Once you've switched off you'll see a *Switch back* link in the footer of your site.
|
74 |
+
|
75 |
+
= Does this plugin work with WordPress Multisite? =
|
76 |
+
|
77 |
+
Yes, and you'll also be able to switch users from the Users screen in Network Admin.
|
78 |
+
|
79 |
+
= Does this plugin work with BuddyPress? =
|
80 |
+
|
81 |
+
Yes, and you'll also be able to switch users from member profile screens and the member listing screen.
|
82 |
+
|
83 |
+
= Does this plugin work with bbPress? =
|
84 |
+
|
85 |
+
Yes, and you'll also be able to switch users from member profile screens.
|
86 |
+
|
87 |
+
= Does this work as a mu-plugin? =
|
88 |
+
|
89 |
+
Yes, but you'll need to install `user-switching.php` into the root of your `mu-plugins` directory, not in the `user-switching` subdirectory. This is a restriction of WordPress.
|
90 |
+
|
91 |
+
= What capability does a user need in order to switch accounts? =
|
92 |
+
|
93 |
+
A user needs the `edit_users` capability in order to switch user accounts. By default only Administrators have this capability, and with Multisite enabled only Super Admins have this capability.
|
94 |
+
|
95 |
+
= Can regular admins on Multisite installs switch accounts? =
|
96 |
+
|
97 |
+
No. This can be enabled though by installing the [User Switching for Regular Admins](https://github.com/johnbillion/user-switching-for-regular-admins) plugin.
|
98 |
+
|
99 |
+
= Are any plugin hooks called when users switch accounts? =
|
100 |
+
|
101 |
+
Yes. When a user switches to another account, the `switch_to_user` hook is called with the new and old user IDs passed as parameters.
|
102 |
+
|
103 |
+
When a user switches back to their original account, the `switch_back_user` hook is called with the new (original) and old user IDs passed as parameters. Note that the old user ID can be boolean false if the user is switching back after they've been switched off.
|
104 |
+
|
105 |
+
When a user switches off, the `switch_off_user` hook is called with the old user ID as a parameter.
|
106 |
+
|
107 |
+
== Upgrade Notice ==
|
108 |
+
|
109 |
+
= 0.8.6 =
|
110 |
+
* Correctly encode the `redirect_to` parameter in the login screen message.
|
111 |
+
|
112 |
+
== Changelog ==
|
113 |
+
|
114 |
+
= 0.8.6 =
|
115 |
+
* Correctly encode the `redirect_to` parameter in the login screen message.
|
116 |
+
|
117 |
+
= 0.8.5 =
|
118 |
+
* Add a 'Switch To' link to bbPress profile screens.
|
119 |
+
|
120 |
+
= 0.8.4 =
|
121 |
+
* Revert a change in 0.8.3 which switched to using the `login_init` hook. This hook is fired too late.
|
122 |
+
|
123 |
+
= 0.8.3 =
|
124 |
+
* Switch to storing data in cookies as JSON instead of PHP-serialized.
|
125 |
+
* Show admin notices on all possible admin screens.
|
126 |
+
* Tweak the redirect location for BuddyPress user profiles.
|
127 |
+
* Change the textdomain in the plugin to match the plugin slug (required for language packs in WordPress core).
|
128 |
+
|
129 |
+
= 0.8.2 =
|
130 |
+
* Russian translation by R J
|
131 |
+
|
132 |
+
= 0.8.1 =
|
133 |
+
* Japanese translation by Yusuke Hayasaki
|
134 |
+
|
135 |
+
= 0.8 =
|
136 |
+
* Nested switching and switching back is now supported (capability permitting). Switch, switch again, switch back, switch back!
|
137 |
+
* Fix for BuddyPress 1.7 member profile pages. Props nat0n.
|
138 |
+
* Updated Arabic translation by Hassan Hisham.
|
139 |
+
* A little code refactoring and improving, completed inline docs.
|
140 |
+
|
141 |
+
= 0.7.1 =
|
142 |
+
* Arabic translation by Hassan Hisham.
|
143 |
+
* Minor code tweaks.
|
144 |
+
|
145 |
+
= 0.7 =
|
146 |
+
* Always show a 'Switch back' link in the footer when the admin toolbar isn't showing.
|
147 |
+
* More intuitive redirecting after switching.
|
148 |
+
|
149 |
+
= 0.6.3 =
|
150 |
+
* Lithuanian translation by Tommixoft.
|
151 |
+
|
152 |
+
= 0.6.2 =
|
153 |
+
* Polish translation by Bartosz Arendt.
|
154 |
+
|
155 |
+
= 0.6.1 =
|
156 |
+
* Slovak translation by Max Samael.
|
157 |
+
|
158 |
+
= 0.6 =
|
159 |
+
* More intuitive redirecting after switching.
|
160 |
+
* Avoid a BuddyPress bug preventing Switch To buttons from appearing.
|
161 |
+
* Added a template function: `current_user_switched()` which lets you know if the current user switched into their account.
|
162 |
+
* Added some hooks: `switch_to_user`, `switch_back_user` and `switch_off_user`, fired when appropriate.
|
163 |
+
|
164 |
+
= 0.5.2 =
|
165 |
+
* Farsi (Persian) translation by Amin Ab.
|
166 |
+
* Display switch back links in Network Admin and login screen.
|
167 |
+
* Avoid a BuddyPress bug preventing Switch To buttons from appearing.
|
168 |
+
|
169 |
+
= 0.5.1.2 =
|
170 |
+
* German translation by Ralph Stenzel.
|
171 |
+
|
172 |
+
= 0.5.1.1 =
|
173 |
+
* Chinese Simplified translation by Sparanoid.
|
174 |
+
|
175 |
+
= 0.5.1 =
|
176 |
+
* Toolbar tweaks for WordPress 3.3.
|
177 |
+
|
178 |
+
= 0.5 =
|
179 |
+
* New "Switch off" function: Log out and log instantly back in again when needed (see the FAQ).
|
180 |
+
|
181 |
+
= 0.4.1 =
|
182 |
+
* Support for upcoming changes to the admin bar in WordPress 3.3.
|
183 |
+
|
184 |
+
= 0.4 =
|
185 |
+
* Add some extended support for BuddyPress.
|
186 |
+
* Add some extended support for Multisite.
|
187 |
+
* Fix a permissions problem for users with no privileges.
|
188 |
+
* Fix a PHP warning when used as a mu-plugin (thanks Scribu).
|
189 |
+
|
190 |
+
= 0.3.2 =
|
191 |
+
* Fix the 'Switch back to' menu item in the WordPress admin bar (WordPress 3.1+).
|
192 |
+
* Fix a formatting issue on the user profile page.
|
193 |
+
|
194 |
+
= 0.3.1 =
|
195 |
+
* Prevent admins switching to multisite super admin accounts.
|
196 |
+
|
197 |
+
= 0.3 =
|
198 |
+
* Adds an admin bar menu item (WordPress 3.1+) for switching back to the user you switched from.
|
199 |
+
|
200 |
+
= 0.2.2 =
|
201 |
+
* Respect the current 'Remember me' setting when switching users.
|
202 |
+
* Redirect to home page instead of admin screen if the user you're switching to has no privileges.
|
203 |
+
|
204 |
+
= 0.2.1 =
|
205 |
+
* Edge case bugfix to prevent 'Switch back to...' message appearing when it shouldn't.
|
206 |
+
|
207 |
+
= 0.2 =
|
208 |
+
* Functionality for switching back to user you switched from.
|
209 |
+
|
210 |
+
= 0.1 =
|
211 |
+
* Initial release.
|
user-switching.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/*
|
3 |
Plugin Name: User Switching
|
4 |
Description: Instant switching between user accounts in WordPress
|
5 |
-
Version: 0.8.
|
6 |
Plugin URI: https://lud.icro.us/wordpress-plugin-user-switching/
|
7 |
Author: John Blackbourn
|
8 |
Author URI: https://johnblackbourn.com/
|
@@ -10,7 +10,7 @@ Text Domain: user-switching
|
|
10 |
Domain Path: /languages/
|
11 |
License: GPL v2 or later
|
12 |
|
13 |
-
Copyright ©
|
14 |
|
15 |
This program is free software; you can redistribute it and/or modify
|
16 |
it under the terms of the GNU General Public License as published by
|
@@ -320,7 +320,7 @@ class user_switching {
|
|
320 |
$url = self::switch_back_url();
|
321 |
if ( isset( $_REQUEST['redirect_to'] ) and !empty( $_REQUEST['redirect_to'] ) ) {
|
322 |
$url = add_query_arg( array(
|
323 |
-
'redirect_to' => $_REQUEST['redirect_to']
|
324 |
), $url );
|
325 |
}
|
326 |
$message .= '<p class="message"><a href="' . $url . '">' . $link . '</a></p>';
|
2 |
/*
|
3 |
Plugin Name: User Switching
|
4 |
Description: Instant switching between user accounts in WordPress
|
5 |
+
Version: 0.8.6
|
6 |
Plugin URI: https://lud.icro.us/wordpress-plugin-user-switching/
|
7 |
Author: John Blackbourn
|
8 |
Author URI: https://johnblackbourn.com/
|
10 |
Domain Path: /languages/
|
11 |
License: GPL v2 or later
|
12 |
|
13 |
+
Copyright © 2014 John Blackbourn
|
14 |
|
15 |
This program is free software; you can redistribute it and/or modify
|
16 |
it under the terms of the GNU General Public License as published by
|
320 |
$url = self::switch_back_url();
|
321 |
if ( isset( $_REQUEST['redirect_to'] ) and !empty( $_REQUEST['redirect_to'] ) ) {
|
322 |
$url = add_query_arg( array(
|
323 |
+
'redirect_to' => urlencode( $_REQUEST['redirect_to'] )
|
324 |
), $url );
|
325 |
}
|
326 |
$message .= '<p class="message"><a href="' . $url . '">' . $link . '</a></p>';
|