Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
* notice: Undefined index: masquerading in masquerade.module on line 125.
* notice: Undefined index: masquerading in masquerade.module on line 123.
function masquerade_access($type) {
switch ($type) {
case 'unswitch':
return $GLOBALS['masquerading'] || arg(2) == 'menu-customize' || arg(2) == 'menu';
case 'autocomplete':
return $GLOBALS['masquerading'] || (user_access('masquerade as user') || user_access('masquerade as admin'));
break;
case 'switch':
return empty($GLOBALS['masquerading']) && (user_access('masquerade as user') || user_access('masquerade as admin'));
break;
}
}
Comments
Comment #1
beginner CreditAttribution: beginner commentedIn case 'unswitch' and 'autocomplete', would the following be the intended behavior?
Are you sure that the case 'unswitch' is secure enough?
Comment #2
deekayen CreditAttribution: deekayen commentedI'm not sure what Gurpartap intends there, but I wrapped the globals with empty checks in 6--1.