Undefined index: masquerading when login in
beginner - March 27, 2009 - 08:47
| Project: | Masquerade |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
* notice: Undefined index: masquerading in masquerade.module on line 125.
* notice: Undefined index: masquerading in masquerade.module on line 123.
<?php
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;
}
}
?>
#1
In case 'unswitch' and 'autocomplete', would the following be the intended behavior?
<?phpreturn !empty($GLOBALS['masquerading']) || ... etc.
?>
Are you sure that the case 'unswitch' is secure enough?
#2
I'm not sure what Gurpartap intends there, but I wrapped the globals with empty checks in 6--1.
#3
Automatically closed -- issue fixed for 2 weeks with no activity.