How do I hide the user impersonate button?

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
econsor_ag
Posts: 31
Joined: 18 Jun 2019, 08:35

How do I hide the user impersonate button?

Post by econsor_ag »

Hello,

can I hide the impersonate button in the settings tab of a user? What hook do I need?
I need to do it in PHP so only specific Users with the hardcoded ID can use that button.
cas
Posts: 1028
Joined: 11 Mar 2006, 16:08
Contact:

Re: How do I hide the user impersonate button?

Post by cas »

Check out this setting:
/**
* Threshold needed to impersonate a user or NOBODY to disable the feature.
* @global integer $g_impersonate_user_threshold
*/
$g_impersonate_user_threshold = ADMINISTRATOR;
econsor_ag
Posts: 31
Joined: 18 Jun 2019, 08:35

Re: How do I hide the user impersonate button?

Post by econsor_ag »

cas wrote:
02 Apr 2020, 14:34
Check out this setting:
/**
* Threshold needed to impersonate a user or NOBODY to disable the feature.
* @global integer $g_impersonate_user_threshold
*/
$g_impersonate_user_threshold = ADMINISTRATOR;
Thank you I solved it like this inside my plugin :wink: :

if(auth_get_current_user_id() != 223){
global $g_impersonate_user_threshold;
$g_impersonate_user_threshold = NOBODY;
}
Post Reply