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
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

beginner - March 27, 2009 - 08:55

In case 'unswitch' and 'autocomplete', would the following be the intended behavior?

<?php
return !empty($GLOBALS['masquerading']) || ... etc.
?>

Are you sure that the case 'unswitch' is secure enough?

#2

deekayen - June 20, 2009 - 04:57
Status:active» fixed

I'm not sure what Gurpartap intends there, but I wrapped the globals with empty checks in 6--1.

#3

System Message - July 4, 2009 - 05:00
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.