Any ideas how I can integrate the User Switching function avail in the Devel module with the User Accounts View? I tried adding a Global custom text link to admin/devel/switch/[name] but I think it needs more than what I am passing it, because it throws a 403 even as admin.
Accepted answer
Comments
The access callback _devel_switch_user_access()
for the menu item admin/devel/switch
actually checks for a valid security token passed in the path as a GET request (under the key token
).
So, you can't just call that path. You have to generate a security token (with backdrop_get_token()
) and attach it to the path, as in admin/devel/switch/USERNAME?destination=&token=sv0acpiL5UFY0YvaTNe3j4AEpwKrBhg7UPB8XHStWzs
This can't be done using a Global text field in Views. You'll need to create a special views field handler that generates and attaches the security token to the path.
So if I rewrite the output using a template , ie views-view-field--user-admin--page--nothing.tpl.php this should work?
The access callback
_devel_switch_user_access()
for the menu itemadmin/devel/switch
actually checks for a valid security token passed in the path as a GET request (under the keytoken
).So, you can't just call that path. You have to generate a security token (with
backdrop_get_token()
) and attach it to the path, as inadmin/devel/switch/USERNAME?destination=&token=sv0acpiL5UFY0YvaTNe3j4AEpwKrBhg7UPB8XHStWzs
This can't be done using a Global text field in Views. You'll need to create a special views field handler that generates and attaches the security token to the path.