Page 1 of 1
How do I hide the user impersonate button?
Posted: 02 Apr 2020, 12:26
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.
Re: How do I hide the user impersonate button?
Posted: 02 Apr 2020, 14:34
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;
Re: How do I hide the user impersonate button?
Posted: 03 Apr 2020, 14:38
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
:
if(auth_get_current_user_id() != 223){
global $g_impersonate_user_threshold;
$g_impersonate_user_threshold = NOBODY;
}